Ajout du statut de traitement, issue #0000146
This commit is contained in:
parent
4ac01c6a5d
commit
9e362062f1
@ -300,7 +300,6 @@ function afficheCommande($commande, $type){
|
||||
}
|
||||
$compteur++;
|
||||
|
||||
|
||||
/*
|
||||
* Formulaire pour modifier l'état d'une commande courrier S&D
|
||||
*/
|
||||
@ -308,6 +307,31 @@ function afficheCommande($commande, $type){
|
||||
if ( $commande->type=='C' && hasModeEdition() ){
|
||||
$contenuEtat.= '<a href="./?page=saisieajax&q=gencourrier/K'.
|
||||
$commande->id.'"target="_blank">Générer le courrier</a>';
|
||||
|
||||
$cStatuts = listStatus();
|
||||
$contenuEtat.= '<div>' .
|
||||
'<label>Changer l\'état : </label>' .
|
||||
'<select class="changeEtatC" name="Etat'.$commande->id.'">';
|
||||
if($commande->statutCommande == 0)
|
||||
{
|
||||
$contenuEtat.='<option value="0">Non traité</option>';
|
||||
}
|
||||
foreach ($cStatuts as $cStatut)
|
||||
{
|
||||
$selected = '';
|
||||
//Selection du statut en cours
|
||||
if($cStatut->ordre == $commande->statutCommande)
|
||||
{
|
||||
$selected = 'selected';
|
||||
}
|
||||
$contenuEtat.= '<option value="'.
|
||||
'K'.$commande->id.'-'.$cStatut->id.'" '.
|
||||
$selected.'>'.$cStatut->libStatut.'</option>';
|
||||
}
|
||||
$contenuEtat.= '</select></div>';
|
||||
|
||||
|
||||
|
||||
$colspan = 1;
|
||||
}
|
||||
|
||||
@ -411,9 +435,8 @@ function afficheCommande($commande, $type){
|
||||
if( $cStatut->ordre == $commande->statutCommande ||
|
||||
$cStatut->ordre == $commande->statutCommande+1 ){
|
||||
$contenuEtat.= '<option value="'.
|
||||
$commande->idCommande.'-'.$cStatut->id.'" '.$selected.'>'.
|
||||
$cStatut->libStatut .
|
||||
'</option>';
|
||||
'C'.$commande->idCommande.'-'.$cStatut->id.'" '.
|
||||
$selected.'>'.$cStatut->libStatut.'</option>';
|
||||
}
|
||||
}
|
||||
$contenuEtat.= '</select></div>';
|
||||
|
@ -54,11 +54,21 @@ switch ( $action ) {
|
||||
|
||||
list($id, $statut) = explode('-', $_REQUEST['changeEtat']);
|
||||
|
||||
$q = Doctrine_Query::create()
|
||||
->update('Commandes')
|
||||
->set('statutCommande', $statut)
|
||||
->where('idCommande = ?', $id)
|
||||
->andWhere('typeCommande = ?', 'C');
|
||||
$type = substr($id,0,1);
|
||||
$identifiant = substr($id,1);
|
||||
|
||||
if ( $type == 'K'){
|
||||
$q = Doctrine_Query::create()
|
||||
->update('CommandesKbis')
|
||||
->Where('id = ?', $identifiant)
|
||||
->andWhere('type = ?', 'C');
|
||||
} else {
|
||||
$q = Doctrine_Query::create()
|
||||
->update('Commandes')
|
||||
->Where('idCommande = ?', $identifiant)
|
||||
->andWhere('typeCommande = ?', 'C');
|
||||
}
|
||||
$q->set('statutCommande', $statut);
|
||||
|
||||
$rows = $q->execute();
|
||||
if ( count($rows)>0 ){
|
||||
@ -71,8 +81,8 @@ switch ( $action ) {
|
||||
$output = '<font color="red">'.$statut->libStatut.'</font>';
|
||||
if ( $statut->ordre==3 ){
|
||||
$output.=
|
||||
'<br/><a href="./?page=saisieajax&q=gencourrier/C'.
|
||||
$id.'" target="_blank">'.
|
||||
'<br/><a href="./?page=saisieajax&q=gencourrier/'.
|
||||
$type.$id.'" target="_blank">'.
|
||||
'Générer le courrier</a>';
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user