/[openfoncier]/trunk/obj/instruction.class.php
ViewVC logotype

Diff of /trunk/obj/instruction.class.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 20 by fraynaud, Mon Jul 18 15:27:17 2011 UTC revision 123 by fraynaud, Sun Sep 11 20:24:32 2011 UTC
# Line 65  class instruction extends instruction_ge Line 65  class instruction extends instruction_ge
65          $this->correct=True;          $this->correct=True;
66          $imgv="";          $imgv="";
67          $f="&nbsp!    ";          $f="&nbsp!    ";
68          $imgv="<img src='../img/punaise.png' style='vertical-align:middle' hspace='2' border='0'>";          $imgv="<img src='../app/img/punaise.png' style='vertical-align:middle' hspace='2' border='0'>";
69          // obligatoire          // obligatoire
70          if ($this->valF['destinataire']==""){          if ($this->valF['destinataire']==""){
71             $this->correct=false;             $this->correct=false;
# Line 162  class instruction extends instruction_ge Line 162  class instruction extends instruction_ge
162          }else{ // modify          }else{ // modify
163              $form->setType('instruction', 'hiddenstatic');              $form->setType('instruction', 'hiddenstatic');
164              $form->setType('evenement', 'hiddenstatic');              $form->setType('evenement', 'hiddenstatic');
165              $form->setType('datecourrier', 'hiddenstaticdate');              //$form->setType('datecourrier', 'hiddenstaticdate');
166                $form->setType('datecourrier', 'date2');
167          }          }
168      }else{ // supprimer  [delete]      }else{ // supprimer  [delete]
169          $form->setType('instruction', 'hiddenstatic');          $form->setType('instruction', 'hiddenstatic');
# Line 207  class instruction extends instruction_ge Line 208  class instruction extends instruction_ge
208              // recherche des evenement de transition              // recherche des evenement de transition
209              $sql= $sql_transition." where transition.etat ='".$etat_dossier."' and (evenement.nature ='".              $sql= $sql_transition." where transition.etat ='".$etat_dossier."' and (evenement.nature ='".
210                    $nature_dossier."' or (nature ='T' and nature !='CU')) order by evenement.action";                    $nature_dossier."' or (nature ='T' and nature !='CU')) order by evenement.action";
211                // *** attention en dur le CU
212                
213    
214              $res = $db->query($sql);              $res = $db->query($sql);
215              if (database::isError($res))              if (database::isError($res))
216                  die($res->getMessage());                  die($res->getMessage());
# Line 334  class instruction extends instruction_ge Line 338  class instruction extends instruction_ge
338          }          }
339      }      }
340            
341        function regle($regle){
342            $temp = explode ("+",$regle);
343            echo '/'.$regle.sizeof($temp);
344            if(sizeof($temp)==1)
345                if($temp[0]=="archive_date_depot")
346                    return $this->$regle;
347                else
348                    return $this->valF[$regle];
349            else{
350                if($temp[0]=="archive_date_depot")
351                    if(is_numeric($temp[1]))
352                        return  $this->moisdate($this->$temp[0], $temp[1]);  
353                    else
354                        return  $this->moisdate($this->$temp[0], $this->valF[$temp[1]]);
355                if(is_numeric($temp[1]))
356                    return $this->moisdate($this->valF[$temp[0]], $temp[1]);
357                else              
358                   return  $this->moisdate($this->valF[$temp[0]], $this->valF[$temp[1]]);
359            }
360        }
361        
362        
363        
364      // ==================================================================      // ==================================================================
365      // valeur dossier  apres modification   [values dossier after action]      // valeur dossier  apres modification   [values dossier after action]
366      // ==================================================================      // ==================================================================
367      function triggerajouterapres($id,&$db,$val,$DEBUG) {      function triggerajouterapres($id,&$db,$val,$DEBUG) {
368            // mise a null au lieu de "" / voir compatibilite mysql
369            // voir parametrage CU en dur
370            // voir parametrage des actions en dur
371            $param=1;
372            
373            if($param==1){
374            $sql="select * from action where action = '".$this->valF['action']."'";
375            $res = $db->query($sql);
376            if (database::isError($res))
377                die($res->getMessage());
378            while ($row=& $res->fetchRow(DB_FETCHMODE_ASSOC)){
379                if($row['regle_etat']!=''){
380                    $valF['etat']= $this->regle($row['regle_etat']);
381                }
382                if($row['regle_delai']!=''){
383                    $valF['delai']= $this->regle($row['regle_delai']);
384                }
385                if($row['regle_accord_tacite']!=''){
386                    $valF['accord_tacite']= $this->regle($row['regle_accord_tacite']);
387                }
388                if($row['regle_date_limite']!=''){
389                    $valF['date_limite']= $this->regle($row['regle_date_limite']);
390                }
391                if($row['regle_date_complet']!=''){
392                    $valF['date_complet']= $this->regle($row['regle_date_complet']);
393                }
394                if($row['regle_date_notification_delai']!=''){
395                    $valF['date_notification_delai']= $this->regle($row['regle_date_notification_delai']);
396                }
397            }
398            }else{
399            
400          switch ($this->valF['action']) {          switch ($this->valF['action']) {
401          case "initialisation" :          case "initialisation" :
402              $valF['delai']= $this->valF['delai'];              $valF['delai']= $this->valF['delai'];
403              $valF['etat']= $this->valF['etat'];              $valF['etat']= $this->valF['etat'];
404              $valF['accord_tacite']= $this->valF['accord_tacite'];              $valF['accord_tacite']= $this->valF['accord_tacite'];
405              // la date_complet est la date de depot              // la date_complet est la date de depot
406              $valF['date_complet']= $this->archive_date_depot;              $valF['date_complet']= $this->archive_date_depot; // ****
407              $valF['date_limite'] =  $this->moisdate($valF['date_complet'],$valF['delai']);              $valF['date_limite'] =  $this->moisdate($valF['date_complet'],$valF['delai']);
408              $valF['date_notification_delai'] =  $this->moisdate($valF['date_complet'],1);              $valF['date_notification_delai'] =  $this->moisdate($valF['date_complet'],1);
409              break;              break;
# Line 379  class instruction extends instruction_ge Line 438  class instruction extends instruction_ge
438              // la date rejet est initialisee              // la date rejet est initialisee
439              $valF['date_rejet']= $this->valF['datecourrier'];              $valF['date_rejet']= $this->valF['datecourrier'];
440              // les dates de depart et fin d instruction sont annulées              // les dates de depart et fin d instruction sont annulées
441              $valF['date_limite'] ="";              $valF['date_limite'] =null;
442              $valF['date_notification_delai'] ="";              $valF['date_notification_delai'] =null;
443              $valF['date_complet']="";              $valF['date_complet']=null;
444              break;              break;
445          case "majoration" :          case "majoration" :
446              $valF['delai']= $this->valF['archive_delai']+$this->valF['delai'];              $valF['delai']= $this->valF['archive_delai']+$this->valF['delai'];
# Line 420  class instruction extends instruction_ge Line 479  class instruction extends instruction_ge
479              $valF['date_decision']= $this->valF['datecourrier'];              $valF['date_decision']= $this->valF['datecourrier'];
480              $temp = $valF['date_limite'];              $temp = $valF['date_limite'];
481              $valF['date_validite']= $this->moisdate($temp,2);              $valF['date_validite']= $this->moisdate($temp,2);
             echo  $valF['date_limite']."vvv" ;  
482              break;              break;
483          case "execution" :          case "execution" :
484              $valF['etat']= $this->valF['etat'];              $valF['etat']= $this->valF['etat'];
485              $valF['date_chantier'] =  $this->valF['datecourrier'];              $valF['date_chantier'] =  $this->valF['datecourrier'];
486              echo $this->msg=$this->msg.$valF['date_chantier']."***";              //echo $this->msg=$this->msg.$valF['date_chantier']."";
487              break;              break;
488          case "achevement" :          case "achevement" :
489              $valF['etat']= $this->valF['etat'];              $valF['etat']= $this->valF['etat'];
# Line 435  class instruction extends instruction_ge Line 493  class instruction extends instruction_ge
493              $valF['etat']= $this->valF['etat'];              $valF['etat']= $this->valF['etat'];
494              $valF['date_conformite'] = $this->valF['datecourrier'];              $valF['date_conformite'] = $this->valF['datecourrier'];
495              break;              break;
496          /*  
497            case "abandon" :          default:
             $valF['etat']= $this->valF['etat'];  
                break;  
         */  
        default:  
498          if ($this->valF['etat']!="")          if ($this->valF['etat']!="")
499             $valF['etat']= $this->valF['etat'];             $valF['etat']= $this->valF['etat'];
500          }// end switch          }// end switch
501                } // end param
502          // mise à jour dossier [modify dossier]          // mise à jour dossier [modify dossier]
503            print_r($valF);
504          if($valF!=""){          if($valF!=""){
505              $cle= " dossier = '".$this->valF['dossier']."'";              $cle= " dossier = '".$this->valF['dossier']."'";
506              $res1= $db->autoExecute('dossier',$valF,DB_AUTOQUERY_UPDATE,$cle);              $res1= $db->autoExecute('dossier',$valF,DB_AUTOQUERY_UPDATE,$cle);
# Line 466  class instruction extends instruction_ge Line 521  class instruction extends instruction_ge
521          $valF['delai']=$val['archive_delai'];          $valF['delai']=$val['archive_delai'];
522          $valF['accord_tacite']=$val['archive_accord_tacite'];          $valF['accord_tacite']=$val['archive_accord_tacite'];
523          $valF['etat']=$val['archive_etat'];          $valF['etat']=$val['archive_etat'];
524          $valF['avis']=$val['archive_avis'];          if($val['archive_avis']=='')
525                $valF['avis']= null;
526            else
527                $valF['avis']=$val['archive_avis'];
528          // if= compatibilite pgsql          // if= compatibilite pgsql
529          if($val['archive_date_complet']!='')          if($val['archive_date_complet']!='')
530              $valF['date_complet']=$val['archive_date_complet'];              $valF['date_complet']=$val['archive_date_complet'];
# Line 486  class instruction extends instruction_ge Line 544  class instruction extends instruction_ge
544              $valF['date_chantier']= $val['archive_date_chantier'];              $valF['date_chantier']= $val['archive_date_chantier'];
545          if($val['archive_date_conformite']!='')          if($val['archive_date_conformite']!='')
546              $valF['date_conformite']= $val['archive_date_conformite'];              $valF['date_conformite']= $val['archive_date_conformite'];
547            
548          $cle= " dossier = '".$val['dossier']."'";          $cle= " dossier = '".$val['dossier']."'";
549          $res= $db->autoExecute('dossier',$valF,DB_AUTOQUERY_UPDATE,$cle);          $res= $db->autoExecute('dossier',$valF,DB_AUTOQUERY_UPDATE,$cle);
550          if (database::isError($res))          if (database::isError($res))

Legend:
Removed from v.20  
changed lines
  Added in v.123

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26