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++;
|
$compteur++;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Formulaire pour modifier l'état d'une commande courrier S&D
|
* Formulaire pour modifier l'état d'une commande courrier S&D
|
||||||
*/
|
*/
|
||||||
@ -308,6 +307,31 @@ function afficheCommande($commande, $type){
|
|||||||
if ( $commande->type=='C' && hasModeEdition() ){
|
if ( $commande->type=='C' && hasModeEdition() ){
|
||||||
$contenuEtat.= '<a href="./?page=saisieajax&q=gencourrier/K'.
|
$contenuEtat.= '<a href="./?page=saisieajax&q=gencourrier/K'.
|
||||||
$commande->id.'"target="_blank">Générer le courrier</a>';
|
$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;
|
$colspan = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -411,9 +435,8 @@ function afficheCommande($commande, $type){
|
|||||||
if( $cStatut->ordre == $commande->statutCommande ||
|
if( $cStatut->ordre == $commande->statutCommande ||
|
||||||
$cStatut->ordre == $commande->statutCommande+1 ){
|
$cStatut->ordre == $commande->statutCommande+1 ){
|
||||||
$contenuEtat.= '<option value="'.
|
$contenuEtat.= '<option value="'.
|
||||||
$commande->idCommande.'-'.$cStatut->id.'" '.$selected.'>'.
|
'C'.$commande->idCommande.'-'.$cStatut->id.'" '.
|
||||||
$cStatut->libStatut .
|
$selected.'>'.$cStatut->libStatut.'</option>';
|
||||||
'</option>';
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$contenuEtat.= '</select></div>';
|
$contenuEtat.= '</select></div>';
|
||||||
|
@ -54,11 +54,21 @@ switch ( $action ) {
|
|||||||
|
|
||||||
list($id, $statut) = explode('-', $_REQUEST['changeEtat']);
|
list($id, $statut) = explode('-', $_REQUEST['changeEtat']);
|
||||||
|
|
||||||
$q = Doctrine_Query::create()
|
$type = substr($id,0,1);
|
||||||
->update('Commandes')
|
$identifiant = substr($id,1);
|
||||||
->set('statutCommande', $statut)
|
|
||||||
->where('idCommande = ?', $id)
|
if ( $type == 'K'){
|
||||||
->andWhere('typeCommande = ?', 'C');
|
$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();
|
$rows = $q->execute();
|
||||||
if ( count($rows)>0 ){
|
if ( count($rows)>0 ){
|
||||||
@ -71,8 +81,8 @@ switch ( $action ) {
|
|||||||
$output = '<font color="red">'.$statut->libStatut.'</font>';
|
$output = '<font color="red">'.$statut->libStatut.'</font>';
|
||||||
if ( $statut->ordre==3 ){
|
if ( $statut->ordre==3 ){
|
||||||
$output.=
|
$output.=
|
||||||
'<br/><a href="./?page=saisieajax&q=gencourrier/C'.
|
'<br/><a href="./?page=saisieajax&q=gencourrier/'.
|
||||||
$id.'" target="_blank">'.
|
$type.$id.'" target="_blank">'.
|
||||||
'Générer le courrier</a>';
|
'Générer le courrier</a>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user