/**
  * Creates the form to perform the current workflow-step
  *
  * @return string
  * @permissions view
  */
 protected function actionShowUi()
 {
     $strReturn = "";
     $objWorkflow = new class_module_workflows_workflow($this->getSystemid());
     if ($objWorkflow->getIntState() != class_module_workflows_workflow::$INT_STATE_SCHEDULED || !$objWorkflow->getObjWorkflowHandler()->providesUserInterface()) {
         return $this->getLang("commons_error_permissions");
     }
     $arrIdsToCheck = array_merge(array($this->objSession->getUserID()), $this->objSession->getGroupIdsAsArray());
     $arrIdsOfTask = explode(",", $objWorkflow->getStrResponsible());
     //ui given? current user responsible?
     //magic: the difference of the tasks' ids and the users' ids should be less than the count of the task-ids - then at least one id matches
     if ($objWorkflow->getObjWorkflowHandler()->providesUserInterface() && ($objWorkflow->getStrResponsible() == "" || count(array_diff($arrIdsOfTask, $arrIdsToCheck)) < count($arrIdsOfTask))) {
         $strCreator = "";
         if (validateSystemid($objWorkflow->getStrOwner())) {
             $objUser = new class_module_user_user($objWorkflow->getStrOwner(), false);
             $strCreator .= $objUser->getStrUsername();
         }
         $strInfo = $this->objToolkit->getTextRow($this->getLang("workflow_owner") . " " . $strCreator);
         $strResponsible = "";
         foreach (explode(",", $objWorkflow->getStrResponsible()) as $strOneId) {
             if (validateSystemid($strOneId)) {
                 if ($strResponsible != "") {
                     $strResponsible .= ", ";
                 }
                 $objUser = new class_module_user_user($strOneId, false);
                 if ($objUser->getStrUsername() != "") {
                     $strResponsible .= $objUser->getStrUsername();
                 } else {
                     $objGroup = new class_module_user_group($strOneId);
                     $strResponsible .= $objGroup->getStrName();
                 }
             }
         }
         $arrHeader = array($this->getLang("workflow_general"), "");
         $arrRow1 = array($this->getLang("workflow_owner"), $strCreator);
         $arrRow2 = array($this->getLang("workflow_responsible"), $strResponsible);
         $strReturn .= $this->objToolkit->dataTable($arrHeader, array($arrRow1, $arrRow2));
         $strForm = $objWorkflow->getObjWorkflowHandler()->getUserInterface();
         if ($strForm instanceof class_admin_formgenerator) {
             $strForm->addField(new class_formentry_hidden(null, null), "workflowid")->setStrValue($objWorkflow->getSystemid());
             $strReturn .= $strForm->renderForm(class_link::getLinkAdminHref($this->getArrModule("modul"), "saveUI"));
         } else {
             $strReturn .= $this->objToolkit->formHeader(class_link::getLinkAdminHref($this->getArrModule("modul"), "saveUI"));
             $strReturn .= $strForm;
             $strReturn .= $this->objToolkit->formInputHidden("systemid", $objWorkflow->getSystemid());
             $strReturn .= $this->objToolkit->formInputSubmit($this->getLang("commons_save"));
             $strReturn .= $this->objToolkit->formClose();
         }
     } else {
         $strReturn .= $this->getLang("commons_error_permissions");
     }
     return $strReturn;
 }