/[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 47 by fraynaud, Thu Aug 11 16:03:10 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 337  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      // ==================================================================      // ==================================================================
# Line 344  class instruction extends instruction_ge Line 368  class instruction extends instruction_ge
368          // mise a null au lieu de "" / voir compatibilite mysql          // mise a null au lieu de "" / voir compatibilite mysql
369          // voir parametrage CU en dur          // voir parametrage CU en dur
370          // voir parametrage des actions en dur          // 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" :
# Line 352  class instruction extends instruction_ge Line 403  class instruction extends instruction_ge
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 447  class instruction extends instruction_ge Line 498  class instruction extends instruction_ge
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 469  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 489  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.47  
changed lines
  Added in v.123

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26