Problème de Modification du formulaire
Bonjour,j'ai un problème avec l'édition de mon formulaire il m'indique toujours cette erreur :
Code:
1 2 3
|
500 | Internal Server Error | Doctrine_Table_Exception
Unknown method TimesheetsTable:: |
à vrai dire l'insertion des données se passe très bien voilà mon code :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
|
$idTimesheet = $request->getParameter('id');
$this->form = new TimesheetsForm(Doctrine::getTable('Timesheets')->find($idTimesheet),array('idUser' => $this->getUser()->getAttribute('id'),'Username' => $User['login']));
if ($request->isMethod('post'))
{
if ($this->processForm($request, $this->form))
{
$this->form->save();
.... |
voilà mon template :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
|
<div style="padding-bottom: 10px; margin-left: 10px;">
<strong>Ajout d'une nouvelle tache : </strong>
</div>
<form action="" method="post" id="form">
<table >
<tr>
<th>Client :</th>
<th>Projet :</th>
<th>De :</th>
<th>A :</th>
<th>Type :</th>
<th>Etat :</th>
<th>Tache :</th>
</tr>
<tr>
<td><?php echo $form['projet']->render(array('class' => ($form['projet']->renderError()) ? 'inp-form-error' : 'timesheet-inp-form')); ?></td>
<td><?php echo $form['n_estimation']->render(array('class' => ($form['n_estimation']->renderError()) ? 'inp-form-error' : 'timesheet-inp-form')); ?></td>
<td><?php echo $form['date_debut']->render(array('class' => ($form['n_estimation']->renderError()) ? 'inp-form-error' : 'timesheet-inp-form')); ?></td>
<td><?php echo $form['date_fin']->render(array('class' => ($form['n_estimation']->renderError()) ? 'inp-form-error' : 'timesheet-inp-form')); ?></td>
<td><?php echo $form['id_ts_type']->render(array('class' => ($form['n_estimation']->renderError()) ? 'inp-form-error' : 'timesheet-inp-form')); ?></td>
<td><?php echo $form['id_ts_etat']->render(array('class' => ($form['n_estimation']->renderError()) ? 'inp-form-error' : 'timesheet-inp-form')); ?></td>
<td><?php echo $form['id_ts_tache']->render(array('class' => ($form['n_estimation']->renderError()) ? 'inp-form-error' : 'timesheet-inp-form')); ?></td>
<td><input type="submit" value="" class="form-submit" /></td>
<td><input type="reset" value="" class="form-reset" /></td>
</tr>
<tr>
<td><?php if ($form['projet']->renderError()): ?>
<div class="error-left"></div>
<div class="error-inner"><?php echo $form['projet']->renderError(); ?></div>
<?php endif; ?>
</td>
<td><?php if ($form['n_estimation']->renderError()): ?>
<div class="error-left"></div>
<div class="error-inner"><?php echo $form['n_estimation']->renderError(); ?></div>
<?php endif; ?></td>
<td><?php if ($form['date_debut']->renderError()): ?>
<div class="error-left"></div>
<div class="error-inner"><?php echo $form['date_debut']->renderError(); ?></div>
<?php endif; ?></td>
<td><?php if ($form['date_fin']->renderError()): ?>
<div class="error-left"></div>
<div class="error-inner"><?php echo $form['date_fin']->renderError(); ?></div>
<?php endif; ?></td>
<td><?php if ($form['id_ts_type']->renderError()): ?>
<div class="error-left"></div>
<div class="error-inner"><?php echo $form['id_ts_type']->renderError(); ?></div>
<?php endif; ?></td>
<td><?php if ($form['id_ts_etat']->renderError()): ?>
<div class="error-left"></div>
<div class="error-inner"><?php echo $form['id_ts_etat']->renderError(); ?></div>
<?php endif; ?></td>
<td><?php if ($form['id_ts_tache']->renderError()): ?>
<div class="error-left"></div>
<div class="error-inner"><?php echo $form['id_ts_tache']->renderError(); ?></div>
<?php endif; ?></td>
</tr>
</table>
</form> |
et voilà mon form :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117
|
class TimesheetsForm extends BaseTimesheetsForm {
public function configure() {
$this->disableCSRFProtection();
// Boucle pour les types
$q = Doctrine_Query::create()
->select('tst.id_ts_type,tst.nom')
->from('tsTypes tst');
$res = $q->fetchArray();
if ($res != null)
{
foreach ($res as $ligne)
{
$liste_types[$ligne['id_ts_type']] = $ligne['nom'];
}
}
else
{
$liste_types = array();
}
unset($res);
// Boucle pour les etats
$q = Doctrine_Query::create()
->select('tse.id_ts_etat,tse.nom')
->from('tsEtats tse');
$res = $q->fetchArray();
if ($res != null)
{
foreach ($res as $ligne)
{
$liste_etats[$ligne['id_ts_etat']] = $ligne['nom'];
}
}
else
{
$liste_etats = array();
}
unset($res);
// Boucle pour les type taches
$q = Doctrine_Query::create()
->select('tsta.id_ts_tache,tsta.nom')
->from('tsTaches tsta');
$res = $q->fetchArray();
if ($res != null)
{
foreach ($res as $ligne)
{
if(strtolower($ligne['nom']) != 'evolution')
$liste_taches[$ligne['id_ts_tache']] = $ligne['nom'];
}
}
else
{
$liste_taches = array();
}
unset($res);
$projet = new sfWidgetFormDoctrineJQueryAutocompleter(array(
'url' => 'ajaxprojet.html',
'model' => 'Timesheets',
'method_for_query'=>''
));
$this->setWidget('projet', $projet);
$estimation = new sfWidgetFormDoctrineJQueryAutocompleter(array(
'url' => 'ajaxestimation.html',
'model' => 'Timesheets',
'method_for_query'=>''
));
$this->setWidget('n_estimation', $estimation);
//$this->widgetSchema['date_debut'] = new WidgetFormDateTime();
$this->widgetSchema['date_debut']= new sfWidgetFormInput();
$this->widgetSchema['date_fin']= new sfWidgetFormInput();
//$this->widgetSchema['date_fin'] = new WidgetFormDateTime();
//$this->widgetSchema['date_fin'] = new sfWidgetFormDateTime(array('date' => array('format' => '%day%/%month%/%year%','years' => array_combine($years, $years))));
$this->widgetSchema['id_ts_type'] = new sfWidgetFormSelect(array('choices' =>$liste_types));
$this->widgetSchema['id_ts_etat'] = new sfWidgetFormSelect(array('choices' =>$liste_etats));
$this->widgetSchema['id_ts_tache'] = new sfWidgetFormSelect(array('choices' =>$liste_taches));
// $this->widgetSchema['date_debut'] = new sfWidgetFormInput();
//$this->setDefault('id_utilisateur', '20');
$this->setDefault('date_debut', date("m/d/Y H:i"));
$this->setDefault('date_fin', date("m/d/Y H:i"));
$this->widgetSchema->setNameFormat('timesheets[%s]');
$this->widgetSchema->setFormFormatterName('custom');
} |
et voilà mon schema :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120
|
Timesheets:
connection: doctrine
tableName: timesheets
columns:
id_timesheet:
type: integer(8)
fixed: false
unsigned: false
primary: true
autoincrement: true
titre:
type: string()
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
id_client:
type: integer(8)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
id_estimation:
type: integer(8)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
id_utilisateur:
type: integer(8)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
projet:
type: string(50)
fixed: false
unsigned: false
primary: false
notnull: true
autoincrement: false
n_estimation:
type: integer(4)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
date_debut:
type: timestamp(25)
fixed: false
unsigned: false
primary: false
notnull: true
autoincrement: false
date_fin:
type: timestamp(25)
fixed: false
unsigned: false
primary: false
notnull: true
autoincrement: false
id_ts_type:
type: integer(8)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
id_ts_etat:
type: integer(8)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
id_ts_tache:
type: integer(8)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
description:
type: string()
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
relations:
Estimations:
local: id_estimation
foreign: id_estimation
type: one
TsTypes:
local: id_ts_type
foreign: id_ts_type
type: one
TsEtats:
local: id_ts_etat
foreign: id_ts_etat
type: one
TsTaches:
local: id_ts_tache
foreign: id_ts_tache
type: one
Utilisateurs:
local: id_utilisateur
foreign: id_utilisateur
type: one
Clients:
local: id_client
foreign: id_client
type: one |
Une idée??