This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use the new forum.
Today's Messages (OFF)  | Unanswered Messages (ON)

Forum: symfony 1.1
 Topic: Get Configuration parameter in a Filter
Get Configuration parameter in a Filter [message #59362] Sun, 24 August 2008 20:13
hasch  is currently offline hasch
Messages: 12
Registered: August 2008
Junior Member
Does anyone know how to get a parameter set in security.yml in a config-folder of a module?

I tried in a filter to access via:
sfConfig::get('security_actionname_is_secure');


Has anyone an idea? Smile

[Updated on: Sun, 24 August 2008 20:13]

 Topic: Filters in 1.1?
Filters in 1.1? [message #59376] Mon, 25 August 2008 12:22
jamesjeffery  is currently offline jamesjeffery
Messages: 29
Registered: August 2008
Location: Birmingham, UK
Junior Member
Hi All,

I have been reading the Symfony book with excitement. First of all I am loving Symfony, its an amazing framework and I can't wait to start developing client applications using it.

I got to the chapter with the section on Validation and Filters and it said that the features won't work in 1.1.

What alternatives can I use to filters? I tried to google, but found nothing on it.

Thanks

James Jeffery


"You are what you make yourself in life"
 Topic: Input for time picker in generator
Input for time picker in generator [message #59476] Tue, 26 August 2008 21:19
kurosaki  is currently offline kurosaki
Messages: 67
Registered: August 2008
Member
For generator.yml...

is there any time picker like the date picker for a time column.

I only use input_tag to get this work.

Also, is there any input for password, because I found about input_password_tag but it didn't work.

 Topic: Structure partials in folder
icon3.gif  Structure partials in folder [message #59533] Wed, 27 August 2008 13:01
sgt_schultz  is currently offline sgt_schultz
Messages: 27
Registered: June 2008
Location: Switzerland
Junior Member

English:

Hello everybody, if you want to create a structure in the "template" folder for your "Partials" you can now make that with my new Helper.

Français:

Hello à tout, si vous désirez créer une structure dans les dossiers "template" afin de structurer vos "Partial", vous pouvez utiliser mon nouveau Helper.

[Updated on: Thu, 28 August 2008 07:07]


I see nothing, I hear nothing, nothing !!!
 Topic: generator.yml getParameter??
generator.yml getParameter?? [message #59659] Thu, 28 August 2008 19:15
ivaras  is currently offline ivaras
Messages: 3
Registered: August 2008
Junior Member
i'm trying to display the param 'alumno_id', in the generator.yml
i got an error : $sf_request is not an object
how can i get this parameter????

the generator.yml ->>

fields:
alumno_id: {name : Alumno, type: input_tag , params: value=<?php echo $sf_request->getParameter['alumno_id'] ?> }
list:
actions:
_create: {action: <?php echo 'create?alumno_id=1'?>}



 Topic: Tasks - Doctrine - "There is no open connection"
Tasks - Doctrine - "There is no open connection" [message #59758] Fri, 29 August 2008 17:08
hasch  is currently offline hasch
Messages: 12
Registered: August 2008
Junior Member
Does anyone know how to use Doctrine in Tasks?
I tried Doctrine_Query::create(), but this returned an error:
Quote:

There is no open connection


I found only the following page to tasks:
http://www.symfony-project.org/cookbook/1_1/en/tasks

Has anyone an idea?
 Topic: Rich text editor and valodator i18n messages in 1.1
icon5.gif  Rich text editor and valodator i18n messages in 1.1 [message #59771] Fri, 29 August 2008 19:40
sdemch  is currently offline sdemch
Messages: 10
Registered: May 2008
Location: Moscow
Junior Member
Greetings for all, Symfonyans.

I have 2 real questions.

1st - Why sfWidgetFormTextarea() not support RichText Editor? I used own walidator. But interesting is it a part of global plan or just a bug?


2nd - Why Validation error messages dont support I18N message file.
Wneh i made i18n:extract messages.xliff was created but only from templates __(""), but not from

,new sfBlacklistValidator(array()
,array('invalid'=>'BAD NAME VALUE'))

As i understood in message.xcliff must be entry for "BAD NAME VALUE". And I add it manualy, but still no effect.

Thanks for all.


 Topic: ProjectConfiguration Autoloading Classes?
ProjectConfiguration Autoloading Classes? [message #59777] Fri, 29 August 2008 21:49
someone1  is currently offline someone1
Messages: 16
Registered: August 2008
Location: New Jersey
Junior Member
Hey,

I made a custom session handler class that i popped into the lib/ folder (filename: session.class.php, classname: Session)

In my ProjectConfiugration.class.php:
require_once('C:\xampp\htdocs\client\lib\session.class.php');
require_once 'C:\xampp\php\PEAR\symfony/autoload/sfCoreAutoload.class.php';
sfCoreAutoload::register();

class ProjectConfiguration extends sfProjectConfiguration
{
  public function setup()
  {
	session_set_save_handler(array('Session', 'open'),
							array('Session', 'close'),
							array('Session', 'read'),
							array('Session', 'write'),
							array('Session', 'destroy'),
							array('Session', 'close')
							);
  }
  
}


As you can see, the only way i could get this to work is to manually add a "require_once()" up top to load the Session class. I thought symfony was supposed to auto-load classes found in the lib/ directory? Or is this done after the projectconfiguration is loaded?

-Prateek
 Topic: Problem with sfForm->save() for an update
Problem with sfForm->save() for an update [message #59788] Sat, 30 August 2008 02:09
omoratin  is currently offline omoratin
Messages: 144
Registered: December 2005
Senior Member
Hi,

I'm new to 1.1 so be patient Smile

Because of my application UI, my form is separated in 2 separate screens. I save after the first screen and after the second.

The first save is fine.
However in the second one, it seems like it's trying to insert instead of updating. Indeed, I have a field set to UNIQUE and it's throwing the error. If I try to remove this value, which is set to NOT NULL in the db, I am getting the required error.

However, when is use isNew() the return is false. So how can I update after partially binding i.e. the array passed in the bind() method doesn't cover all the object properties.

Thanks

 Topic: Overriding sfGuardUser and sfGuardUserPeer fails when accessing from CLI
icon5.gif  Overriding sfGuardUser and sfGuardUserPeer fails when accessing from CLI [message #59818] Sat, 30 August 2008 20:28
camason  is currently offline camason
Messages: 18
Registered: January 2008
Location: Plymouth, UK
Junior Member
Hello,

I encountered a strange issue last week when trying to deploy a project.

I have a task that simply uses getPresentationFor() to run a couple of actions in an application. As part of my application, I have overridden sfGuardUser and sfGuardUserPeer.

When developing my application, the override has been working fine. I can perform my tasks normally, and all overrides are considered.

However, when I deployed my project to live server, I noticed that my tasks were failing. I tried accessing the actions from a web-browser, and they executed without issue.

Yet when I run a task from the CLI, I would always receive the error:

call to undefined method sfGuardUserPeer::myMethod()


This would only happen via the task, and only within the prod environment. Yet, if I renamed the sfGuardUser and sfGuardUserPeer php files within the plugin, symfony used my classes from /lib, and the tasks runs fine.

I am going to create a test project and see if I can replicate this, as I do not want to test any further on my current project's live environment.

UPDATE:

To confirm, I have created a test project and overridden sfGuardUserPeer.php. If I call the method from an action, it works, yet it fails from the CLI.

If I rename the original sfGuardUserPeer.php to sfGuardUserPeer.php.bak, the CLI succeeds.

[Updated on: Sat, 30 August 2008 20:54]

 Topic: How to make a plugin to replace templating system ?
How to make a plugin to replace templating system ? [message #59820] Sat, 30 August 2008 23:55
Jackovson  is currently offline Jackovson
Messages: 83
Registered: March 2007
Member
Hy,

I am working on a plugin to change Symfony template system.

I am wondering how I can replace or extend the current sfPHPView ?

Thanks for your help.

What I want to do is to call a class according to the template name, to instantiate this class, to pass variables to it, and to call the mothod render() on this objects. Template becomes class that output HTML (or other things) and no flat PHP files.

I tried to include my file into /plugins/sfClassTemplateViewPlugin/lib/view/ , but I dont succed to get it call by anyway.

Thanls a lot for you help Razz

Jackovson

[Updated on: Sat, 30 August 2008 23:55]

 Topic: The attribute 'isI18N' is not allowed.
The attribute 'isI18N' is not allowed. [message #59823] Sun, 31 August 2008 01:49
zetta  is currently offline zetta
Messages: 1
Registered: July 2008
Junior Member
I have a problem with propel:build u_u (propel:build-model / propel:build-all)

I want to use i18n tables
i have this in my schema.yml
  category:
    _attributes:      { phpName: Category }
    id:               ~
    created_at:       ~
    updated_at:       ~

  category_i18n:
    _attributes:      { phpName: CategoryI18n }
    name:             { type: varchar(50), required: true }


  subcategory:
    _attributes:      { phpName: Subcategory }
    id:               ~
    category_id:      { type: integer, required: true, foreignTable: category, foreignReference: id, onDelete: null }

  subcategory_i18n:
    _attributes:      { phpName: SubcategoryI18n }
    name:             { type: varchar(70), required: true}


and when i run
./symfony propel:build-model
This error appears =( Sad

[PHP Error] DOMDocument::schemaValidate(): Element 'table', attribute 'isI18N': The attribute 'isI18N' is not allowed. [line 459 of /home/zetta/sites/dev/plugins/sfPropelPlugin/lib/vendor/propel-generator/classes/propel/phing/AbstractPropelDataModelTask.php]
[PHP Error] DOMDocument::schemaValidate(): Element 'table', attribute 'i18nTable': The attribute 'i18nTable' is not allowed. [line 459 of /home/zetta/sites/dev/plugins/sfPropelPlugin/lib/vendor/propel-generator/classes/propel/phing/AbstractPropelDataModelTask.php]
[PHP Error] DOMDocument::schemaValidate(): Element 'column', attribute 'isCulture': The attribute 'isCulture' is not allowed. [line 459 of /home/zetta/sites/dev/plugins/sfPropelPlugin/lib/vendor/propel-generator/classes/propel/phing/AbstractPropelDataModelTask.php]
Execution of target "om-template" failed for the following reason: /home/zetta/sites/dev/plugins/sfPropelPlugin/lib/vendor/propel-generator/build-propel.xml:479:1: XML schema file (/home/zetta/sites/dev/config/generated-schema-transformed.xml) does not validate.  See warnings above for reasons validation failed (make sure error_reporting is set to show E_WARNING if you don't see any).
[phingcall] /home/zetta/sites/dev/plugins/sfPropelPlugin/lib/vendor/propel-generator/build-propel.xml:479:1: XML schema file (/home/zetta/sites/dev/config/generated-schema-transformed.xml) does not validate.  See warnings above for reasons validation failed (make sure error_reporting is set to show E_WARNING if you don't see any).
Execution of target "om" failed for the following reason: /home/zetta/sites/dev/plugins/sfPropelPlugin/lib/vendor/propel-generator/build-propel.xml:465:22: Execution of the target buildfile failed. Aborting.
    [phing] /home/zetta/sites/dev/plugins/sfPropelPlugin/lib/vendor/propel-generator/build-propel.xml:465:22: Execution of the target buildfile failed. Aborting.



im in symfony 1.1.1 also i install the Propel 1.3 plugin but the problem persists
 Topic: Stick error message of sfCallbackValidator to a form field
icon5.gif  Stick error message of sfCallbackValidator to a form field [message #59855] Sun, 31 August 2008 19:06
nicki78  is currently offline nicki78
Messages: 54
Registered: June 2006
Member
Hi together,

in chapter 2 of the Form Book is mentioned, that there is the opportunity to stick the error message of a compare validator (set as post validator) to a form field. As result the error message appears not in top of the whole form but at the top of a specific form field.
I have problems to transfer this example to my needs. My question is: How can i stick the error message of sfCallbackValidator to a specified form field? (I don't want it to be displayed at the top of the form ...)
 Topic: Swift mail get rid of reply-to address
Swift mail get rid of reply-to address [message #59858] Sun, 31 August 2008 21:11
Notorious  is currently offline Notorious
Messages: 147
Registered: March 2007
Senior Member
I am busy with the implementation of Swift email in symfony 1.1 but I can't seem to get rid of the Reply-To address. The email I'm sending shouldn't get replies. Should I set this address to something like no-reply@domain.com?

If I can get rid of that field, it would be great!
 Topic: newbee : configure multiple db on the same server ?
newbee : configure multiple db on the same server ? [message #59902] Mon, 01 September 2008 14:27
mediastart  is currently offline mediastart
Messages: 1
Registered: September 2008
Junior Member
Hi all,

I'm trying to use symfony in order to know if I can use it to move my project on it.
I need to use some database hosted on the same server. I want to generate the xxx_shema.yml files for each database automatically.

But I don't know how to configure the propel.ini correctly to do it ?!

After that I want to generate the classes for CRUD actions unsing the build-forms command line. Again, I don't know the good way to do this.

I read somes previous post but I'm a little lost. I'm sure that could help some new user if someone can explain how to do theses things with files example :

- generate xxx_schema.yml for each database
- generate CRUD classes based on the xxx_schema.yml previously generated

Thanks a lot
 Topic: Does anybody use sfInstantCMSPlugin with 1.1 ?
Does anybody use sfInstantCMSPlugin with 1.1 ? [message #59919] Mon, 01 September 2008 16:51
klausherzberg  is currently offline klausherzberg
Messages: 11
Registered: July 2008
Junior Member

Hi,
I try to use/install sfInstantCMSPlugin for Symfony 1.1

There are 2 thing confusing me:

1.
http://www.symfony-project.org/plugins/sfInstantCMSPlugin/0_ 0_2?tab=plugin_readme

says:

"Note that the newest version of this plugin requires sfAssetsLibraryPlugin, not sfMediaLibrary."

But in source of example I see:

<?php use_helper('PageEdit'); ?>
<?php use_helper('sfMediaLibrary') ?>

???

2.
sfAssetsLibraryPlugin is only available for Symfony 1.0
So how can I use sfInstantCMSPlugin with Symfony 1.1

Thank you for any information.

Klaus.
 Topic: criteria in generator.yml
criteria in generator.yml [message #59958] Tue, 02 September 2008 12:13
jezjones  is currently offline jezjones
Messages: 38
Registered: July 2008
Member
Hopefully this is a simple question as i am a little confused about how to use a peer method in my generator.yml

I am using sfGuard for user management and i want to show the user's group in the list.

In my generator.yml for my user module i have the following;-
[apps/backend/modules/sfGuardUser]

  list:
      title:   User list
      peer_method:     doSelectJoinsfGuardUser


I got this peer name from the base class file and i know it is correct as the error i get is that there is a missing parameter for this method.

This parameter is the user id, but i dont know how to pass this to the peer method in the generator.yml


The documentation in chapter 14 gave the info to put the above in my generator, then referred to chapter 18 for more info, but this talks about use of peer method but makes no mention of the generator.

I hope this is a simple question of where i define the criteria and how i use it in the generator.

Thanks.
 Topic: sfAjaxUploaderPlugin does not support in symfony 1.1
sfAjaxUploaderPlugin does not support in symfony 1.1 [message #59960] Tue, 02 September 2008 13:18
vishnu  is currently offline vishnu
Messages: 30
Registered: May 2008
Location: bangalore
Member
hello,
How to upload image files(PNG or JPG) using symfony 1.1
sfAjaxUploaderPlugin does not support  symfony 1.1.

when i trying to install the plugin it displays the error like this:
You try to install a symfony 1.0 plugin.
  Please read the help message of this task to know how to install a plugin for the current version of symfony.

please suggest the any Plugin support for symfony 1.1


vishnu
 Topic: Admin generator invisible filter based on external permissions table
Admin generator invisible filter based on external permissions table [message #60229] Fri, 05 September 2008 06:27
tayhimself  is currently offline tayhimself
Messages: 65
Registered: April 2007
Member

This is essentially asking if we can have an invisible filter for the data that the admin generator works with.

I have several users of a system that can browse all the tabular data. They have permissions to view/edit data and these permissions are assigned in a permissions table linked to the sfGuard plugin.

If I create an admin generated backend website for these users, how do I restrict them to only viewing their records. I know this can be accomplished through SQL views, but I would end up with one view per user and there are 20 users. The number of records is in the millions.

Are SQL views the only way to do this? And if so, how does one use multiple SQL views with the same symfony project.

 Topic: symfony 1.1 upload plugin
symfony 1.1 upload plugin [message #60274] Fri, 05 September 2008 15:18
vishnu  is currently offline vishnu
Messages: 30
Registered: May 2008
Location: bangalore
Member
hello,
can any one tell me the file upload via Ajax plugin for symfony 1.1


vishnu
 Topic: admin generator with 3 (three) image fields
admin generator with 3 (three) image fields [message #60290] Fri, 05 September 2008 17:27
hash8R  is currently offline hash8R
Messages: 3
Registered: September 2008
Junior Member
Hello forum,

this is my first post, as I can't describe my problem in the irc channel (those folks there are great, bless!)

So.. i started a project following this tutorial http://www.sitepoint.com/print/symfony-beginners-tutorial/

I've made my schema, I did my propel-init-admin.. everything was working lovely. I had two fields in my generator.yml which were type: admin_input_file_tag and I was ABLE to upload a picture and create a thumbnail as written in the tutorial. As I said - everything run perfectly. After that, I had new idea and I had to insert one field more, which is an file tag and I will need thumbnail for it too.

Then I just copied the steps I followed for the first fields - and I got this error
[Exception]
Could not load image /var/www/htdocs/bord/web/uploads/fef9ebe8612c725831c4a46b042 ea554.jpg

When I look in the uploads dir - there was no jpg with this name. It is strange, because if I leave the new file field empty - the admin generator uploads and resize the other file fields perfectly. The code is same and there aren't any errors in it.

What can be causing admin generator not to upload this file? I'm stucked and I'm about to cry like a girlie.. this error is second day in my nightmares.. please help
Smile thanks

P.S. Its not a permission problem - I've just chmod 777 -R project_dir/ and the problem is still there.

Here is my schema.yml
kuhnq:
id:
ime: varchar(255)
trid: varchar(255)
material: varchar(255)
here is the code from the snippet i use:
//this is lib/model/Kuhnq.php

class Kuhnq extends BaseKuhnq
{
public function setTrid($value)
{
parent::setTrid($value);
$this->generateThumbnail($value);
}
public function generateThumbnail($value)
{
parent::setTrid($value);
$uploadDir = sfConfig::get('sf_upload_dir');
$thumbnail = new sfThumbnail(70, 70);
$thumbnail->loadFile($uploadDir.'/'.$this->getTrid());
$thumbnail->save($uploadDir.'/thumbnail/'.$this->getTrid(), 'image/png');
}

public function setMaterial($value)
{
parent::setMaterial($value);
$this->generateMaterial($value);
}
public function generateMaterial($value)
{
parent::setMaterial($value);
$uploadDir = sfConfig::get('sf_upload_dir');
$thumbnail = new sfThumbnail(70, 70);
$thumbnail->loadFile($uploadDir.'/'.$this->getMaterial());
$thumbnail->save($uploadDir.'/thumbnail/'.$this->getMaterial(), 'image/png');
}
}
 Topic: Filter - > Partial Variable Advice
Filter - > Partial Variable Advice [message #60380] Mon, 08 September 2008 07:48
passbe
Messages: 20
Registered: September 2008
Junior Member
I'm hoping someone here could give me some advice on how to approach this problem, i have been trying to solve for the last 3 days.

The story so far.... I have an application that deals in portals, these portals can have many articles and i have users per portal. I have utilized propels models / forms / CRUD generator to generate most of the generic actions. Now for every module and action i need two objects, the specific portal and the specific user logged in. So i created a filter:

    // execute this filter only once
    if ($this->isFirstCall() && $this->getContext()->getUser()->isAuthenticated())
    {
      // do things
      $this->getContext()->portal = PortalPeer::retrieveByPK($this->getContext()->getUser()->getAttribute('portalid'));
      $this->getContext()->user = UserPeer::retrieveByPK($this->getContext()->getUser()->getAttribute('usernameid'));
    }
 
    // execute next filter
    $filterChain->execute();


This filter works brilliantly as you can see im storing both objects under $this->getContext()->. Now in my actions files i use the same $this call statement to access the objects. However i need these same objects to appear in the template files (and possibly the partial files). The getContext function does not exist in these files, I know this is a scope problem but am struggling to find what scope i am programming in at times.

So if anyone can offer some advice on how i may re-structure this system to offer better OOP, or another option?

Thank you.
ps: i have been using Symfony only for 2 weeks but I'm already in love.
 Topic: IE 6 and 7 Strange problem with my forms
IE 6 and 7 Strange problem with my forms [message #60435] Mon, 08 September 2008 15:46
glauberportella  is currently offline glauberportella
Messages: 8
Registered: July 2007
Location: Belo Horizonte, Minas Ger...
Junior Member
Hello,

I get a strange error in my Symfony 1.1 app, let me introduce the whole enironment.

Design:

historicoSuccess.php: has a div which is populated via AJAX with a partial _visualizarDados.php

_visualizarDados.php: shows a form (that i will call form1 in this post), with data from DB and has a button that when clicked will call a remote_function to show some fields to add some data in DB, this fields are in a form (i will named it as form2 for the post) that initially is style="display: none", so when the button is clicked the form turn to style="display: block". All my forms are using the new form system from Symfony 1.1.

The problem is when i show the form2 i just see one select field that is configured in form class. The others fields aren't visible.

I noticed this problem only in IE 6 and 7. To be more precise when a call form2 i use a javascript function that clear all fields to default values defined by me and then show the form, in Firefox no javascript error is reported but in IE i get an error saying that: 'null' is null or isn't an object.

Thanks for everyone who will illuminate my way in this problem.

Here are part of my codes:

historicoSuccess.php
<?php
use_helper('Javascript', 'Form')
?>
<div id="tituloTool">
  <?php include_partial('tituloHistorico') ?>
</div>
<div class="padding">

<p>Selecione o funcionário para visualizar/editar o histórico.</p>
<?php echo form_remote_tag(array(
    'update'   => 'dados',
    'url'      => 'cadastro/visualizar',
    'loading'  => "Element.show('ajaxLoader')",
    'complete' => "Element.hide('ajaxLoader')"
  ),
  array('name'=>'frmHistorico')
) ?>
  <table>
    <tr>
      <th><?php echo $form['funcionario']->renderLabel() ?></th>
      <td <?php if ($form['funcionario']->hasError()): ?>class="marca_erro"<?php endif; ?>>
        <?php echo $form['funcionario']->renderError() ?>
        <?php echo $form['funcionario']->render(array('style'=>'width: 660px')) ?>
      </td>
      <td><?php echo submit_image_tag('btnIr.png', array('alt'=>'Selecionar','title'=>'Selecionar')) ?></td>
    </tr>
  </table>
</form>

<div id="ajaxLoader" style="display:none"><?php echo image_tag('ajax-loader-bar.gif', array('alt'=>'Carregando...'))?></div>

<div id="dados">
</div>

</div>


_visualizarDados.php
<?php
use_helper('Form', 'Javascript', 'Date')
?>
<div class="padding" style="border-top: #999999 solid 2px; margin: 4px">

<?php if (isset($erros) && count($erros) > 0): ?>
<div id="erroMsg">
  <ul>
    <?php foreach($erros as $erro): ?>
    <li><?php echo $erro ?></li>
    <?php endforeach; ?>
  </ul>
</div>
<?php endif; ?>

<?php echo form_remote_tag(array(
    'update'   => 'dados',
    'url'      => 'cadastro/atualizar',
    'loading'  => "Element.show('ajaxLoader')",
    'complete' => "Element.hide('ajaxLoader')"
  ),
  array('class'=>'withBorder')
) ?>
  <h2>Dados do Funcionário</h2>
  <?php echo $formFuncionario['pkfuncionario']->render() ?>
  <table width="100%">
    <tr class="row1">
      <th class="rightAlign"><?php echo $formFuncionario['nome']->renderLabel() ?></th>
      <td colspan="5" <?php if ($formFuncionario['nome']->hasError()): ?>class="marca_erro"<?php endif; ?>>
        <?php echo $formFuncionario['nome']->renderError() ?>
        <?php echo $formFuncionario['nome']->render(array('class'=>'textField', 'size'=>110)) ?>
      </td>
    </tr>
    <tr class="row0">
      <th class="rightAlign"><?php echo $formFuncionario['dtnasc']->renderLabel() ?></th>
      <td>
        <?php echo $formFuncionario['dtnasc']->renderError() ?>
        <?php echo $formFuncionario['dtnasc'] ?>
      </td>
      <th class="rightAlign"><?php echo $formFuncionario['sexo']->renderLabel() ?></th>
      <td colspan="3">
        <?php echo $formFuncionario['sexo']->renderError() ?>
        <?php echo $formFuncionario['sexo'] ?>
      </td>
    </tr>
    <tr class="row1">
      <th class="rightAlign"><?php echo $formFuncionario['rg']->renderLabel() ?></th>
      <td <?php if ($formFuncionario['rg']->hasError()): ?>class="marca_erro"<?php endif; ?>>
        <?php echo $formFuncionario['rg']->renderError() ?>
        <?php echo $formFuncionario['rg']->render(array('class'=>'textField')) ?>
      </td>
      <th class="rightAlign"><?php echo $formFuncionario['cpf']->renderLabel() ?></th>
      <td <?php if ($formFuncionario['cpf']->hasError()): ?>class="marca_erro"<?php endif; ?>>
        <?php echo $formFuncionario['cpf']->renderError() ?>
        <?php echo $formFuncionario['cpf']->render(array('class'=>'textField')) ?>
      </td>
      <th class="rightAlign"><?php echo $formFuncionario['ativo']->renderLabel() ?></th>
      <td <?php if ($formFuncionario['ativo']->hasError()): ?>class="marca_erro"<?php endif; ?>>
        <?php echo $formFuncionario['ativo']->renderError() ?>
        <?php echo $formFuncionario['ativo'] ?>
      </td>
    </tr>
  </table>

  <p class="formActions">
    <?php echo submit_image_tag('btnSalvar.png', array('alt'=>'Salvar', 'title'=>'Salvar')) ?>
    <?php echo link_to(image_tag('btnCancelar.png', array('alt'=>'Cancelar', 'size'=>'98x22')), 'cadastro/historico', array('title'=>'Cancelar')) ?>
  </p>
  <h2>Histórico</h2>
  <table class="dataGrid" width="99%">
    <thead class="header">
      <tr>
        <th>Seção/Unidade</th>
        <th>Setor</th>
        <th>Cargo</th>
        <th>Data Início</th>
        <th>Data Fim</th>
        <th></th>
      </tr>
    </thead>
    <tbody>
      <?php if ($historico->RecordCount() > 0): ?>
      <?php $i = 1; $historico->MoveFirst(); while ($cargo = $historico->FetchNextObject()): $class = ($i % 2) ? 'row1' : 'row0'; ?>
      <tr class="<?php echo $class ?>">
        <td><?php echo $cargo->SEC_NOME ?></td>
        <td><?php echo $cargo->SET_DESCRICAO ?></td>
        <td><?php echo $cargo->CAR_DESCRICAO ?></td>
        <td><?php echo format_date($cargo->HIFU_DT_INICIO) ?></td>
        <td><?php echo format_date($cargo->HIFU_DT_FIM) ?></td>
        <td>
        <?php
        echo ($i + 1 > $historico->RecordCount()) ? link_to_function(
          image_tag('iconeEditar', array('size'=>'15x16')),
          'selectHistorico(' . $cargo->FK_SECAO . ',' . $cargo->FK_SETOR . ',' . $cargo->FK_CARGO . ',"' . $cargo->HIFU_DT_INICIO . '", "' . $cargo->HIFU_DT_FIM . '")',
          array('title'=>'Editar', 'alt'=>'Editar')
        ) : '&nbsp;' ?>
        </td>
      </tr>
      <?php $i++; endwhile; ?>
      <?php endif; ?>
    </tbody>
  </table>
  <p class="formActions" id="adicionarCargo">
    <?php echo link_to_function(image_tag('btnAdicionar', array('alt'=>'Adicionar', 'size'=>'90x22')), "adicionarCargo()", array('title'=>'Adicionar')) ?>
  </p>
</form>

<!-- I GET THE PROBLEM FROM HERE -->

<?php echo form_remote_tag(array(
    'update'   => 'dados',
    'url'      => 'cadastro/salvarHistorico',
    'loading'  => "Element.show('ajaxLoader')",
    'complete' => "Element.hide('ajaxLoader')"
  ),
  array('class'=>'withBorder', 'id'=>'cargoForm',  'style'=>'display: none')
) ?>
  <table width="100%" style="display:block">
    <tr class="row0">
      <th class="rightAlign"><?php echo $formHistorico['secao']->renderLabel() ?></th>
      <td <?php if ($formHistorico['secao']->hasError()): ?>class="marca_erro"<?php endif; ?>>
        <?php echo $formHistorico['secao']->renderError() ?>
        <?php echo $formHistorico['secao']->render(array('style'=>'display: block;width: 200px')) ?>
      </td>
      <th class="rightAlign"><?php echo $formHistorico['setor']->renderLabel() ?></th>
      <td <?php if ($formHistorico['setor']->hasError()): ?>class="marca_erro"<?php endif; ?>>
        <?php echo $formHistorico['setor']->renderError() ?>
        <?php echo $formHistorico['setor']->render(array('style'=>'display: block;width: 200px')) ?>
      </td>
      <th class="rightAlign"><?php echo $formHistorico['cargo']->renderLabel() ?></th>
      <td <?php if ($formHistorico['cargo']->hasError()): ?>class="marca_erro"<?php endif; ?>>
        <?php echo $formHistorico['cargo']->renderError() ?>
        <?php echo $formHistorico['cargo']->render(array('style'=>'width: 200px')) ?>
      </td>
        
    </tr>
    <tr class="row1">
      <th class="rightAlign"><?php echo $formHistorico['dtinicio']->renderLabel() ?></th>
      <td <?php if ($formHistorico['dtinicio']->hasError()): ?>class="marca_erro"<?php endif; ?>>
        <?php echo $formHistorico['dtinicio']->renderError() ?>
        <?php echo $formHistorico['dtinicio'] ?>
      </td>
      <th class="rightAlign"><?php echo $formHistorico['dtfim']->renderLabel() ?></th>
      <td colspan="3" <?php if ($formHistorico['dtfim']->hasError()): ?>class="marca_erro"<?php endif; ?>>
        <?php echo $formHistorico['dtfim']->renderError() ?>
        <?php echo $formHistorico['dtfim'] ?>
      </td>
    </tr>
  </table>
  
  <p class="formActions">
    <?php echo submit_image_tag('btnSalvar.png', array('alt'=>'Salvar', 'title'=>'Salvar')) ?>
    <?php echo link_to_function(image_tag('btnCancelar.png', array('alt'=>'Cancelar', 'size'=>'98x22')), "Element.hide('cargoForm'); Element.show('adicionarCargo')", array('title'=>'Cancelar')) ?>
  </p>
</form>

</div>


My javascript file:
function selectHistorico(pksecao, pksetor, pkcargo, dtinicio, dtfim)
{
  $('historico_acao').value = 'update';
  $('historico_secao').value = pksecao;
  $('historico_setor').value = pksetor;
  $('historico_cargo').value = pkcargo;
  
  // processa data ISO
  var aDtInicio = dtinicio.toString().split(" "); // array: [0] => YYYY-MM-DD, [1] => hh:mm:ss
  var aDtFim = dtfim.toString().split(" ");       // array: [0] => YYYY-MM-DD, [1] => hh:mm:ss
  aDtInicio = aDtInicio[0].split("-");            // array: [0] => YYYY, [1] => MM, [2] => DD
  aDtFim = aDtFim[0].split("-");                  // array: [0] => YYYY, [1] => MM, [2] => DD
  
  $('historico_dtinicio_day').value = Number(aDtInicio[2]);
  $('historico_dtinicio_month').value = Number(aDtInicio[1]);
  $('historico_dtinicio_year').value = Number(aDtInicio[0]);
  $('historico_dtfim_day').value = Number(aDtFim[2]);
  $('historico_dtfim_month').value = Number(aDtFim[1]);
  $('historico_dtfim_year').value = Number(aDtFim[0]);
  
  Element.hide('adicionarCargo');
  Element.show('cargoForm');
}

function adicionarCargo()
{
  $('historico_acao').value = 'insert';

  $('historico_secao').value = null;
  $('historico_setor').value = null;
  $('historico_cargo').value = null;
  
  $('historico_dtinicio_day').value = '';
  $('historico_dtinicio_month').value = '';
  $('historico_dtinicio_year').value = '';
  $('historico_dtfim_day').value = '';
  $('historico_dtfim_month').value = '';
  $('historico_dtfim_year').value = '';
  
  Element.hide('adicionarCargo'); 
  Element.show('cargoForm');
}


Glauber Portella
MacWeb Solutions
www.macweb.com.br
 Topic: Help admin generator
Help admin generator [message #60458] Mon, 08 September 2008 18:55
Giansimon  is currently offline Giansimon
Messages: 2
Registered: September 2008
Junior Member
Hi to everybody, I'm Giansimon and this is my first post. I've got some troubles with the admin generator. In my database I've got two tables: the first one is the header table and the second one contains the related details. They are in relationship one to many. I use propel. I generated two admin modules to manage the tables. In the header table I added a custom action to open the related details for each row. I need a filter to show only the related details. I tried in several ways without results and the only solution I found is to add a preExecute action in the action detail modules, as follows:

public function preExecute()
{
$this->getUser()->setAttribute('[PARAM]', $this->getRequestParameter('[PARAM]'), 'sf_admin/[CLASS NAME]/filters');
}

I would like to know it there is a better solution.

Then I opened the list for the details table and then I wanted to edit one element. I clicked the edit button, I made my changes, I saved them then I wanted to return to the detailed list filtered, but I got the list with all the elements. Is there a way to get this result?

Thanks for help
Giansimon
 Topic: Rename fields in admin generator
Rename fields in admin generator [message #60639] Wed, 10 September 2008 12:47
rocho08  is currently offline rocho08
Messages: 1
Registered: September 2008
Junior Member
Hi, i have a model working properly using the admin interface,
but when i try to change de field names, it does not work:

My generator.yml looks like this:

generator:
class: sfPropelAdminGenerator
param:
model_class: Ges010paises
theme: default

fields:
ges010Nombre: { name: Nombre }

list:
#peer_method: doSelectJoinAll
title: Listado de paises
display: [=ges010Id, ges010Nombre,Ges020idiomas, Ges030monedas]
params: {}

In all the views (list and edit) the field names are
the table field names, not the field names configured
in generator.yml.

Any idea ??
 Topic: Update sfWidgetFormSelect
Update sfWidgetFormSelect [message #60772] Thu, 11 September 2008 15:21
Shawnstein  is currently offline Shawnstein
Messages: 61
Registered: April 2008
Member
Hello,

i have a Problem with the Update of a sfWidgetFormSelect Field.

I want to Update the Options from my FormSelect Field width an ajax Request:

the FormClass.php
class TestForm extends sfForm
{
... new sfWidgetFormSelect(array('choices' => $this->getDefault("items_nebenkategorie"))


at the Moment my Ajax Request Replace this Field with an new One where the Options (saved in $options) are changed:

$this->form = new TestForm(array("items_nebenkategorie"=> $options));


but this is not so well. Is there a way to change only the options without generate the field new? Maybe with the Function

$this->widgetSchema->setDefault('items_nebenkategorie', $options);


Any Idea?
 Topic: Disable layout for user defined request format?
Disable layout for user defined request format? [message #60802] Thu, 11 September 2008 20:06
asutula  is currently offline asutula
Messages: 11
Registered: July 2008
Junior Member
I'm using the instructions at http://www.symfony-project.org/blog/2008/06/09/how-to-create -an-optimized-version-of-your-website-for-the-iphone-in-symf ony-1-1 by inspecting the User-Agent header and using setRequestFormat to my own custom format, as in the iPhone example on that page.

I'd like to disable the layout for my custom format just as it happens when you make a request with a standard non-html format (listed at the top of that page) in the Accept header.

After defining my own custom format, as in the iPhone example, symfony is still attempting to render a layout.

What is the best way to disable that?

Thank you,
Aaron
 Topic: Propel 1.3 and sfPropelAuditPlugin
Propel 1.3 and sfPropelAuditPlugin [message #60925] Sat, 13 September 2008 14:32
Alphax  is currently offline Alphax
Messages: 42
Registered: February 2008
Member
Someone has already plugin sfPropelAuditPlugin get work with Propel 1.3?

If you can help me, thank you
 Topic: Custom form validator
Custom form validator [message #60942] Sat, 13 September 2008 22:58
Jeroen Hauser  is currently offline Jeroen Hauser
Messages: 34
Registered: June 2008
Location: The Netherlands
Member
I want to create an own form validator, but I cannot find a tutorial or any other documentation for that purpose.

Am I missing something? I hope so! A tutorial or documentation would be very helpful.

Or can someone help provide some guidance in creating an own form validator?
 Topic: sfValidatorInteger bug
sfValidatorInteger bug [message #60943] Sat, 13 September 2008 23:03
ilanco  is currently offline ilanco
Messages: 1
Registered: September 2008
Junior Member
my bad ...

ilan

[Updated on: Sat, 13 September 2008 23:27]

 Topic: Form Validation using sfValidator
Form Validation using sfValidator [message #60944] Sat, 13 September 2008 23:16
johnfelix  is currently offline johnfelix
Messages: 8
Registered: August 2008
Junior Member
Hi,

http://www.symfony-project.org/book/forms/1_1/en/02-Form-Val idation

Iam trying to do the same thing that is done in the above url for validation.But Iam gettin error in bind() function.
My error message is
Fatal error: Call to a member function bind() on a non-object

Iam not able to find a bind or isValid method in the symfony api.can someone please help me

thanks
 Topic: propel-build-all: Can I turn it off?
propel-build-all: Can I turn it off? [message #60995] Mon, 15 September 2008 10:13
Cezar708  is currently offline Cezar708
Messages: 20
Registered: August 2007
Location: Poland
Junior Member
Hi all!

I have installed symfony 1.1 on my production version.
To avoid mistakes and remove all data from (production) database I want to neutralize these commands:
$ symfony propel-insert-sql

and
$ symfony propel-build-all.

... and other similar

Is it possible? Perhaps exists some option in configs/config.php?

Best regards
Cezar708
 Topic: Embedded forms cause an extra field error and database is not updated
Embedded forms cause an extra field error and database is not updated [message #61121] Tue, 16 September 2008 16:28
polix  is currently offline polix
Messages: 35
Registered: September 2008
Member
Hello,

I tried for days now to use embedded forms but I found no solution.

Here is my code:

  public function executeCreate()
  {
    $this->mainForm = new FooForm();
    $subForm = new BarForm();
    $this->mainForm->embedForm('test', $subform);
    $this->setTemplate('edit');
  }


When I submit this form:

<div>

	<form action="<?php echo url_for('myModule/update') ?>" method="post">
		<table>
			<?php echo $mainForm ?>
			<tr>
				<td colspan="2">
					<input type="submit" value="send" />
				</td>
			</tr>
		</table>
	</form>
	
</div>


... I get this error:
Quote:

Extra field test.


I'm aiming at creating both a Foo and a Bar object with only onr form. I'm not trying to retrieve existing data in the tables. The tables corresponding to Foo and Bar are curently empty.

The Foo form with the Bar one embedded is correctly rendered by Symfony but I found no way to submit it in a right way that save the two objects in the database.

My model was successfully generated by Symfony and so were the forms I dealing with.

Even if I use these lines in the foo form:

    $this->validatorSchema->setOption('allow_extra_fields', true);
    $this->validatorSchema->setOption('filter_extra_fields', false);


Even if I no longer get the error message, the records are not inserted into the tables

Please, have you a simple working example for correctly handeling an embedded form?


Regards

[Updated on: Tue, 16 September 2008 16:36]

 Topic: Validation Problem
Validation Problem [message #61185] Wed, 17 September 2008 15:58
manokha  is currently offline manokha
Messages: 3
Registered: August 2008
Junior Member
Hello,
I have a strange problem :
I built a project in localhost. Made an schema.yml file to build a database, and then generate forms.
I made a CRUD too for each table.
When I use my project in localhost, and I try to validate a form with empty fields which are required, it works, properly displaying the renderError of the field.

I made a copy of the project on a distant host. (Same symfony version, same PHP... Linux on the host, and Windows at localhost but I don't think it matter).

On the distant project, everything works like a charm. Unless this validation feature... Whenever a required field is left empty. The host render a blank page. (The use of frontend_dev.php reveals that there is un uncaught exception like this one :
Fatal error: Uncaught Required. thrown in [...]/validator/sfValidatorBase.class.php on line 278)
Of course we get the same behaviour from mail validators, and any validator.)

PS: sorry for my english Smile
 Topic: sfLoggerWrapper in 1.1
sfLoggerWrapper in 1.1 [message #61232] Thu, 18 September 2008 10:33
nykacho  is currently offline nykacho
Messages: 87
Registered: July 2007
Member
Anybody knows what this class is about ?

I figured out that it stands as a interface wrapper, but it seems like this class is used nowhere in the core.
 Topic: Form not valid but no visible error
Form not valid but no visible error [message #61279] Thu, 18 September 2008 19:37
omoratin  is currently offline omoratin
Messages: 144
Registered: December 2005
Senior Member
I'm having this constant issue where I create a sfForm by extends a form model class so I can modify validation rules and other things.

The form basically is not valid after binding it but there are no error messages.

I thought getGlobalErrors() would show a non empty array but it is always empty

Is there a way I can see all of the errors at once?

Thanks
 Topic: Lucene & Symfony
icon5.gif  Lucene & Symfony [message #61338] Fri, 19 September 2008 15:09
frins  is currently offline frins
Messages: 1
Registered: September 2008
Junior Member
Hi,

I'm creating a Search Engine with Lucene, but I'm not an expert with Java or JSP, and I ask you about if I can search in a Lucene index with PHP, with this Framework, like Zend

Thanks
 Topic: Load JS per Ajax
Load JS per Ajax [message #61499] Mon, 22 September 2008 12:15
Clark  is currently offline Clark
Messages: 6
Registered: April 2008
Location: Munich
Junior Member

Hello,
I have switched my App from 1.0 to 1.1
I have updated to newest Prototype
I know, that all the form-helpers such as form_remote_tag are not longer supported because of the new concept.
I don't want to switch to compatibility mode.
but now, all my ajax responses did not execute my JavaScript functions.
I tried to load an external JS-File by the response-object
I tried to load an external JS-File by view.yml
I tried to load JS Code by included Script in the response.
The only way, I can use my JavaScript is to load it at the first start of the page, but i don't want to load all the small function, that I will use (perhaps) in the lifetime of my app.

evalScripts is everywhere on true.

Is there any way, to load and execute js functions on demand?

Thanks for help.
best regards
Chris


Verlange von niemandem mehr, als du selbst zu tun bereit bist.
 Topic: Popup Ajax method: POST
Popup Ajax method: POST [message #61568] Mon, 22 September 2008 19:02
Alphax  is currently offline Alphax
Messages: 42
Registered: February 2008
Member

Hello!

I wonder if anyone knows a plugin for popup ajax method: post or some ajax API to do that.
 Topic: New application in symfony 1.1.2
New application in symfony 1.1.2 [message #61594] Tue, 23 September 2008 08:45
ruFog  is currently offline ruFog
Messages: 13
Registered: March 2008
Location: Russia, Khabarovsk
Junior Member

Hi, friends!

When i create a new application (symfony generate:app frontend) and try to test it (http://my-symfony-project) exception are thrown: Login required.

My security.yml:
default:
  is_secure: off
Pages (169): [ «  <  2  3  4  5  6  7  8  9  10  11  12  13  14  15  16  17  >  »]

powered by FUDforum - copyright ©2001-2004 FUD Forum Bulletin Board Software