Skip to content

Commit

Permalink
divers tweak pour les projets
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.iariss.fr/erp@135 55463ab2-4f42-40d6-a48e-481de4af6215
  • Loading branch information
m.mure authored and MichaelMure committed Jun 4, 2011
1 parent f7d6d7e commit de2ace5
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 8 deletions.
2 changes: 1 addition & 1 deletion apps/frontend/modules/projet/actions/actions.class.php
Expand Up @@ -26,7 +26,7 @@ public function executeShow(sfWebRequest $request)
$this->forward404Unless($this->user = Membre::getProfile($_SERVER['PHP_AUTH_USER']));
$this->projet = Doctrine_Core::getTable('Projet')
->createQuery('a')
->select('a.id, a.nom, a.numero, a.budget, a.commentaire, a.date_debut, a.date_cloture, p.nom, p.id')
->select('a.id, a.nom, a.numero, a.budget, a.commentaire, a.date_debut, a.date_cloture, a.delai_realisation, p.nom, p.id')
->leftJoin('a.Prospect p')
->where('a.id = ?', array($request->getParameter('id')))
->execute()->getFirst();
Expand Down
8 changes: 7 additions & 1 deletion apps/frontend/modules/projet/templates/indexSuccess.php
Expand Up @@ -20,7 +20,13 @@
<td><?php echo $projet->getEtat() ?></td>
<td><?php echo $projet->getQualite() ?></td>
<td><a href="<?php echo url_for('@prospect?action=show&id='.$projet->getProspectId()) ?>"><?php echo $projet->getProspect() ?></td>
<td><a href="<?php echo url_for('@annuaire?action=show&id='.$projet->getRespo()->getId()) ?>"><?php echo $projet->getRespo() ?></td>

<?php if($respo = $projet->getRespo()) : ?>
<td><a href="<?php echo url_for('@annuaire?action=show&id='.$respo->getId()) ?>"><?php echo $respo ?></td>
<?php else : ?>
<td>Pas de chef de projet assigné !</td>
<?php endif ?>

<td><?php echo format_date($projet->getDateDebut()) ?></td>
<td><?php echo format_date($projet->getDateCloture()) ?></td>
</tr>
Expand Down
2 changes: 2 additions & 0 deletions apps/frontend/modules/projet/templates/showSuccess.php
Expand Up @@ -10,6 +10,7 @@
<th>Chef de projet</th>
<th>Budget</th>
<th>Date debut</th>
<th>Délai de réalisation</th>
<th>Date cloture</th>
</tr>
</thead>
Expand All @@ -27,6 +28,7 @@

<td><?php echo $projet->getBudget() ? format_number($projet->getBudget()).' €' : '' ?></td>
<td><?php echo format_date($projet->getDateDebut()) ?></td>
<td><?php echo $projet->getDelaiRealisation() ? $projet->getDelaiRealisation().' jours' : '' ?></td>
<td><?php echo $projet->getDateCloture() ? format_date($projet->getDateCloture()) : 'non cloturé' ?></td>
</tr>
</tbody>
Expand Down
2 changes: 1 addition & 1 deletion config/doctrine/schema.yml
Expand Up @@ -113,7 +113,7 @@ Projet:
LienMembreProjet:
columns:
role: { type: enum, values: [Chef de projet, Intervenant, Commercial, Contact, Redacteur], notnull: true }
JEH: { type: integer }
JEH: { type: integer, notnull: true }
commentaire: { type: string(100) }
projet_id: { type: integer, notnull: true }
membre_id: { type: integer, notnull: true }
Expand Down
2 changes: 1 addition & 1 deletion data/sql/schema.sql
@@ -1,5 +1,5 @@
CREATE TABLE contact (id BIGINT AUTO_INCREMENT, date DATE NOT NULL, commentaire TEXT, prospect_id BIGINT NOT NULL, membre_id BIGINT NOT NULL, type_contact_id BIGINT NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX prospect_id_idx (prospect_id), INDEX membre_id_idx (membre_id), INDEX type_contact_id_idx (type_contact_id), PRIMARY KEY(id)) ENGINE = INNODB;
CREATE TABLE lien_membre_projet (id BIGINT AUTO_INCREMENT, role VARCHAR(255) NOT NULL, jeh BIGINT, commentaire VARCHAR(100), projet_id BIGINT NOT NULL, membre_id BIGINT NOT NULL, INDEX membre_id_idx (membre_id), INDEX projet_id_idx (projet_id), PRIMARY KEY(id)) ENGINE = INNODB;
CREATE TABLE lien_membre_projet (id BIGINT AUTO_INCREMENT, role VARCHAR(255) NOT NULL, jeh BIGINT NOT NULL, commentaire VARCHAR(100), projet_id BIGINT NOT NULL, membre_id BIGINT NOT NULL, INDEX membre_id_idx (membre_id), INDEX projet_id_idx (projet_id), PRIMARY KEY(id)) ENGINE = INNODB;
CREATE TABLE membre (id BIGINT AUTO_INCREMENT, username VARCHAR(50), passwd VARCHAR(50) NOT NULL, numero_etudiant BIGINT, prenom VARCHAR(255) NOT NULL, nom VARCHAR(255) NOT NULL, sexe VARCHAR(255) NOT NULL, date_naissance DATE NOT NULL, ville_naissance VARCHAR(255) NOT NULL, numero_secu VARCHAR(21), promo BIGINT NOT NULL, filiere VARCHAR(255) NOT NULL, poste VARCHAR(50), adresse_mulhouse TEXT NOT NULL, cp_mulhouse BIGINT NOT NULL, ville_mulhouse VARCHAR(255) NOT NULL, adresse_parents TEXT, cp_parents BIGINT, ville_parents VARCHAR(255), tel_mobile VARCHAR(255) NOT NULL, tel_fixe VARCHAR(255), email_interne VARCHAR(255), email_externe VARCHAR(255), carte_id TINYINT(1) DEFAULT '0' NOT NULL, just_domicile TINYINT(1) DEFAULT '0' NOT NULL, quittance TINYINT(1) DEFAULT '0' NOT NULL, reglement_interieur TINYINT(1) DEFAULT '0' NOT NULL, convention_etudiant TINYINT(1) DEFAULT '0' NOT NULL, cotisation TINYINT(1) DEFAULT '0' NOT NULL, status VARCHAR(255) DEFAULT 'Membre' NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, PRIMARY KEY(id)) ENGINE = INNODB;
CREATE TABLE projet (id BIGINT AUTO_INCREMENT, numero BIGINT NOT NULL, nom VARCHAR(50) NOT NULL, date_debut DATE NOT NULL, date_cloture DATE, commentaire text, budget real, delai_realisation BIGINT, prospect_id BIGINT NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, deleted_at DATETIME, INDEX prospect_id_idx (prospect_id), PRIMARY KEY(id)) ENGINE = INNODB;
CREATE TABLE projet_event (id BIGINT AUTO_INCREMENT, date DATE, commentaire TEXT, url VARCHAR(255), type_id BIGINT NOT NULL, membre_id BIGINT NOT NULL, projet_id BIGINT NOT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, INDEX type_id_idx (type_id), INDEX membre_id_idx (membre_id), INDEX projet_id_idx (projet_id), PRIMARY KEY(id)) ENGINE = INNODB;
Expand Down
Expand Up @@ -14,7 +14,7 @@ public function setup()
{
$this->setWidgets(array(
'role' => new sfWidgetFormChoice(array('choices' => array('' => '', 'Chef de projet' => 'Chef de projet', 'Intervenant' => 'Intervenant', 'Commercial' => 'Commercial', 'Contact' => 'Contact', 'Redacteur' => 'Redacteur'))),
'JEH' => new sfWidgetFormFilterInput(),
'JEH' => new sfWidgetFormFilterInput(array('with_empty' => false)),
'commentaire' => new sfWidgetFormFilterInput(),
'projet_id' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Projet'), 'add_empty' => true)),
'membre_id' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Membre'), 'add_empty' => true)),
Expand Down
5 changes: 3 additions & 2 deletions lib/form/doctrine/LienMembreProjetForm.class.php
Expand Up @@ -15,7 +15,7 @@ public function configure()
sfContext::getInstance()->getConfiguration()->loadHelpers('Url');

$this->widgetSchema['projet_id'] = new sfWidgetFormInputHidden();

$this->widgetSchema['membre_id']->setOption('renderer_class', 'sfWidgetFormDoctrineJQueryAutocompleter');
$this->widgetSchema['membre_id']->setOption('renderer_options', array(
'model' => 'Membre',
Expand All @@ -24,14 +24,15 @@ public function configure()

$this->widgetSchema->moveField('role', sfWidgetFormSchema::AFTER, 'membre_id');
$this->widgetSchema->moveField('JEH', sfWidgetFormSchema::AFTER, 'role');
$this->widgetSchema->moveField('commentaire', sfWidgetFormSchema::LAST);
}

public function getJavascripts()
{
return array('jquery-1.4.2.min.js',
'/sfFormExtraPlugin/js/jquery.autocompleter.js');
}

public function getStylesheets()
{
return array('/sfFormExtraPlugin/css/jquery.autocompleter.css' => 'all');
Expand Down
2 changes: 1 addition & 1 deletion lib/form/doctrine/base/BaseLienMembreProjetForm.class.php
Expand Up @@ -26,7 +26,7 @@ public function setup()
$this->setValidators(array(
'id' => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
'role' => new sfValidatorChoice(array('choices' => array(0 => 'Chef de projet', 1 => 'Intervenant', 2 => 'Commercial', 3 => 'Contact', 4 => 'Redacteur'))),
'JEH' => new sfValidatorInteger(array('required' => false)),
'JEH' => new sfValidatorInteger(),
'commentaire' => new sfValidatorString(array('max_length' => 100, 'required' => false)),
'projet_id' => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Projet'))),
'membre_id' => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Membre'))),
Expand Down
1 change: 1 addition & 0 deletions lib/model/doctrine/base/BaseLienMembreProjet.class.php
Expand Up @@ -52,6 +52,7 @@ public function setTableDefinition()
));
$this->hasColumn('JEH', 'integer', null, array(
'type' => 'integer',
'notnull' => true,
));
$this->hasColumn('commentaire', 'string', 100, array(
'type' => 'string',
Expand Down

0 comments on commit de2ace5

Please sign in to comment.