[ Index ]
 

Code source de eGroupWare 1.2.106-2

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/workflow/inc/ -> class.ui_userviewinstance.inc.php (source)

   1  <?php
   2      require_once(dirname(__FILE__) . SEP . 'class.bo_user_forms.inc.php');
   3  
   4      class ui_userviewinstance extends bo_user_forms
   5      {
   6          var $public_functions = array(
   7              'form'    => true
   8          );
   9  
  10          //communication with the workflow engine
  11          var $GUI;
  12          var $instance_manager;
  13          //communication with the security object of the engine
  14          var $security;
  15  
  16  		function ui_userviewinstance()
  17          {
  18              parent::bo_user_forms('user_viewinstance');
  19              
  20              //$this->GUI        =& CreateObject('workflow.workflow_gui');
  21              //$this->instance_manager    =& CreateObject('workflow.workflow_instancemanager');
  22              $this->security =& CreateObject('workflow.workflow_wfsecurity');
  23              $this->instance =& CreateObject('workflow.workflow_instance');
  24          }
  25  
  26  		function form()
  27          {
  28              $iid = get_var('iid', 'any', 0);
  29              if($iid != 0)
  30              {
  31                  $this->instance->getInstance($iid);
  32                  //Security check
  33                  if (!($this->security->checkUserAction(0,$iid,'view')))
  34                  {
  35                      $this->message[] = $this->security->get_error(false, _DEBUG);
  36                      $this->t->set_var(array(
  37                          'instance'    => '',
  38                          'history'    => '',
  39                      ));
  40                  }
  41                  else
  42                  {
  43                      $inst_parser    =& CreateObject('workflow.bo_uiinstance', $this->t);
  44                      //this is necessary the CreateObject did not use ref parameters
  45                      $inst_parser->t =& $this->t;
  46                  
  47                      //$parser->parse_history($instance);
  48                      $inst_parser->parse_instance($this->instance);
  49                      $inst_parser->parse_instance_history($this->instance->workitems);
  50                  
  51                      $this->t->set_var(array(
  52                          'instance'    => $this->t->parse('output', 'instance_tpl'),
  53                          'history'    => $this->t->parse('output', 'history_tpl'),
  54                      ));
  55                  }
  56              }
  57              else
  58              {
  59                  //echo lang('no instance given, nothing to show');
  60                  //$GLOBALS['egw']->common->egw_exit();
  61                  $this->message[] = lang('no instance given, nothing to show');
  62                  $this->t->set_var(array(
  63                          'instance'    => '',
  64                          'history'    => '',
  65                  ));
  66              }
  67              
  68              // fill the table
  69              //$this->fill_table($processes['data'],$processes['cant']);
  70              $this->show_user_tabs($this->class_name);
  71              
  72              //collect error messages
  73              if (isset($this->security)) $this->message[] = $this->security->get_error(false, _DEBUG);
  74              if (isset($this->instance)) $this->message[] = $this->instance->get_error(false, _DEBUG);
  75              
  76              $this->fill_form_variables();
  77              $this->finish();
  78          }
  79          
  80      }
  81  ?>


Généré le : Sun Feb 25 17:20:01 2007 par Balluche grâce à PHPXref 0.7