$isCurrent[$key] = true;
            }
        }
        if ($lastusersequence[$key] == $usersequence[$key]) {
            $isCurrent[$key] = false;
        }
    }
}
$tpl->reset();
$tpl->setEncoding('iso-8859-1');
$tpl->set('s', 'SESSID', $sSession);
$tpl->set('s', 'SESSNAME', $sess->name);
$iIDCat = 0;
$iIDTpl = 0;
if ($perm->have_perm_area_action($area, "workflow_task_user_select")) {
    $form = new UI_Form("showusers", $sess->url("main.php?area={$area}&frame={$frame}"));
    $form->setVar("area", $area);
    $form->setEvent("submit", "setUsershow();");
    $form->setVar("frame", $frame);
    $form->setVar("action", "workflow_task_user_select");
    $form->add("select", i18n("Show users") . ": " . getUsers("show", $usershow));
    $form->add("button", '<input style="vertical-align:middle;" type="image" src="' . $cfg["path"]["htmlpath"] . $cfg["path"]["images"] . "submit.gif" . '">');
    $tpl->set('s', 'USERSELECT', $form->render(true));
} else {
    $tpl->set('s', 'USERSELECT', '');
}
$pageTitle = i18n('Search results') . ' - ' . i18n('Workflow tasks', 'workflow');
$tpl->set('s', 'PAGE_TITLE', $pageTitle);
$tpl->set('s', 'TH_START', i18n("Article"));
$tpl->set('s', 'TH_TEMPLATE', i18n("Template"));
$tpl->set('s', 'TH_ACTIONS', i18n("Actions"));
function piworkflowRenderColumn($idcat, $idart, $idartlang, $column)
{
    global $area, $frame, $idtpl, $cfg, $alttitle, $tmp_articletitle;
    $defaultidworkflow = getWorkflowForCat($idcat);
    $idusersequence = getCurrentUserSequence($idartlang, $defaultidworkflow);
    $associatedUserSequence = new WorkflowUserSequence();
    $associatedUserSequence->loadByPrimaryKey($idusersequence);
    $currentEditor = $associatedUserSequence->get("iduser");
    $workflowItem = $associatedUserSequence->getWorkflowItem();
    if (isCurrentEditor($associatedUserSequence->get("iduser"))) {
        $wfRights = $workflowItem->getStepRights();
        $mayEdit = true;
    } else {
        $wfRights = "";
        $mayEdit = false;
    }
    switch ($column) {
        case "wftitle":
            if ($wfRights["articleedit"] == true) {
                $mtitle = $tmp_articletitle;
            } else {
                $mtitle = strip_tags($tmp_articletitle);
            }
            return $mtitle;
        case "wfstep":
            if ($workflowItem === false) {
                return "nobody";
            }
            return $workflowItem->get("position") . ".) " . $workflowItem->get("name");
        case "wfeditor":
            $sEditor = getGroupOrUserName($currentEditor);
            if (!$sEditor) {
                $sEditor = "nobody";
            }
            return $sEditor;
        case "wfaction":
            $defaultidworkflow = getWorkflowForCat($idcat);
            $idusersequence = getCurrentUserSequence($idartlang, $defaultidworkflow);
            $sActionSelect = getActionSelect($idartlang, $idusersequence);
            if (!$sActionSelect) {
                $mayEdit = false;
            }
            $form = new UI_Form("wfaction" . $idartlang, "main.php", "get");
            $form->setVar("area", $area);
            $form->setVar("action", "workflow_do_action");
            $form->setVar("frame", $frame);
            $form->setVar("idcat", $idcat);
            $form->setVar("modidartlang", $idartlang);
            $form->setVar("idtpl", $idtpl);
            $form->add("select", '<table cellspacing="0" border="0"><tr><td>' . $sActionSelect . '</td><td>');
            $form->add("button", '<input type="image" src="' . $cfg["path"]["htmlpath"] . $cfg["path"]["images"] . "submit.gif" . '"></tr></table>');
            if ($mayEdit == true) {
                return $form->render(true);
            } else {
                return '--- ' . i18n("None") . ' ---';
            }
        case "wflaststatus":
            $sStatus = getLastWorkflowStatus($idartlang);
            if (!$sStatus) {
                $sStatus = '--- ' . i18n("None") . ' ---';
            }
            return $sStatus;
    }
}
Esempio n. 3
0
 public static function getInvitationForm($repositoryID)
 {
     $form = new UI_Form(URL::toDashboard(), false);
     $form->addContent(new UI_Form_StaticText('', 'This project is private &mdash; only people who have been invited by the project owners are allowed contribute.'));
     $form->addContent(new UI_Form_StaticText('', 'Just click the button below to request an invitation for this project.'));
     $form->addContent(new UI_Form_StaticText('', 'You will be able to check the current state of your request on your dashboard anytime.'));
     $form->addContent(new UI_Form_StaticText('', 'As soon as the project owners accept your request, you will be able to submit translations to this project.'));
     $form->addContent(new UI_Form_Hidden('requestInvitation[repositoryID]', URL::encodeID($repositoryID)));
     $buttonSubmit = new UI_Form_Button('Request an invitation', UI_Link::TYPE_SUCCESS);
     $buttonCancel = new UI_Link('Cancel', URL::toDashboard(), UI_Link::TYPE_UNIMPORTANT);
     $buttons = new UI_Form_ButtonGroup(array($buttonSubmit, $buttonCancel));
     $form->addContent($buttons);
     return $form;
 }