Author: sid.gbf
Date: 2010-04-14 16:22:03 +0200 (Wed, 14 Apr 2010)
New Revision: 29144
Modified:
plugins/sfjQueryDoctrineAdminPlugin/tag/0.1/lib/helper/JavascriptAdminHelper.php
Log:
Fix para permissoes
Modified:
plugins/sfjQueryDoctrineAdminPlugin/tag/0.1/lib/helper/JavascriptAdminHelper.php
===================================================================
---
plugins/sfjQueryDoctrineAdminPlugin/tag/0.1/lib/helper/JavascriptAdminHelper.php
2010-04-14 14:09:24 UTC (rev 29143)
+++
plugins/sfjQueryDoctrineAdminPlugin/tag/0.1/lib/helper/JavascriptAdminHelper.php
2010-04-14 14:22:03 UTC (rev 29144)
@@ -8,8 +8,18 @@
if($field->getWidget()->hasOption('choices') && $field->getValue()) {
$class = $field->getWidget()->getOption('model');
- if($class)
- $value = Doctrine::getTable($class)->findOneBy('id',
$field->getValue())->__toString();
+ if($class) {
+ if(is_array($field->getValue())) {
+ $values =
Doctrine::getTable($class)->createQuery($class)->whereIn($class.'.id',
$field->getValue())->execute()->getData();
+ foreach($values as $k => $v) {
+ $values[$k] = $v->__toString();
+ }
+
+ $value = implode(', ', $values);
+ } else {
+ $value = Doctrine::getTable($class)->findOneBy('id',
$field->getValue())->__toString();
+ }
+ }
} else if($field->getWidget()->getOption('type') == 'file') {
$value = $field->renderHelp();
} else if($field->getWidget()->getOption('type') == 'checkbox') {
--
You received this message because you are subscribed to the Google Groups
"symfony SVN" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/symfony-svn?hl=en.