Platform  3.1
PHP API documentation
 All Data Structures Namespaces Files Functions Variables Pages
editransition.php
Go to the documentation of this file.
1 <?php
2 /*
3  * @author Anakeen
4  * @license http://creativecommons.org/licenses/by-nc-sa/2.0/fr/ Anakeen - licence CC
5  * @package FDL
6 */
7 /**
8  * Generated Header (not documented yet)
9  *
10  * @author Anakeen 2000
11  * @version $Id: editransition.php,v 1.4 2008/12/02 15:23:44 eric Exp $
12  * @license http://creativecommons.org/licenses/by-nc-sa/2.0/fr/ Anakeen - licence CC
13  * @package FDL
14  * @subpackage GED
15  */
16 /**
17  */
18 // ---------------------------------------------------------------
19 // $Id: editransition.php,v 1.4 2008/12/02 15:23:44 eric Exp $
20 // $Source: /home/cvsroot/anakeen/freedom/freedom/Action/Freedom/editransition.php,v $
21 // ---------------------------------------------------------------
22 include_once ('FDL/Class.Doc.php');
24 {
25  $etats = GetHttpVars("state");
26  $tab = explode(",", $etats);
27  $tt = GetHttpVars("tt");
28  $tabtt = explode(",", $tt);
29  while (list($k, $v) = each($tabtt)) {
30  $tab_tt[$k] = explode("*", $v);
31  }
32  // print_r($tab_tt);
33  while (list($i, $tt) = each($tab_tt)) {
34  $tab_relation_tt[$tt[1]] = $tt[0];
35  }
36 
37  $docid = GetHttpVars("docid");
38  $action->lay->set("id", $docid);
39 
40  $dbaccess = $action->GetParam("FREEDOM_DB");
42 
43  $idetats_ini = explode("\n", $doc->GetValue("wor_trans_idetat_ini"));
44  $idetats_fin = explode("\n", $doc->GetValue("wor_trans_idetat_fin"));
45  $descriptions = explode("\n", $doc->GetValue("wor_trans_descrip"));
46  $tts = explode("\n", $doc->GetValue("wor_trans_tt"));
47 
48  while (list($k, $v) = each($idetats_ini)) {
49  $descrip[$v][$idetats_fin[$k]] = $descriptions[$k];
50  $type_trans[$v][$idetats_fin[$k]] = $tts[$k];
51  }
52 
53  $ligne1 = array();
54  reset($tab);
55  $tab2 = $tab;
56  $tab[-1] = "transition_initiale:-1";
57  //to be in first
58  $lignes[-1]["etat"] = "transition_initiale";
59  $lignes[-1]["LIGNEEE"] = "LIGNE_transition_initiale:-1";
60 
61  while (list($i, $etat) = each($tab)) {
62  $nom = explode(":", $etat);
63  if ($i != - 1) {
64  $ligne1[$i]["nom_etat"] = $nom[0];
65  // $ligne2[$i]["new_trans"]="";
66  $lignes[$i]["etat"] = $nom[0];
67  $lignes[$i]["LIGNEEE"] = "LIGNE_$etat";
68  }
69  }
70 
71  $action->lay->setBlockData("LIGNE1", $ligne1);
72  $action->lay->setBlockData("LIGNE2", $ligne2);
73  $action->lay->setBlockData("LIGNES", $lignes);
74 
75  reset($tab);
76 
77  while (list($i, $etat) = each($tab)) {
78  reset($tab2);
79  while (list($x, $etat2) = each($tab2)) {
80 
81  $inputlay = new Layout("FREEDOM/Layout/input_transition.xml", $action);
82 
83  $etat_ini = explode(":", $etat);
84  $etat_fin = explode(":", $etat2);
85  $result = 100 / sizeof($tab);
86  // printf($result);
87  $inputlay->set("width", "$result");
88  $inputlay->set("value_etat_ini", $etat_ini[0]);
89  $inputlay->set("value_idetat_ini", $etat_ini[1]);
90  $inputlay->set("value_etat_fin", $etat_fin[0]);
91  $inputlay->set("value_idetat_fin", $etat_fin[1]);
92  $inputlay->set("value_descrip", $descrip[$etat_ini[1]][$etat_fin[1]]);
93  $value_tt = $type_trans[$etat_ini[1]][$etat_fin[1]];
94  $inputlay->set("value_tt", $value_tt);
95  $inputlay->set("text_tt", $tab_relation_tt[$value_tt]);
96  $temp = "trans";
97  $temp.= $i;
98  $temp.= "_$x";
99  $inputlay->set("id_tt", $temp);
100  // $inte[$i][$x]["idtt"]= $temp;
101  $inte[$i][$x]["input"] = $inputlay->gen();
102  }
103  }
104  reset($tab);
105  //$inte[0]["idtt"]="dd";
106  while (list($i, $etat) = each($tab)) {
107  // print_r($inte[$i]);printf("<BR>");
108  $action->lay->setBlockData($lignes[$i]["LIGNEEE"], $inte[$i]);
109  }
110 
111  reset($tab_tt);
112  while (list($i, $tt) = each($tab_tt)) {
113  $option[$i]["titre"] = $tt[0]; //nom $tt[1] correspond a l'id de l'attribut
114  $option[$i]["id_tt"] = $tt[1];
115  }
116  $action->lay->setBlockData("OPTIONS", $option);
117  $action->lay->gen();
118 }
119 ?>
← centre documentaire © anakeen - published under CC License - Dynacase