Development

#2092: actions.class.php

You must first sign up to be able to contribute.

Ticket #2092: actions.class.php

File actions.class.php, 21.4 kB (added by Leon.van.der.Ree, 1 year ago)

bug-fix, to properly support default sortorder from generator.yml (for only one column (for now))

Line 
1 [?php
2
3 /**
4  * <?php echo $this->getGeneratedModuleName() ?> actions.
5  *
6  * @package    ##PROJECT_NAME##
7  * @subpackage <?php echo $this->getGeneratedModuleName() ?>
8
9  * @author     Fabien Potencier <fabien.potencier@symfony-project.com>
10  * @version    SVN: $Id: actions.class.php 3501 2007-02-18 10:28:17Z fabien $
11  */
12 class <?php echo $this->getGeneratedModuleName() ?>Actions extends sfActions
13 {
14   public function executeIndex()
15   {
16     return $this->forward('<?php echo $this->getModuleName() ?>', 'list');
17   }
18
19   public function executeList()
20   {
21     $this->processSort();
22
23     $this->processFilters();
24
25 <?php if ($this->getParameterValue('list.filters')): ?>
26     $this->filters = $this->getUser()->getAttributeHolder()->getAll('sf_admin/<?php echo $this->getSingularName() ?>/filters');
27 <?php endif; ?>
28
29     // pager
30     $this->pager = new sfPropelPager('<?php echo $this->getClassName() ?>', <?php echo $this->getParameterValue('list.max_per_page', 20) ?>);
31     $c = new Criteria();
32 <?php if ($fields = $this->getParameterValue('list.fields')): ?>
33 <?php foreach ($fields as $key => $field): ?>
34 <?php if ($join_fields= $this->getParameterValue('list.fields.'.$key.'.join_fields')): ?>
35     $c->addJoin(<?=$join_fields[0]?>,<?=$join_fields[1]?>);
36 <?php endif; ?>
37 <?php endforeach; ?>
38 <?php endif; ?>
39     $this->addSortCriteria($c);
40     $this->addFiltersCriteria($c);
41     $this->pager->setCriteria($c);
42     $this->pager->setPage($this->getRequestParameter('page', 1));
43 <?php if ($this->getParameterValue('list.peer_method')): ?>
44     $this->pager->setPeerMethod('<?php echo $this->getParameterValue('list.peer_method') ?>');
45 <?php endif; ?>
46 <?php if ($this->getParameterValue('list.peer_count_method')): ?>
47     $this->pager->setPeerCountMethod('<?php echo $this->getParameterValue('list.peer_count_method') ?>');
48 <?php endif; ?>
49     $this->pager->init();
50   }
51
52   public function executeCreate()
53   {
54     return $this->forward('<?php echo $this->getModuleName() ?>', 'edit');
55   }
56
57   public function executeSave()
58   {
59     return $this->forward('<?php echo $this->getModuleName() ?>', 'edit');
60   }
61
62   public function executeEdit()
63   {
64     $this-><?php echo $this->getSingularName() ?> = $this->get<?php echo $this->getClassName() ?>OrCreate();
65
66     if ($this->getRequest()->getMethod() == sfRequest::POST)
67     {
68       $this->update<?php echo $this->getClassName() ?>FromRequest();
69
70       $this->save<?php echo $this->getClassName() ?>($this-><?php echo $this->getSingularName() ?>);
71
72       $this->setFlash('notice', 'Your modifications have been saved');
73
74       if ($this->getRequestParameter('save_and_add'))
75       {
76         return $this->redirect('<?php echo $this->getModuleName() ?>/create');
77       }
78       else if ($this->getRequestParameter('save_and_list'))
79       {
80         return $this->redirect('<?php echo $this->getModuleName() ?>/list');
81       }
82       else
83       {
84         return $this->redirect('<?php echo $this->getModuleName() ?>/edit?<?php echo $this->getPrimaryKeyUrlParams('this->') ?>);
85       }
86     }
87     else
88     {
89       $this->labels = $this->getLabels();
90     }
91   }
92
93   public function executeDelete()
94   {
95     $this-><?php echo $this->getSingularName() ?> = <?php echo $this->getClassName() ?>Peer::retrieveByPk(<?php echo $this->getRetrieveByPkParamsForAction(40) ?>);
96     $this->forward404Unless($this-><?php echo $this->getSingularName() ?>);
97
98     try
99     {
100       $this->delete<?php echo $this->getClassName() ?>($this-><?php echo $this->getSingularName() ?>);
101     }
102     catch (PropelException $e)
103     {
104       $this->getRequest()->setError('delete', 'Could not delete the selected <?php echo sfInflector::humanize($this->getSingularName()) ?>. Make sure it does not have any associated items.');
105       return $this->forward('<?php echo $this->getModuleName() ?>', 'list');
106     }
107
108 <?php foreach ($this->getColumnCategories('edit.display') as $category): ?>
109 <?php foreach ($this->getColumns('edit.display', $category) as $name => $column): ?>
110 <?php $input_type = $this->getParameterValue('edit.fields.'.$column->getName().'.type') ?>
111 <?php if ($input_type == 'admin_input_file_tag'): ?>
112 <?php $upload_dir = $this->replaceConstants($this->getParameterValue('edit.fields.'.$column->getName().'.upload_dir')) ?>
113       $currentFile = sfConfig::get('sf_upload_dir')."/<?php echo $upload_dir ?>/".$this-><?php echo $this->getSingularName() ?>->get<?php echo $column->getPhpName() ?>();
114       if (is_file($currentFile))
115       {
116         unlink($currentFile);
117       }
118
119 <?php endif; ?>
120 <?php endforeach; ?>
121 <?php endforeach; ?>
122     return $this->redirect('<?php echo $this->getModuleName() ?>/list');
123   }
124
125   public function handleErrorEdit()
126   {
127     $this->preExecute();
128     $this-><?php echo $this->getSingularName() ?> = $this->get<?php echo $this->getClassName() ?>OrCreate();
129     $this->update<?php echo $this->getClassName() ?>FromRequest();
130
131     $this->labels = $this->getLabels();
132
133     return sfView::SUCCESS;
134   }
135
136   protected function save<?php echo $this->getClassName() ?>($<?php echo $this->getSingularName() ?>)
137   {
138     $<?php echo $this->getSingularName() ?>->save();
139
140 <?php foreach ($this->getColumnCategories('edit.display') as $category): ?>
141 <?php foreach ($this->getColumns('edit.display', $category) as $name => $column): $type = $column->getCreoleType(); ?>
142 <?php $name = $column->getName() ?>
143 <?php if ($column->isPrimaryKey()) continue ?>
144 <?php $credentials = $this->getParameterValue('edit.fields.'.$column->getName().'.credentials') ?>
145 <?php $input_type = $this->getParameterValue('edit.fields.'.$column->getName().'.type') ?>
146 <?php
147
148 $user_params = $this->getParameterValue('edit.fields.'.$column->getName().'.params');
149 $user_params = is_array($user_params) ? $user_params : sfToolkit::stringToArray($user_params);
150 $through_class = isset($user_params['through_class']) ? $user_params['through_class'] : '';
151
152 ?>
153 <?php if ($through_class): ?>
154 <?php
155
156 $class = $this->getClassName();
157 $related_class = sfPropelManyToMany::getRelatedClass($class, $through_class);
158 $related_table = constant($related_class.'Peer::TABLE_NAME');
159 $middle_table = constant($through_class.'Peer::TABLE_NAME');
160 $this_table = constant($class.'Peer::TABLE_NAME');
161
162 $related_column = sfPropelManyToMany::getRelatedColumn($class, $through_class);
163 $column = sfPropelManyToMany::getColumn($class, $through_class);
164
165 ?>
166 <?php if ($input_type == 'admin_double_list' || $input_type == 'admin_check_list' || $input_type == 'admin_select_list'): ?>
167 <?php if ($credentials): $credentials = str_replace("\n", ' ', var_export($credentials, true)) ?>
168     if ($this->getUser()->hasCredential(<?php echo $credentials ?>))
169     {
170 <?php endif; ?>
171       // Update many-to-many for "<?php echo $name ?>"
172       $c = new Criteria();
173       $c->add(<?php echo $through_class ?>Peer::<?php echo strtoupper($column->getColumnName()) ?>, $<?php echo $this->getSingularName() ?>->getPrimaryKey());
174       <?php echo $through_class ?>Peer::doDelete($c);
175
176       $ids = $this->getRequestParameter('associated_<?php echo $name ?>');
177       if (is_array($ids))
178       {
179         foreach ($ids as $id)
180         {
181           $<?php echo ucfirst($through_class) ?> = new <?php echo $through_class ?>();
182           $<?php echo ucfirst($through_class) ?>->set<?php echo $column->getPhpName() ?>($<?php echo $this->getSingularName() ?>->getPrimaryKey());
183           $<?php echo ucfirst($through_class) ?>->set<?php echo $related_column->getPhpName() ?>($id);
184           $<?php echo ucfirst($through_class) ?>->save();
185         }
186       }
187
188 <?php if ($credentials): ?>
189     }
190 <?php endif; ?>
191 <?php endif; ?>
192 <?php endif; ?>
193 <?php endforeach; ?>
194 <?php endforeach; ?>
195   }
196
197   protected function delete<?php echo $this->getClassName() ?>($<?php echo $this->getSingularName() ?>)
198   {
199     $<?php echo $this->getSingularName() ?>->delete();
200   }
201
202   protected function update<?php echo $this->getClassName() ?>FromRequest()
203   {
204     $<?php echo $this->getSingularName() ?> = $this->getRequestParameter('<?php echo $this->getSingularName() ?>');
205
206 <?php foreach ($this->getColumnCategories('edit.display') as $category): ?>
207 <?php foreach ($this->getColumns('edit.display', $category) as $name => $column): $type = $column->getCreoleType(); ?>
208 <?php $name = $column->getName() ?>
209 <?php if ($column->isPrimaryKey()) continue ?>
210 <?php $credentials = $this->getParameterValue('edit.fields.'.$column->getName().'.credentials') ?>
211 <?php $input_type = $this->getParameterValue('edit.fields.'.$column->getName().'.type') ?>
212 <?php if ($credentials): $credentials = str_replace("\n", ' ', var_export($credentials, true)) ?>
213     if ($this->getUser()->hasCredential(<?php echo $credentials ?>))
214     {
215 <?php endif; ?>
216 <?php if ($input_type == 'admin_input_file_tag'): ?>
217 <?php $upload_dir = $this->replaceConstants($this->getParameterValue('edit.fields.'.$column->getName().'.upload_dir')) ?>
218     $currentFile = sfConfig::get('sf_upload_dir')."/<?php echo $upload_dir ?>/".$this-><?php echo $this->getSingularName() ?>->get<?php echo $column->getPhpName() ?>();
219     if (!$this->getRequest()->hasErrors() && isset($<?php echo $this->getSingularName() ?>['<?php echo $name ?>_remove']))
220     {
221       $this-><?php echo $this->getSingularName() ?>->set<?php echo $column->getPhpName() ?>('');
222       if (is_file($currentFile))
223       {
224         unlink($currentFile);
225       }
226     }
227
228     if (!$this->getRequest()->hasErrors() && $this->getRequest()->getFileSize('<?php echo $this->getSingularName() ?>[<?php echo $name ?>]'))
229     {
230 <?php elseif ($type != CreoleTypes::BOOLEAN): ?>
231     if (isset($<?php echo $this->getSingularName() ?>['<?php echo $name ?>']))
232     {
233 <?php endif; ?>
234 <?php if ($input_type == 'admin_input_file_tag'): ?>
235 <?php if ($this->getParameterValue('edit.fields.'.$column->getName().'.filename')): ?>
236       $fileName = "<?php echo str_replace('"', '\\"', $this->replaceConstants($this->getParameterValue('edit.fields.'.$column->getName().'.filename'))) ?>";
237 <?php else: ?>
238       $fileName = md5($this->getRequest()->getFileName('<?php echo $this->getSingularName() ?>[<?php echo $name ?>]').time().rand(0, 99999));
239 <?php endif; ?>
240       $ext = $this->getRequest()->getFileExtension('<?php echo $this->getSingularName() ?>[<?php echo $name ?>]');
241       if (is_file($currentFile))
242       {
243         unlink($currentFile);
244       }
245       $this->getRequest()->moveFile('<?php echo $this->getSingularName() ?>[<?php echo $name ?>]', sfConfig::get('sf_upload_dir')."/<?php echo $upload_dir ?>/".$fileName.$ext);
246       $this-><?php echo $this->getSingularName() ?>->set<?php echo $column->getPhpName() ?>($fileName.$ext);
247 <?php elseif ($type == CreoleTypes::DATE || $type == CreoleTypes::TIMESTAMP): ?>
248       if ($<?php echo $this->getSingularName() ?>['<?php echo $name ?>'])
249       {
250         try
251         {
252           $dateFormat = new sfDateFormat($this->getUser()->getCulture());
253           <?php $inputPattern  = $type == CreoleTypes::DATE ? 'd' : 'g'; ?>
254           <?php $outputPattern = $type == CreoleTypes::DATE ? 'i' : 'I'; ?>
255           if (!is_array($<?php echo $this->getSingularName() ?>['<?php echo $name ?>']))
256           {
257             $value = $dateFormat->format($<?php echo $this->getSingularName() ?>['<?php echo $name ?>'], '<?php echo $outputPattern ?>', $dateFormat->getInputPattern('<?php echo $inputPattern ?>'));
258           }
259           else
260           {
261             $value_array = $<?php echo $this->getSingularName() ?>['<?php echo $name ?>'];
262             $value = $value_array['year'].'-'.$value_array['month'].'-'.$value_array['day'].(isset($value_array['hour']) ? ' '.$value_array['hour'].':'.$value_array['minute'].(isset($value_array['second']) ? ':'.$value_array['second'] : '') : '');
263           }
264           $this-><?php echo $this->getSingularName() ?>->set<?php echo $column->getPhpName() ?>($value);
265         }
266         catch (sfException $e)
267         {
268           // not a date
269         }
270       }
271       else
272       {
273         $this-><?php echo $this->getSingularName() ?>->set<?php echo $column->getPhpName() ?>(null);
274       }
275 <?php elseif ($type == CreoleTypes::BOOLEAN): ?>
276     $this-><?php echo $this->getSingularName() ?>->set<?php echo $column->getPhpName() ?>(isset($<?php echo $this->getSingularName() ?>['<?php echo $name ?>']) ? $<?php echo $this->getSingularName() ?>['<?php echo $name ?>'] : 0);
277 <?php elseif ($column->isForeignKey()): ?>
278     $this-><?php echo $this->getSingularName() ?>->set<?php echo $column->getPhpName() ?>($<?php echo $this->getSingularName() ?>['<?php echo $name ?>'] ? $<?php echo $this->getSingularName() ?>['<?php echo $name ?>'] : null);
279 <?php else: ?>
280       $this-><?php echo $this->getSingularName() ?>->set<?php echo $column->getPhpName() ?>($<?php echo $this->getSingularName() ?>['<?php echo $name ?>']);
281 <?php endif; ?>
282 <?php if ($type != CreoleTypes::BOOLEAN): ?>
283     }
284 <?php endif; ?>
285 <?php if ($credentials): ?>
286       }
287 <?php endif; ?>
288 <?php endforeach; ?>
289 <?php endforeach; ?>
290   }
291
292   protected function get<?php echo $this->getClassName() ?>OrCreate(<?php echo $this->getMethodParamsForGetOrCreate() ?>)
293   {
294     if (<?php echo $this->getTestPksForGetOrCreate() ?>)
295     {
296       $<?php echo $this->getSingularName() ?> = new <?php echo $this->getClassName() ?>();
297     }
298     else
299     {
300       $<?php echo $this->getSingularName() ?> = <?php echo $this->getClassName() ?>Peer::retrieveByPk(<?php echo $this->getRetrieveByPkParamsForGetOrCreate() ?>);
301
302       $this->forward404Unless($<?php echo $this->getSingularName() ?>);
303     }
304
305     return $<?php echo $this->getSingularName() ?>;
306   }
307
308   protected function processFilters()
309   {
310 <?php if ($this->getParameterValue('list.filters')): ?>
311     if ($this->getRequest()->hasParameter('filter'))
312     {
313       $filters = $this->getRequestParameter('filters');
314 <?php foreach ($this->getColumns('list.filters') as $column): $type = $column->getCreoleType() ?>
315 <?php if ($type == CreoleTypes::DATE || $type == CreoleTypes::TIMESTAMP): ?>
316       if (isset($filters['<?php echo $column->getName() ?>']['from']) && $filters['<?php echo $column->getName() ?>']['from'] !== '')
317       {
318         $filters['<?php echo $column->getName() ?>']['from'] = sfI18N::getTimestampForCulture($filters['<?php echo $column->getName() ?>']['from'], $this->getUser()->getCulture());
319       }
320       if (isset($filters['<?php echo $column->getName() ?>']['to']) && $filters['<?php echo $column->getName() ?>']['to'] !== '')
321       {
322         $filters['<?php echo $column->getName() ?>']['to'] = sfI18N::getTimestampForCulture($filters['<?php echo $column->getName() ?>']['to'], $this->getUser()->getCulture());
323       }
324 <?php endif; ?>
325 <?php endforeach; ?>
326
327       // reset Multi-sort
328       if (!is_array($filters))
329       {
330         $this->getUser()->getAttributeHolder()->removeNamespace('sf_admin/<?php echo $this->getSingularName() ?>/sort');
331       }
332
333       $this->getUser()->getAttributeHolder()->removeNamespace('sf_admin/<?php echo $this->getSingularName() ?>/filters');
334       $this->getUser()->getAttributeHolder()->add($filters, 'sf_admin/<?php echo $this->getSingularName() ?>/filters');
335     }
336 <?php endif; ?>
337   }
338
339   protected function processSort()
340   {
341 <?php $multisort = $this->getParameterValue('list.multisort'); ?>
342     $sort = $this->getRequestParameter('sort');
343     $type = $this->getRequestParameter('type');
344    
345     if ($sort)
346     {
347 <?php if (!$multisort) :?>
348       $this->getUser()->getAttributeHolder()->removeNamespace('sf_admin/<?php echo $this->getSingularName() ?>/sort');
349 <?php endif; ?>      
350
351       $this->getUser()->setAttribute($sort, $type, 'sf_admin/<?php echo $this->getSingularName() ?>/sort');
352     }
353
354     if (!$this->getUser()->getAttributeHolder()->getAll('sf_admin/<?php echo $this->getSingularName() ?>/sort'))
355     {
356 <?php if ($sort = $this->getParameterValue('list.sort')): ?>
357 <?php if (is_array($sort)): ?>
358       $this->getUser()->setAttribute('<?php echo $sort[0] ?>', '<?php echo $sort[1] ?>', 'sf_admin/<?php echo $this->getSingularName() ?>/sort');
359 <?php else: ?>
360       $this->getUser()->setAttribute('<?php echo $sort ?>', 'asc', 'sf_admin/<?php echo $this->getSingularName() ?>/sort');
361 <?php endif; ?>
362 <?php endif; ?>
363     }
364   }
365
366   protected function addFiltersCriteria($c)
367   {
368 <?php if ($this->getParameterValue('list.filters')): ?>
369 <?php foreach ($this->getColumns('list.filters') as $column): $type = $column->getCreoleType() ?>
370 <?php if (($column->isPartial() || $column->isComponent()) && $this->getParameterValue('list.fields.'.$column->getName().'.filter_criteria_disabled')) continue ?>
371     if (isset($this->filters['<?php echo $column->getName() ?>_is_empty']))
372     {
373       $criterion = $c->getNewCriterion(<?php echo $this->getPeerClassName() ?>::<?php echo strtoupper($column->getName()) ?>, '');
374       $criterion->addOr($c->getNewCriterion(<?php echo $this->getPeerClassName() ?>::<?php echo strtoupper($column->getName()) ?>, null, Criteria::ISNULL));
375       $c->add($criterion);
376     }
377 <?php if ($type == CreoleTypes::DATE || $type == CreoleTypes::TIMESTAMP): ?>
378     else if (isset($this->filters['<?php echo $column->getName() ?>']))
379     {
380       if (isset($this->filters['<?php echo $column->getName() ?>']['from']) && $this->filters['<?php echo $column->getName() ?>']['from'] !== '')
381       {
382 <?php if ($type == CreoleTypes::DATE): ?>
383         $criterion = $c->getNewCriterion(<?php echo $this->getPeerClassName() ?>::<?php echo strtoupper($column->getName()) ?>, date('Y-m-d', $this->filters['<?php echo $column->getName() ?>']['from']), Criteria::GREATER_EQUAL);
384 <?php else: ?>
385         $criterion = $c->getNewCriterion(<?php echo $this->getPeerClassName() ?>::<?php echo strtoupper($column->getName()) ?>, $this->filters['<?php echo $column->getName() ?>']['from'], Criteria::GREATER_EQUAL);
386 <?php endif; ?>
387       }
388       if (isset($this->filters['<?php echo $column->getName() ?>']['to']) && $this->filters['<?php echo $column->getName() ?>']['to'] !== '')
389       {
390         if (isset($criterion))
391         {
392 <?php if ($type == CreoleTypes::DATE): ?>
393           $criterion->addAnd($c->getNewCriterion(<?php echo $this->getPeerClassName() ?>::<?php echo strtoupper($column->getName()) ?>, date('Y-m-d', $this->filters['<?php echo $column->getName() ?>']['to']), Criteria::LESS_EQUAL));
394 <?php else: ?>
395           $criterion->addAnd($c->getNewCriterion(<?php echo $this->getPeerClassName() ?>::<?php echo strtoupper($column->getName()) ?>, $this->filters['<?php echo $column->getName() ?>']['to'], Criteria::LESS_EQUAL));
396 <?php endif; ?>
397         }
398         else
399         {
400 <?php if ($type == CreoleTypes::DATE): ?>
401           $criterion = $c->getNewCriterion(<?php echo $this->getPeerClassName() ?>::<?php echo strtoupper($column->getName()) ?>, date('Y-m-d', $this->filters['<?php echo $column->getName() ?>']['to']), Criteria::LESS_EQUAL);
402 <?php else: ?>
403           $criterion = $c->getNewCriterion(<?php echo $this->getPeerClassName() ?>::<?php echo strtoupper($column->getName()) ?>, $this->filters['<?php echo $column->getName() ?>']['to'], Criteria::LESS_EQUAL);
404 <?php endif; ?>
405         }
406       }
407
408       if (isset($criterion))
409       {
410         $c->add($criterion);
411       }
412     }
413 <?php else: ?>
414     else if (isset($this->filters['<?php echo $column->getName() ?>']) && $this->filters['<?php echo $column->getName() ?>'] !== '')
415     {
416 <?php if ($type == CreoleTypes::CHAR || $type == CreoleTypes::VARCHAR || $type == CreoleTypes::LONGVARCHAR): ?>
417       $c->add(<?php echo $this->getPeerClassName() ?>::<?php echo strtoupper($column->getName()) ?>, strtr($this->filters['<?php echo $column->getName() ?>'], '*', '%'), Criteria::LIKE);
418 <?php else: ?>
419       $c->add(<?php echo $this->getPeerClassName() ?>::<?php echo strtoupper($column->getName()) ?>, $this->filters['<?php echo $column->getName() ?>']);
420 <?php endif; ?>
421     }
422 <?php endif; ?>
423 <?php endforeach; ?>
424 <?php endif; ?>
425   }
426
427   protected function addSortCriteria($c)
428   {
429     $sort_array = $this->getUser()->getAttributeHolder()->getAll('sf_admin/<?php echo $this->getSingularName() ?>/sort');
430
431     if ($sort_array)
432     {
433       $sort_columns = Array();
434       foreach($sort_array as $sort_column => $sort_type)
435       {
436         switch ($sort_column)
437         {
438 <?php if ($fields = $this->getParameterValue('list.fields')): ?>
439 <?php foreach ($fields as $key => $field): ?>
440 <?php if ($this->getParameterValue('list.fields.'.$key.'.sort_column')): ?>
441           case '<?=$key?>':
442 <?php $column = $this->getParameterValue('list.fields.'.$key.'.sort_column');
443       if ( is_array($column) ) : ?>
444 <?php foreach ($column as $c) : ?>
445             $sort_columns[<?= $c ?>] = $sort_type;
446 <?php endforeach; ?>
447 <?php else: ?> 
448             $sort_columns[<?= $column ?>] = $sort_type;
449 <?php endif; ?>
450             break;
451            
452 <?php endif; ?>
453 <?php endforeach; ?>
454 <?php endif; ?>
455           default:
456             $sort_columns[<?php echo $this->getClassName() ?>Peer::translateFieldName($sort_column, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_COLNAME)] = $sort_type;;
457             break;
458         }
459        
460         if ($sort_type=='none')
461         {
462           $this->getUser()->getAttributeHolder()->remove($sort_column,'sf_admin/<?php echo $this->getSingularName()