/[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 123 by fraynaud, Sun Sep 11 20:24:32 2011 UTC revision 124 by fraynaud, Mon Sep 12 17:02:29 2011 UTC
# Line 340  class instruction extends instruction_ge Line 340  class instruction extends instruction_ge
340            
341      function regle($regle){      function regle($regle){
342          $temp = explode ("+",$regle);          $temp = explode ("+",$regle);
343          echo '/'.$regle.sizeof($temp);          echo '|'.$regle;
344          if(sizeof($temp)==1)          // cas rejet
345              if($temp[0]=="archive_date_depot")          if($zone=="null") // 1 dimension -> null
346                return null;
347            if(sizeof($temp)==1) // 1 dimension
348                if($temp[0]=="archive_date_depot") // initialisation avec le depot
349                  return $this->$regle;                  return $this->$regle;
350              else              else // cas general
351                  return $this->valF[$regle];                  return $this->valF[$regle];
352          else{          if(sizeof($temp)==2){ // 2 dimensions
353              if($temp[0]=="archive_date_depot")              if($temp[0]=="archive_date_depot") //initialisation avec le depot
354                  if(is_numeric($temp[1]))                  if(is_numeric($temp[1]))
355                      return  $this->moisdate($this->$temp[0], $temp[1]);                        return  $this->moisdate($this->$temp[0], $temp[1]);  
356                  else                  else
357                      return  $this->moisdate($this->$temp[0], $this->valF[$temp[1]]);                      return  $this->moisdate($this->$temp[0], $this->valF[$temp[1]]);
358                if($temp[0]=="archive_delai") // majoration de delai
359                    return  $this->valF[$temp[0]]+$this->valF[$temp[1]];
360                // cas general 2 dimensions
361              if(is_numeric($temp[1]))              if(is_numeric($temp[1]))
362                  return $this->moisdate($this->valF[$temp[0]], $temp[1]);                  return $this->moisdate($this->valF[$temp[0]], $temp[1]);
363              else                            else              
364                 return  $this->moisdate($this->valF[$temp[0]], $this->valF[$temp[1]]);                 return  $this->moisdate($this->valF[$temp[0]], $this->valF[$temp[1]]);
365          }          }
366            if(sizeof($temp)==3){ // 3 dimensions
367                // cas date de validite de sursis
368                if(is_numeric($temp[1]))
369                    $temp1 = $this->moisdate($this->valF[$temp[0]], $temp[1]);
370                else              
371                    $temp1 = $this->moisdate($this->valF[$temp[0]], $this->valF[$temp[1]]);
372                if(is_numeric($temp[2]))
373                    return $this->moisdate($temp1, $temp[2]);
374                else
375                    return $this->moisdate($temp1, $this->valF[$temp[2]]);
376            }
377      }      }
378            
379            
# Line 369  class instruction extends instruction_ge Line 386  class instruction extends instruction_ge
386          // voir parametrage CU en dur          // voir parametrage CU en dur
387          // voir parametrage des actions en dur          // voir parametrage des actions en dur
388          $param=1;          $param=1;
           
389          if($param==1){          if($param==1){
390          $sql="select * from action where action = '".$this->valF['action']."'";          $sql="select * from action where action = '".$this->valF['action']."'";
391          $res = $db->query($sql);          $res = $db->query($sql);
# Line 385  class instruction extends instruction_ge Line 401  class instruction extends instruction_ge
401              if($row['regle_accord_tacite']!=''){              if($row['regle_accord_tacite']!=''){
402                  $valF['accord_tacite']= $this->regle($row['regle_accord_tacite']);                  $valF['accord_tacite']= $this->regle($row['regle_accord_tacite']);
403              }              }
404                if($row['regle_avis']!=''){
405                    $valF['avis']= $this->regle($row['regle_avis']);
406                }
407              if($row['regle_date_limite']!=''){              if($row['regle_date_limite']!=''){
408                  $valF['date_limite']= $this->regle($row['regle_date_limite']);                  $valF['date_limite']= $this->regle($row['regle_date_limite']);
409              }              }
# Line 394  class instruction extends instruction_ge Line 413  class instruction extends instruction_ge
413              if($row['regle_date_notification_delai']!=''){              if($row['regle_date_notification_delai']!=''){
414                  $valF['date_notification_delai']= $this->regle($row['regle_date_notification_delai']);                  $valF['date_notification_delai']= $this->regle($row['regle_date_notification_delai']);
415              }              }
416                if($row['regle_date_decision']!=''){
417                    $valF['date_decision']= $this->regle($row['regle_date_decision']);
418                }
419                if($row['regle_date_rejet']!=''){
420                    $valF['date_rejet']= $this->regle($row['regle_date_rejet']);
421                }
422               if($row['regle_date_validite']!=''){
423                    $valF['date_validite']= $this->regle($row['regle_date_validite']);
424                }
425               if($row['regle_date_chantier']!=''){
426                    $valF['date_chantier']= $this->regle($row['regle_date_chantier']);
427                }
428               if($row['regle_date_achevement']!=''){
429                    $valF['date_achevement']= $this->regle($row['regle_date_achevement']);
430                }
431               if($row['regle_date_conformite']!=''){
432                    $valF['date_conformite']= $this->regle($row['regle_date_conformite']);
433                }
434          }          }
435          }else{          }else{
           
436          switch ($this->valF['action']) {          switch ($this->valF['action']) {
437          case "initialisation" :          case "initialisation" :
438              $valF['delai']= $this->valF['delai'];              $valF['delai']= $this->valF['delai'];
# Line 500  class instruction extends instruction_ge Line 536  class instruction extends instruction_ge
536          }// end switch          }// end switch
537          } // end param          } // end param
538          // mise à jour dossier [modify dossier]          // mise à jour dossier [modify dossier]
539          print_r($valF);          if($param==1){ // parametrage en table
540                echo "<br>";
541                print_r($valF);
542            }
543          if($valF!=""){          if($valF!=""){
544              $cle= " dossier = '".$this->valF['dossier']."'";              $cle= " dossier = '".$this->valF['dossier']."'";
545              $res1= $db->autoExecute('dossier',$valF,DB_AUTOQUERY_UPDATE,$cle);              $res1= $db->autoExecute('dossier',$valF,DB_AUTOQUERY_UPDATE,$cle);

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

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26