diff --git a/config/siteMap.inc b/config/siteMap.inc
index 7686efa..bccce15 100644
--- a/config/siteMap.inc
+++ b/config/siteMap.inc
@@ -107,8 +107,8 @@ $default->siteMap->addPage("orgManagement", "/presentation/lookAndFeel/knowledge
$default->siteMap->addPage("doctype", "presentation/lookAndFeel/knowledgeTree/administration/doctypemanagement/documentTypes.php", "Administration", SysAdmin, _("Document Type Management"), true, 5);
$default->siteMap->addPage("docfield", "/presentation/lookAndFeel/knowledgeTree/administration/admin.php/documents/fieldmanagement", "Administration", SysAdmin, _("Document Field Management"), true, 6);
-$default->siteMap->addPage("archivedDocuments", "/presentation/lookAndFeel/knowledgeTree/administration/documentmanagement/manageArchivedDocumentsBL.php", "Administration", UnitAdmin, _("Restore Archived Documents"), true, 7);
-$default->siteMap->addPage("deletedDocuments", "/presentation/lookAndFeel/knowledgeTree/administration/documentmanagement/listDeletedDocumentsBL.php", "Administration", UnitAdmin, _("Deleted Documents"), true, 8);
+$default->siteMap->addPage("archivedDocuments", "/presentation/lookAndFeel/knowledgeTree/administration/admin.php/storage/archived", "Administration", UnitAdmin, _("Restore Archived Documents"), true, 7);
+$default->siteMap->addPage("deletedDocuments", "/presentation/lookAndFeel/knowledgeTree/administration/admin.php/storage/expunge", "Administration", UnitAdmin, _("Deleted Documents"), true, 8);
$default->siteMap->addPage("doccheckoutManagement", "/presentation/lookAndFeel/knowledgeTree/administration/doccheckoutmanagement/listDocumentsBL.php", "Administration", UnitAdmin, _("Document Checkout Management"), true, 9);
$default->siteMap->addPage("newsManagement", "/presentation/lookAndFeel/knowledgeTree/administration/news/listNewsBL.php", "Administration", SysAdmin, _("Dashboard News Management"), true, 10);
@@ -127,7 +127,7 @@ $default->siteMap->addPage("manageHelp", "/presentation/lookAndFeel/knowledgeTre
$default->siteMap->addPage("managePermissions", "/presentation/lookAndFeel/knowledgeTree/administration/permissions/managePermissions.php", "Administration", SysAdmin, _("Permissions Administration"), true, 18);
$default->siteMap->addPage("manageLookupTrees", "/presentation/lookAndFeel/knowledgeTree/administration/docfieldmanagement/manageLookupTrees.php", "Administration", SysAdmin, _("Lookup Tree Administration"), true, 19);
-$default->siteMap->addPage("manageWorkflows", "/presentation/lookAndFeel/knowledgeTree/administration/workflow/workflows.php", "Administration", SysAdmin, _("Workflow Management"), true, 20);
+$default->siteMap->addPage("manageWorkflows", "/presentation/lookAndFeel/knowledgeTree/administration/admin.php/documents/workflows", "Administration", SysAdmin, _("Workflow Management"), true, 20);
$default->siteMap->addPage("manageCleanup", "/presentation/lookAndFeel/knowledgeTree/administration/documentmanagement/manageCleanup.php", "Administration", SysAdmin, _("Repository Cleanup"), true, 21);
$default->siteMap->addPage("manageSavedSearches", "/presentation/lookAndFeel/knowledgeTree/administration/searches/savedSearch.php", "Administration", SysAdmin, _("Saved Searches"), true, 22);
$default->siteMap->addPage("manageDocumentConditions", "/presentation/lookAndFeel/knowledgeTree/administration/searches/conditions.php", "Administration", SysAdmin, _("Document Conditions"), true, 23);
diff --git a/lib/actions/portletregistry.inc.php b/lib/actions/portletregistry.inc.php
index fd3aae9..5d2894c 100644
--- a/lib/actions/portletregistry.inc.php
+++ b/lib/actions/portletregistry.inc.php
@@ -11,7 +11,7 @@ class KTPortletRegistry {
}
// }}}
- function registerPortlet($action, $name, $nsname, $path = "", $sPlugin) {
+ function registerPortlet($action, $name, $nsname, $path = "", $sPlugin = "") {
if (!is_array($action)) {
$action = array($action);
}
diff --git a/lib/browse/BrowseColumns.inc.php b/lib/browse/BrowseColumns.inc.php
index da0dd01..d9fd176 100644
--- a/lib/browse/BrowseColumns.inc.php
+++ b/lib/browse/BrowseColumns.inc.php
@@ -180,7 +180,7 @@ class SelectionColumn extends BrowseColumn {
function renderHeader($sReturnURL) {
// FIXME clean up access to oPage.
global $main;
- $main->requireJSResource("/resources/js/toggleselect.js");
+ $main->requireJSResource("resources/js/toggleselect.js");
return ' ';
diff --git a/lib/dispatcher.inc.php b/lib/dispatcher.inc.php
index 990e3ae..96298d2 100644
--- a/lib/dispatcher.inc.php
+++ b/lib/dispatcher.inc.php
@@ -118,7 +118,7 @@ class KTStandardDispatcher extends KTDispatcher {
function KTStandardDispatcher() {
global $main;
- $this->oPage = $main;
+ $this->oPage =& $main;
parent::KTDispatcher();
}
diff --git a/lib/widgets/FieldsetDisplayRegistry.inc.php b/lib/widgets/FieldsetDisplayRegistry.inc.php
index fbb1bda..2a27aac 100644
--- a/lib/widgets/FieldsetDisplayRegistry.inc.php
+++ b/lib/widgets/FieldsetDisplayRegistry.inc.php
@@ -1,5 +1,7 @@
fieldset_types)) {
- return 'SimpleFieldsetDisplay';
+ // unfortunately, we need to do a bit more spelunking here.
+ // if its conditional, we use a different item. ns is unsufficient.
+ //
+ // FIXME this is slightly wasteful from a performance POV, though DB caching should make it OK.
+ $oFieldset =& KTFieldset::getByNamespace ($nsname);
+ if ($oFieldset->getIsConditional()) {
+ return 'ConditionalFieldsetDisplay';
+ } else {
+ return 'SimpleFieldsetDisplay';
+ }
} else {
return $this->fieldset_types[$nsname];
}
diff --git a/lib/widgets/fieldWidgets.php b/lib/widgets/fieldWidgets.php
index 3c15301..19ad7aa 100644
--- a/lib/widgets/fieldWidgets.php
+++ b/lib/widgets/fieldWidgets.php
@@ -81,8 +81,9 @@ class KTStaticTextWidget extends KTBaseWidget { var $sTemplate = "kt3/fields/sta
/* lookup widget */
// EXPECTS $aOptions["vocab"] => key, item
class KTLookupWidget extends KTBaseWidget { var $sTemplate = "kt3/fields/lookup"; }
+// EXPECTS $aOptions["tree"] => inner widget.
+class KTTreeWidget extends KTBaseWidget { var $sTemplate = "kt3/fields/tree"; }
-// TODO KTTreeWidget
// TODO KTTransferWidget
// TODO KTDateWidget
// TODO KTDateRangeWidget
diff --git a/lib/widgets/fieldsetDisplay.inc.php b/lib/widgets/fieldsetDisplay.inc.php
index dc65a84..8641735 100644
--- a/lib/widgets/fieldsetDisplay.inc.php
+++ b/lib/widgets/fieldsetDisplay.inc.php
@@ -16,6 +16,8 @@
require_once(KT_LIB_DIR . "/templating/templating.inc.php");
require_once(KT_LIB_DIR . "/database/dbutil.inc");
+require_once(KT_LIB_DIR . "/documentmanagement/MDTree.inc"); // :(
+
// data acquisition
@@ -26,7 +28,7 @@ require_once(KT_LIB_DIR . "/widgets/fieldWidgets.php");
/* it may be useful to move this to a factory, eventually? */
-function getWidgetForMetadataField($field, $current_value, $page, $errors = null) {
+function getWidgetForMetadataField($field, $current_value, $page, $errors = null, $vocab = null) {
// all fields have these elements.
$fieldLabel = $field->getName();
$fieldDescription = 'FIXME we don\'t handle descriptions for fields, yet.';
@@ -49,13 +51,30 @@ function getWidgetForMetadataField($field, $current_value, $page, $errors = null
if ($field->getHasLookup()) {
// could either be normal, or a tree.
// ignore trees (for now).
- if (true) {
+ if (!$field->getHasLookupTree()) {
+ // FIXME we need to somehow handle both value-value and id-value here
// extract the lookup.
- $lookups = MetaData::getEnabledValuesByDocumentField($field);
- //var_dump($lookups);
-
- $fieldOptions["vocab"] = array(); // FIXME handle lookups
- $oField = new KTLookupWidget($fieldLabel, $fieldDescription, $fieldName, $fieldValue, $page, $fieldRequired, null, $fieldErrors, $fieldOptions);
+ if ($vocab === null) { // allow override
+ $lookups = MetaData::getEnabledValuesByDocumentField($field);
+ $fieldOptions["vocab"] = array(); // FIXME handle lookups
+ foreach ($lookups as $md) {
+ $fieldOptions["vocab"][$md->getName()] = $md->getName();
+ }
+ } else {
+ $fieldOptions["vocab"] = $vocab;
+ }
+
+ $oField = new KTLookupWidget($fieldLabel, $fieldDescription, $fieldName, $fieldValue, $page, $fieldRequired, null, $fieldErrors, $fieldOptions);
+ } else {
+ // FIXME vocab's are _not_ supported for tree-inputs. this means conditional-tree-widgets are not unsupported.
+
+ // for trees, we are currently brutal.
+ $fieldTree = new MDTree();
+ $fieldTree->buildForField($field->getId());
+ $fieldTree->setActiveItem($current_value);
+ $fieldOptions['tree'] = $fieldTree->_evilTreeRenderer($fieldTree, $fieldName);
+
+ $oField = new KTTreeWidget($fieldLabel, $fieldDescription, $fieldName, $fieldValue, $page, $fieldRequired, null, $fieldErrors, $fieldOptions);
}
} else {
$oField = new KTBaseWidget($fieldLabel, $fieldDescription, $fieldName, $fieldValue, $page, $fieldRequired, null, $fieldErrors, $fieldOptions);
@@ -356,4 +375,63 @@ class SimpleFieldsetDisplay extends KTFieldsetDisplay {
}
+
+// Handle the conditional case.
+class ConditionalFieldsetDisplay extends SimpleFieldsetDisplay {
+
+ function renderEdit($document_data) {
+ global $main; // FIXME remove direct access to $main
+ $oPage =& $main;
+
+ // FIXME do this from inside the widgetry mojo.
+ $oPage->requireCSSResource('resources/css/kt-treewidget.css');
+
+ // FIXME this currently doesn't work, since we use NBM's half-baked Ajax on add/bulk ;)
+ $oPage->requireJSResource('presentation/lookAndFeel/knowledgeTree/js/taillog.js');
+ $oPage->requireJSResource('presentation/lookAndFeel/knowledgeTree/js/conditional_usage.js');
+
+ $aFields = array();
+ $fields =& $this->fieldset->getFields();
+ $values = array();
+
+ $have_values = false;
+ foreach ($fields as $oField) {
+ $val = KTUtil::arrayGet($document_data["field_values"], $oField->getId(), null);
+ if ($val !== null) {
+ $have_values = true;
+
+ }
+
+ $values[$oField->getId()] = $val;
+ }
+ // FIXME handle the editable case _with_ values.
+
+ if ($have_values) {
+
+ return '
Do not yet know how to edit conditional fieldsets with values.
';
+ } // else {
+
+ // now, we need to do some extra work on conditional widgets.
+ // how?
+
+ $fieldset_name = $this->fieldset->getName();
+ $fieldset_description = "The information in this section is part of the " . $fieldset_name . " of the document. Note that the options which are available depends on previous choices within this fieldset.";
+
+ //
+
+ $oTemplating = new KTTemplating;
+ $oTemplate = $oTemplating->loadTemplate("kt3/fieldsets/conditional_editable");
+ $aTemplateData = array(
+ "context" => $this,
+ "field" => $oField, // first field, widget.
+ 'fieldset_id' => $this->fieldset->getId(),
+ "title" => $fieldset_name,
+ "description" => $fieldset_description,
+ );
+
+ return $oTemplate->render($aTemplateData);
+ }
+
+}
+
?>
diff --git a/plugins/ktcore/KTAdminPlugins.php b/plugins/ktcore/KTAdminPlugins.php
index 2c89c3a..6d24192 100644
--- a/plugins/ktcore/KTAdminPlugins.php
+++ b/plugins/ktcore/KTAdminPlugins.php
@@ -40,12 +40,16 @@ $oAdminRegistry->registerLocation("roles",'RoleAdminDispatcher',"security", "Rol
$oAdminRegistry->registerLocation("typemanagement",'KTDocumentTypeDispatcher','documents', 'Document Types','Manage the different classes of document which can be added to the system.', KT_DIR . '/presentation/lookAndFeel/knowledgeTree/administration/doctypemanagement/documentTypes.php', null);
$oAdminRegistry->registerLocation("fieldmanagement",'KTDocumentFieldDispatcher','documents', 'Document Fieldsets','Control which kinds of documents have which sets of information associated with them.', KT_DIR . '/presentation/lookAndFeel/knowledgeTree/administration/docfieldmanagement/documentFields.php', null);
$oAdminRegistry->registerLocation("linkmanagement",'KTDocLinkAdminDispatcher','documents', 'Link Type Management','Specify the different "link types" - ways to relate different documents togeter.', KT_DIR . '/presentation/lookAndFeel/knowledgeTree/administration/doclinkmanagement/documentLinks.php', null);
-
+$oAdminRegistry->registerLocation("workflows",'KTWorkflowDispatcher','documents', 'Workflows','Configure the process documents go through..', KT_DIR . '/presentation/lookAndFeel/knowledgeTree/administration/workflow/workflows.php', null);
// storage
$oAdminRegistry->registerLocation("checkout",'KTCheckoutAdminDispatcher','storage', 'Checked Out Document Control','Override the checked-out status of documents if a user has failed to do so.', KT_DIR . '/presentation/lookAndFeel/knowledgeTree/administration/doccheckoutmanagement/documentCheckout.php', null);
+$oAdminRegistry->registerLocation("archived",'ArchivedDocumentsDispatcher','storage', 'Archived Document Restoration','Restore old (archived) documents, usually at a user\'s request.', KT_DIR . '/presentation/lookAndFeel/knowledgeTree/administration/documentmanagement/archivedDocuments.php', null);
+$oAdminRegistry->registerLocation("expunge",'DeletedDocumentsDispatcher','storage', 'Expunge Deleted Documents','Permanently expunge deleted documents.', KT_DIR . '/presentation/lookAndFeel/knowledgeTree/administration/documentmanagement/deletedDocuments.php', null);
+// misc
$oAdminRegistry->registerLocation("helpmanagement",'ManageHelpDispatcher','misc', 'Edit Help files','Change the help files that are displayed to users.', KT_DIR . '/presentation/lookAndFeel/knowledgeTree/administration/help/manageHelp.php', null);
+
?>
diff --git a/plugins/ktcore/KTFolderActions.php b/plugins/ktcore/KTFolderActions.php
index fd3c820..324ffad 100644
--- a/plugins/ktcore/KTFolderActions.php
+++ b/plugins/ktcore/KTFolderActions.php
@@ -21,11 +21,14 @@ class KTFolderAddDocumentAction extends KTFolderAction {
function do_main() {
$this->oPage->setBreadcrumbDetails("add document");
+ $this->oPage->setTitle('Add a document');
$oTemplate =& $this->oValidator->validateTemplate('ktcore/document/add');
$add_fields = array();
$add_fields[] = new KTFileUploadWidget('File', 'The contents of the document to be added to the document management system.', 'file', "", $this->oPage, true);
$add_fields[] = new KTStringWidget('Title', 'Describe the changes made to the document.', 'title', "", $this->oPage, true);
-
+
+
+
$aVocab = array();
foreach (DocumentType::getList() as $oDocumentType) {
$aVocab[$oDocumentType->getId()] = $oDocumentType->getName();
diff --git a/presentation/lookAndFeel/knowledgeTree/administration/documentmanagement/archivedDocuments.php b/presentation/lookAndFeel/knowledgeTree/administration/documentmanagement/archivedDocuments.php
new file mode 100644
index 0000000..11294e7
--- /dev/null
+++ b/presentation/lookAndFeel/knowledgeTree/administration/documentmanagement/archivedDocuments.php
@@ -0,0 +1,106 @@
+ 'administration', 'name' => 'Administration'),
+ );
+
+ function do_main () {
+ $this->aBreadcrumbs[] = array('action' => 'archivedDocuments', 'name' => 'Archived Documents');
+
+ $this->oPage->setBreadcrumbDetails('list');
+
+ $aDocuments =& Document::getList("status_id=" . ARCHIVED);
+
+
+ $oTemplating =& KTTemplating::getSingleton();
+ $oTemplate = $oTemplating->loadTemplate('ktcore/document/admin/archivedlist');
+ $oTemplate->setData(array(
+ 'context' => $this,
+ 'documents' => $aDocuments,
+ ));
+ return $oTemplate;
+ }
+
+ function do_confirm_restore() {
+ $this->aBreadcrumbs[] = array('action' => 'archivedDocuments', 'name' => 'Archived Documents');
+
+ $selected_docs = KTUtil::arrayGet($_REQUEST, 'selected_docs', array());
+
+ $this->oPage->setTitle('Confirm Restore of ' . count($selected_docs) . ' documents');
+
+ $this->oPage->setBreadcrumbDetails('confirm restore of ' . count($selected_docs) . ' documents');
+
+ $aDocuments = array();
+ foreach ($selected_docs as $doc_id) {
+ $oDoc =& Document::get($doc_id);
+ if (PEAR::isError($oDoc) || ($oDoc === false)) {
+ $this->errorRedirectToMain('Invalid document id specified. Aborting restore.');
+ } else if ($oDoc->getStatusId() != ARCHIVED) {
+ $this->errorRedirectToMain($oDoc->getName() . ' is not an archived document. Aborting restore.');
+ }
+ $aDocuments[] = $oDoc;
+ }
+
+
+ $oTemplating =& KTTemplating::getSingleton();
+ $oTemplate = $oTemplating->loadTemplate('ktcore/document/admin/dearchiveconfirmlist');
+ $oTemplate->setData(array(
+ 'context' => $this,
+ 'documents' => $aDocuments,
+ ));
+ return $oTemplate;
+ }
+
+ function do_finish_restore() {
+
+
+ $selected_docs = KTUtil::arrayGet($_REQUEST, 'selected_docs', array());
+
+ $aDocuments = array();
+ foreach ($selected_docs as $doc_id) {
+ $oDoc =& Document::get($doc_id);
+ if (PEAR::isError($oDoc) || ($oDoc === false)) {
+ $this->errorRedirectToMain('Invalid document id specified. Aborting restore.');
+ } else if ($oDoc->getStatusId() != ARCHIVED) {
+ $this->errorRedirectToMain($oDoc->getName() . ' is not an archived document. Aborting restore.');
+ }
+ $aDocuments[] = $oDoc;
+ }
+
+ $this->startTransaction();
+
+ foreach ($aDocuments as $oDoc) {
+ // FIXME find de-archival source.
+ // FIXME purge old notifications.
+ // FIXME create de-archival notices to those who sent in old notifications.
+ $oDoc->setStatusId(LIVE);
+ $res = $oDoc->update();
+ if (PEAR::isError($res) || ($res == false)) {
+ $this->errorRedirectToMain($oDoc->getName . ' could not be made "live".');
+ }
+ }
+ $this->commitTransaction();
+ $msg = count($aDocuments) . ' documents made active.';
+ $this->successRedirectToMain($msg);
+ }
+}
+
+//$d =& new DeletedDocumentsDispatcher;
+//$d->dispatch();
+
+?>
diff --git a/presentation/lookAndFeel/knowledgeTree/administration/documentmanagement/deletedDocuments.php b/presentation/lookAndFeel/knowledgeTree/administration/documentmanagement/deletedDocuments.php
new file mode 100644
index 0000000..e7e9a8c
--- /dev/null
+++ b/presentation/lookAndFeel/knowledgeTree/administration/documentmanagement/deletedDocuments.php
@@ -0,0 +1,114 @@
+ 'administration', 'name' => 'Administration'),
+ );
+
+ function do_main () {
+ $this->aBreadcrumbs[] = array('action' => 'deletedDocuments', 'name' => 'Deleted Documents');
+
+ $this->oPage->setBreadcrumbDetails('view');
+
+ $aDocuments =& Document::getList("status_id=" . DELETED);
+
+
+ $oTemplating =& KTTemplating::getSingleton();
+ $oTemplate = $oTemplating->loadTemplate('ktcore/document/admin/deletedlist');
+ $oTemplate->setData(array(
+ 'context' => $this,
+ 'documents' => $aDocuments,
+ ));
+ return $oTemplate;
+ }
+
+ function do_confirm_expunge() {
+ $this->aBreadcrumbs[] = array('action' => 'deletedDocuments', 'name' => 'Deleted Documents');
+
+ $selected_docs = KTUtil::arrayGet($_REQUEST, 'selected_docs', array());
+
+ $this->oPage->setTitle('Confirm Expunge of ' . count($selected_docs) . ' documents');
+
+ $this->oPage->setBreadcrumbDetails('confirm expunge of ' . count($selected_docs) . ' documents');
+
+ $aDocuments = array();
+ foreach ($selected_docs as $doc_id) {
+ $oDoc =& Document::get($doc_id);
+ if (PEAR::isError($oDoc) || ($oDoc === false)) {
+ $this->errorRedirectToMain('Invalid document id specified. Aborting expunge');
+ } else if ($oDoc->getStatusId() != DELETED) {
+ $this->errorRedirectToMain($oDoc->getName() . ' is not a deleted document. Aborting expunge');
+ }
+ $aDocuments[] = $oDoc;
+ }
+
+
+ $oTemplating =& KTTemplating::getSingleton();
+ $oTemplate = $oTemplating->loadTemplate('ktcore/document/admin/expungeconfirmlist');
+ $oTemplate->setData(array(
+ 'context' => $this,
+ 'documents' => $aDocuments,
+ ));
+ return $oTemplate;
+ }
+
+ function do_finish_expunge() {
+
+
+ $selected_docs = KTUtil::arrayGet($_REQUEST, 'selected_docs', array());
+
+ $aDocuments = array();
+ foreach ($selected_docs as $doc_id) {
+ $oDoc =& Document::get($doc_id);
+ if (PEAR::isError($oDoc) || ($oDoc === false)) {
+ $this->errorRedirectToMain('Invalid document id specified. Aborting expunge');
+ } else if ($oDoc->getStatusId() != DELETED) {
+ $this->errorRedirectToMain($oDoc->getName() . ' is not a deleted document. Aborting expunge');
+ }
+ $aDocuments[] = $oDoc;
+ }
+
+ $this->startTransaction();
+ $aErrorDocuments = array();
+ $aSuccessDocuments = array();
+
+ foreach ($aDocuments as $oDoc) {
+ if (!PhysicalDocumentManager::expunge($oDoc)) { $aErrorDocuments[] = $oDoc->getDisplayPath(); }
+ else {
+ $oDocumentTransaction = & new DocumentTransaction($oDoc->getId(), "Document expunged", EXPUNGE);
+ $oDocumentTransaction->create();
+
+ // delete this from the db now
+ if (!$oDoc->delete()) { $aErrorDocuments[] = $oDoc->getId(); }
+ else {
+ // removed succesfully
+ $aSuccessDocuments[] = $oDoc->getDisplayPath();
+
+ // remove any document data
+ $oDoc->cleanupDocumentData($oDoc->getId()); // silly - why the redundancy?
+ }
+ }
+ }
+ $this->commitTransaction();
+ $msg = count($aSuccessDocuments) . ' documents expunged.';
+ if (count($aErrorDocuments) != 0) { $msg .= 'Failed to expunge: ' . join(', ', $aErrorDocuments); }
+ $this->successRedirectToMain($msg);
+ }
+}
+
+//$d =& new DeletedDocumentsDispatcher;
+//$d->dispatch();
+
+?>
diff --git a/presentation/lookAndFeel/knowledgeTree/administration/workflow/workflows.php b/presentation/lookAndFeel/knowledgeTree/administration/workflow/workflows.php
index d86f9c0..8dfcead 100644
--- a/presentation/lookAndFeel/knowledgeTree/administration/workflow/workflows.php
+++ b/presentation/lookAndFeel/knowledgeTree/administration/workflow/workflows.php
@@ -1,6 +1,6 @@
aBreadcrumbs[] = array(
+ 'action' => 'manageWorkflows',
+ 'name' => 'Workflows',
+ );
+
+ $add_fields = array();
+ $add_fields[] = new KTStringWidget('Name','A human-readable name for the workflow.', 'fName', null, $this->oPage, true);
+
$oTemplating =& KTTemplating::getSingleton();
$oTemplate =& $oTemplating->loadTemplate('ktcore/workflow/listWorkflows');
$oTemplate->setData(array(
+ 'context' => $this,
'aWorkflow' => KTWorkflow::getList(),
+ 'add_fields' => $add_fields,
));
return $oTemplate;
}
@@ -39,20 +50,66 @@ class KTWorkflowDispatcher extends KTStandardDispatcher {
// {{{ do_editWorkflow
function do_editWorkflow() {
+
$oTemplate =& $this->oValidator->validateTemplate('ktcore/workflow/editWorkflow');
$oWorkflow =& $this->oValidator->validateWorkflow($_REQUEST['fWorkflowId']);
+
+ $aStates = KTWorkflowState::getByWorkflow($oWorkflow);
+ $aPermissions = KTPermission::getList();
+
+ $edit_fields = array();
+ $edit_fields[] = new KTStringWidget('Name','A human-readable name for the workflow.', 'fName', $oWorkflow->getName(), $this->oPage, true);
+ $aOptions = array();
+ $vocab = array();
+ $vocab[0] = 'None';
+ foreach($aStates as $state) {
+ $vocab[$state->getId()] = $state->getName();
+ }
+ $aOptions['vocab'] = $vocab;
+ $edit_fields[] = new KTLookupWidget('Starting State','When a document has this workflow applied to it, to which state should it initially be set ', 'fStartingStateId', $oWorkflow->getStartStateId(), $this->oPage, false, null, null, $aOptions);
+
+ $add_state_fields = array();
+ $add_state_fields[] = new KTStringWidget('Name','A human-readable name for the state.', 'fName', null, $this->oPage, true);
+
+
+ $add_transition_fields = array();
+ $add_transition_fields[] = new KTStringWidget('Name','A human-readable name for the state.', 'fName', null, $this->oPage, true);
+ $aOptions = array();
+ $vocab = array();
+ foreach($aStates as $state) {
+ $vocab[$state->getId()] = $state->getName();
+ }
+ $aOptions['vocab'] = $vocab;
+ $add_transition_fields[] = new KTLookupWidget('Destination State','Once this transition is complete, which state should the document be in?', 'fTargetStateId', $oWorkflow->getStartStateId(), $this->oPage, true, null, null, $aOptions);
+ $aOptions = array();
+ $vocab = array();
+ foreach($aPermissions as $permission) {
+ $vocab[$permission->getId()] = $permission->getHumanName();
+ }
+ $aOptions['vocab'] = $vocab;
+ $add_transition_fields[] = new KTLookupWidget('Guard Permission.','Which permission must the user have in order to follow this transition?', 'fPermissionId', $oWorkflow->getStartStateId(), $this->oPage, true, null, null, $aOptions);
+
+ $this->aBreadcrumbs[] = array(
+ 'action' => 'manageWorkflows',
+ 'name' => 'Workflows',
+ );
$this->aBreadcrumbs[] = array(
'action' => 'manageWorkflows',
'query' => 'action=editWorkflow&fWorkflowId=' . $oWorkflow->getId(),
- 'name' => 'Workflow ' . $oWorkflow->getName(),
+ 'name' => $oWorkflow->getName(),
);
$oTemplate->setData(array(
'oWorkflow' => $oWorkflow,
- 'aStates' => KTWorkflowState::getByWorkflow($oWorkflow),
+ 'aStates' => $aStates,
'aTransitions' => KTWorkflowTransition::getByWorkflow($oWorkflow),
- 'aPermissions' => KTPermission::getList(),
+ 'aPermissions' => $aPermissions,
'aActions' => KTDocumentActionUtil::getAllDocumentActions(),
'aActionsSelected' => KTWorkflowUtil::getControlledActionsForWorkflow($oWorkflow),
+
+ // fields
+ 'edit_fields' => $edit_fields,
+ 'add_state_fields' => $add_state_fields,
+ 'add_transition_fields' => $add_transition_fields,
));
return $oTemplate;
}
@@ -150,14 +207,15 @@ class KTWorkflowDispatcher extends KTStandardDispatcher {
$aTransitionsSelected = KTWorkflowUtil::getTransitionsFrom($oState, array('ids' => true));
$this->aBreadcrumbs[] = array(
'action' => 'manageWorkflows',
- 'query' => 'action=editWorkflow&fWorkflowId=' . $oWorkflow->getId(),
- 'name' => 'Workflow ' . $oWorkflow->getName(),
+ 'name' => 'Workflows',
);
$this->aBreadcrumbs[] = array(
'action' => 'manageWorkflows',
- 'query' => 'action=editState&fWorkflowId=' . $oWorkflow->getId() . '&fStateId=' . $oState->getId(),
- 'name' => 'State ' . $oState->getName(),
+ 'query' => 'action=editWorkflow&fWorkflowId=' . $oWorkflow->getId(),
+ 'name' => $oWorkflow->getName(),
);
+ $this->oPage->setBreadcrumbDetails('state: ' . $oState->getName());
+
$aInformed = KTWorkflowUtil::getInformedForState($oState);
$oTemplate->setData(array(
'oWorkflow' => $oWorkflow,
@@ -301,24 +359,84 @@ class KTWorkflowDispatcher extends KTStandardDispatcher {
$oTemplate =& $this->oValidator->validateTemplate('ktcore/workflow/editTransition');
$oWorkflow =& $this->oValidator->validateWorkflow($_REQUEST['fWorkflowId']);
$oTransition =& $this->oValidator->validateWorkflowTransition($_REQUEST['fTransitionId']);
+
+ $aStates = KTWorkflowState::getByWorkflow($oWorkflow);
+ $aPermissions = KTPermission::getList();
+ $aGroups = Group::getList();
+ $aRoles = Role::getList();
+ $aConditions = KTSavedSearch::getConditions();
+
+ $edit_fields = array();
+ $edit_fields[] = new KTStringWidget('Name','A human-readable name for the state.', 'fName', $oTransition->getName(), $this->oPage, true);
+ $aOptions = array();
+ $vocab = array();
+ foreach($aStates as $state) {
+ $vocab[$state->getId()] = $state->getName();
+ }
+ $aOptions['vocab'] = $vocab;
+ $edit_fields[] = new KTLookupWidget('Destination State','Once this transition is complete, which state should the document be in?', 'fTargetStateId', $oTransition->getTargetStateId(), $this->oPage, true, null, null, $aOptions);
+ $aOptions = array();
+ $vocab = array();
+ $vocab[0] = 'None';
+ foreach($aPermissions as $permission) {
+ $vocab[$permission->getId()] = $permission->getHumanName();
+ }
+ $aOptions['vocab'] = $vocab;
+ $edit_fields[] = new KTLookupWidget('Guard Permission.','Which permission must the user have in order to follow this transition?', 'fPermissionId', $oTransition->getGuardPermissionId(), $this->oPage, true, null, null, $aOptions);
+ $aOptions = array();
+ $vocab = array();
+ $vocab[0] = 'None';
+ foreach($aGroups as $group) {
+ $vocab[$group->getId()] = $group->getName();
+ }
+ $aOptions['vocab'] = $vocab;
+ $edit_fields[] = new KTLookupWidget('Guard Group.','Which group must the user belong to in order to follow this transition?', 'fGroupId', $oTransition->getGuardGroupId(), $this->oPage, false, null, null, $aOptions);
+ $aOptions = array();
+ $vocab = array();
+ $vocab[0] = 'None';
+ foreach($aRoles as $role) {
+ $vocab[$role->getId()] = $role->getName();
+ }
+ $aOptions['vocab'] = $vocab;
+ $edit_fields[] = new KTLookupWidget('Guard Role.','Which role must the user have in order to follow this transition?', 'fRoleId', $oTransition->getGuardRoleId(), $this->oPage, false, null, null, $aOptions);
+
+ if (!empty($aConditions)) {
+ $aOptions = array();
+ $vocab = array();
+ $vocab[0] = 'None';
+ foreach($aConditions as $condition) {
+ $vocab[$condition->getId()] = $condition->getName();
+ }
+ $aOptions['vocab'] = $vocab;
+ $edit_fields[] = new KTLookupWidget('Guard Condition.','Which condition (stored search) must be satisfied before the transition can take place?', 'fConditionId', $oTransition->getGuardConditionId(), $this->oPage, false, null, null, $aOptions);
+ }
+
+ $this->aBreadcrumbs[] = array(
+ 'action' => 'manageWorkflows',
+ 'name' => 'Workflows',
+ );
$this->aBreadcrumbs[] = array(
'action' => 'manageWorkflows',
'query' => 'action=editWorkflow&fWorkflowId=' . $oWorkflow->getId(),
- 'name' => 'Workflow ' . $oWorkflow->getName(),
+ 'name' => $oWorkflow->getName(),
);
$this->aBreadcrumbs[] = array(
'action' => 'manageWorkflows',
- 'query' => 'action=editTransitionfWorkflowId=' . $oWorkflow->getId() . '&fTransitionId=' . $oTransition->getId(),
- 'name' => 'Transition ' . $oTransition->getName(),
+ 'query' => 'action=editTransition&fWorkflowId=' . $oWorkflow->getId() . '&fTransitionId=' . $oTransition->getId(),
+ 'name' => $oTransition->getName(),
);
$oTemplate->setData(array(
'oWorkflow' => $oWorkflow,
'oTransition' => $oTransition,
- 'aStates' => KTWorkflowState::getByWorkflow($oWorkflow),
- 'aPermissions' => KTPermission::getList(),
- 'aGroups' => Group::getList(),
- 'aRoles' => Role::getList(),
- 'aConditions' => KTSavedSearch::getConditions(),
+ 'aStates' => $aStates,
+ 'aPermissions' => $aPermissions,
+ 'aGroups' => $aGroups,
+ 'aRoles' => $aRoles,
+ 'aConditions' => $aConditions,
+
+ // fields
+
+ 'edit_fields' => $edit_fields,
));
return $oTemplate;
}
@@ -373,7 +491,7 @@ class KTWorkflowDispatcher extends KTStandardDispatcher {
}
-$d =& new KTWorkflowDispatcher;
-$d->dispatch();
+//$d =& new KTWorkflowDispatcher;
+//$d->dispatch();
?>
diff --git a/presentation/lookAndFeel/knowledgeTree/ajaxConditional.php b/presentation/lookAndFeel/knowledgeTree/ajaxConditional.php
index 6686911..a70fe60 100644
--- a/presentation/lookAndFeel/knowledgeTree/ajaxConditional.php
+++ b/presentation/lookAndFeel/knowledgeTree/ajaxConditional.php
@@ -9,6 +9,7 @@ require_once(KT_LIB_DIR . "/util/ktutil.inc");
require_once(KT_LIB_DIR . "/dispatcher.inc.php");
$sectionName = "Administration";
require_once(KT_DIR . "/presentation/webpageTemplate.inc");
+require_once(KT_LIB_DIR . '/widgets/fieldsetDisplay.inc.php');
/*
* example code - tests the frontend behaviour. remember to check ajaxConditional.php
@@ -38,6 +39,7 @@ class AjaxConditionalDispatcher extends KTStandardDispatcher {
}
function do_updateFieldset() {
+ global $main;
$GLOBALS['default']->log->error(print_r($_REQUEST, true));
header('Content-Type: application/xml');
$oFieldset =& $this->oValidator->validateFieldset($_REQUEST['fieldset']);
@@ -45,17 +47,25 @@ class AjaxConditionalDispatcher extends KTStandardDispatcher {
$matches = array();
$aFields = array();
foreach ($_REQUEST as $k => $v) {
- if (preg_match('/^emd(\d+)$/', $k, $matches)) {
+ if (preg_match('/^metadata_(\d+)$/', $k, $matches)) {
$aValues[$matches[1]] = $v;
}
}
$aNextFieldValues =& KTMetadataUtil::getNext($oFieldset, $aValues);
-
- $oTemplate =& $this->oValidator->validateTemplate('ktcore/metadata/chooseFromMetadataLookup');
- $oTemplate->setData(array('aFieldValues' => $aNextFieldValues));
- $GLOBALS['default']->log->debug(print_r($aNextFieldValues, true));
- return $oTemplate->render();
+
+ $sWidgets = '';
+ // convert these into widgets using the ever-evil...
+ // function getWidgetForMetadataField($field, $current_value, $page, $errors = null, $vocab = null)
+ foreach ($aNextFieldValues as $aFieldInfo) {
+ $vocab = array();
+ $vocab[''] = 'Unset';
+ foreach ($aFieldInfo['values'] as $md_v) { $vocab[$md_v->getName()] = $md_v->getName(); }
+ $oWidget = getWidgetForMetadataField($aFieldInfo['field'], null, $main, null, $vocab) ;
+ $sWidgets .= $oWidget->render();
+ }
+
+ return $sWidgets;
}
}
diff --git a/presentation/lookAndFeel/knowledgeTree/js/conditional_usage.js b/presentation/lookAndFeel/knowledgeTree/js/conditional_usage.js
index d6bd3ad..9bae4a8 100644
--- a/presentation/lookAndFeel/knowledgeTree/js/conditional_usage.js
+++ b/presentation/lookAndFeel/knowledgeTree/js/conditional_usage.js
@@ -2,7 +2,7 @@
// i don't like Mochikit's one.
function getBindTarget(fieldset) {
- var possibles = getElementsByTagAndClassName('TBODY','conditional_target', fieldset);
+ var possibles = getElementsByTagAndClassName('DIV','conditional_target', fieldset);
return possibles[0];
}
@@ -130,18 +130,18 @@ function popStack(fieldset) {
function createFixedWidget(fieldset, widget, i_name, i_value, i_label) {
// bad, but there's nothing else we can do in the current design.
// we need to walk the TR for the TH (widget.tagName == TR)
- if (widget.tagName != 'TR')
+ if (widget.tagName != 'DIV')
{
// alert('Invalid widget in conditional.'+widget);
simpleLog('ERROR','invalid widget in conditional.');
return false;
}
- var header = widget.getElementsByTagName('TH')[0]; // FIXME _could_ fail if pathalogical.
+ var header = widget.getElementsByTagName('LABEL')[0]; // FIXME _could_ fail if pathalogical.
var i_friendly_name = scrapeText(header);
- var newWidget = TR({'class':'widget fixed'},
- TH(null, i_friendly_name),
- TD(null,
+ var newWidget = DIV({'class':'field fixed'},
+ createDOM('LABEL',null, i_friendly_name),
+ DIV(null,
INPUT({'type':'hidden','name':i_name, 'value':i_value,'class':'fixed'}),
SPAN(null, i_label)
)
@@ -159,7 +159,7 @@ function createFixedWidget(fieldset, widget, i_name, i_value, i_label) {
*/
function handleSelectChange(fieldset, widget, select_object) {
- simpleLog('ERROR','call to stub: handleSelectChange on select with name "'+select_object.name+'"');
+ simpleLog('DEBUG','handleSelectChange on select with name "'+select_object.name+'"');
var i_name = select_object.name;
var i_value = select_object.value;
var i_label = scrapeText(select_object.options[select_object.selectedIndex]);
@@ -300,15 +300,15 @@ function do_updateFieldset(fieldset, req) {
// clear unfixed widgets before we start.
clearUnfixedWidgets(fieldset);
// create an unparented div for HTML insertion.
- var tb = TBODY(null);
- var t = TABLE(null, tb);
+ var hold = DIV(null);
- tb.innerHTML = req.responseText;
+ hold.innerHTML = req.responseText;
- var new_widgets = getElementsByTagAndClassName('TR','widget', tb);
- simpleLog('DEBUG','new_widgets.length: ',new_widgets.length);
+ var new_widgets = getElementsByTagAndClassName('DIV','field', hold);
+
+ simpleLog('DEBUG','new_widgets.length: '+new_widgets.length);
var target = getBindTarget(fieldset);
- simpleLog('DEBUG','new_widgets.length: ',new_widgets.length);
+ simpleLog('DEBUG','new_widgets.length: '+new_widgets.length);
for (var i=0; i a.pathnode {
+ background: transparent url(/graphics/plus.png) center left no-repeat;
+ padding-left: 15px;
+}
+
+.kt_treenodes li.treenode.active > a.pathnode {
+ background: transparent url(/graphics/minus.png) center left no-repeat;
+}
+
+.kt_treenodes li.active > ul {
+ display: block;
+}
+
+.kt_treenodes li ul {
+ display: none;
+}
+
diff --git a/templates/kt3/document/edit.smarty b/templates/kt3/document/edit.smarty
index 91334b4..e46c5e2 100644
--- a/templates/kt3/document/edit.smarty
+++ b/templates/kt3/document/edit.smarty
@@ -1,3 +1,16 @@
+{$context->oPage->requireJSResource('thirdpartyjs/MochiKit/Base.js')}
+{$context->oPage->requireJSResource('thirdpartyjs/MochiKit/Async.js')}
+{$context->oPage->requireJSResource('thirdpartyjs/MochiKit/Iter.js')}
+{$context->oPage->requireJSResource('thirdpartyjs/MochiKit/DateTime.js')}
+{$context->oPage->requireJSResource('thirdpartyjs/MochiKit/DOM.js')}
+
+
+
+{$context->oPage->requireJSResource('presentation/lookAndFeel/knowledgeTree/js/taillog.js')}
+{$context->oPage->requireJSResource('presentation/lookAndFeel/knowledgeTree/js/conditional_usage.js')}
+
+{$context->oPage->requireCSSResource('resources/css/kt-treewidget.css')}
+
Editing: {$document->getName()}
FIXME : do we need assisting text here?
diff --git a/templates/kt3/fields/tree.smarty b/templates/kt3/fields/tree.smarty
new file mode 100644
index 0000000..cc02002
--- /dev/null
+++ b/templates/kt3/fields/tree.smarty
@@ -0,0 +1,16 @@
+
+
{$label}{if ($required === true)}(Required) {/if}
+
{$description}
+ {if ($has_errors)}
+ {foreach item=sError from=$errors}
+
+ {$sError}
+
+ {/foreach}
+ {else}
+
+ {/if}
+
+ {$options.tree}
+
+
\ No newline at end of file
diff --git a/templates/kt3/fieldsets/conditional_editable.smarty b/templates/kt3/fieldsets/conditional_editable.smarty
new file mode 100644
index 0000000..705ef3e
--- /dev/null
+++ b/templates/kt3/fieldsets/conditional_editable.smarty
@@ -0,0 +1,12 @@
+
+ {$title}
+
+
+ {$description}
+
+
+
+ conditional data.
+
+
+
diff --git a/templates/ktcore/document/add.smarty b/templates/ktcore/document/add.smarty
index 5e5830e..c8fca79 100644
--- a/templates/ktcore/document/add.smarty
+++ b/templates/ktcore/document/add.smarty
@@ -1,8 +1,16 @@
{$context->oPage->requireJSResource('thirdpartyjs/MochiKit/Base.js')}
{$context->oPage->requireJSResource('thirdpartyjs/MochiKit/Async.js')}
{$context->oPage->requireJSResource('thirdpartyjs/MochiKit/Iter.js')}
+{$context->oPage->requireJSResource('thirdpartyjs/MochiKit/DateTime.js')}
{$context->oPage->requireJSResource('thirdpartyjs/MochiKit/DOM.js')}
+
+
+{$context->oPage->requireJSResource('presentation/lookAndFeel/knowledgeTree/js/taillog.js')}
+{$context->oPage->requireJSResource('presentation/lookAndFeel/knowledgeTree/js/conditional_usage.js')}
+
+{$context->oPage->requireCSSResource('resources/css/kt-treewidget.css')}
+
{capture assign=sJavascript}
{literal}
function swapInItem(elementId, req) {
diff --git a/templates/ktcore/document/admin/archivedlist.smarty b/templates/ktcore/document/admin/archivedlist.smarty
new file mode 100644
index 0000000..9730fb3
--- /dev/null
+++ b/templates/ktcore/document/admin/archivedlist.smarty
@@ -0,0 +1,46 @@
+Archived Documents
+
+In order to keep the documents which are visible useful
+to end users, it is possible to archive old documents. Users who
+want to see these old documents need to request their restoration - these requests
+will typically be done within the system, and will generate a notification to you.
+
+
+FIXME this aspect of the UI is unuseable.
+KT 2.x had a full-on search here. That's probably _also_ unuseable. Ponder an
+improvement (probably notification driven / basic search driven. Even better: allow browse
+with LIVE turned off.)
+
+{if (!empty($documents))}
+
+
+
+{else}
+No documents are marked as archived.
+{/if}
\ No newline at end of file
diff --git a/templates/ktcore/document/admin/dearchiveconfirmlist.smarty b/templates/ktcore/document/admin/dearchiveconfirmlist.smarty
new file mode 100644
index 0000000..06d2bb8
--- /dev/null
+++ b/templates/ktcore/document/admin/dearchiveconfirmlist.smarty
@@ -0,0 +1,35 @@
+Confirm De-archival
+
+Note please confirm that you want to restore these documents from an archived state.
+
+{if (!empty($documents))}
+
+
+
+{else}
+No documents were selected.
+{/if}
\ No newline at end of file
diff --git a/templates/ktcore/document/admin/deletedlist.smarty b/templates/ktcore/document/admin/deletedlist.smarty
new file mode 100644
index 0000000..dfb97b1
--- /dev/null
+++ b/templates/ktcore/document/admin/deletedlist.smarty
@@ -0,0 +1,45 @@
+Deleted Documents
+
+Documents which are deleted by users are hidden from view,
+but still available for restoration. Since this consumes system resources, it
+is possible to expunge these documents. Alternatively, you
+can restore them as necessary.
+
+FIXME its probably very useful to add
+more information about the documents below - e.g. when was it deleted (last modified?)
+
+FIXME Have a "select all" toggler here.
+
+{if (!empty($documents))}
+
+
+
+{else}
+No documents are marked as deleted.
+{/if}
\ No newline at end of file
diff --git a/templates/ktcore/document/admin/expungeconfirmlist.smarty b/templates/ktcore/document/admin/expungeconfirmlist.smarty
new file mode 100644
index 0000000..5e0bf4f
--- /dev/null
+++ b/templates/ktcore/document/admin/expungeconfirmlist.smarty
@@ -0,0 +1,36 @@
+Confirm Expunge
+
+Note please confirm that you want to delete these documents.
+
+{if (!empty($documents))}
+
+
+
+{else}
+No documents were selected.
+{/if}
\ No newline at end of file
diff --git a/templates/ktcore/metadata/chooseFromMetadataLookup.smarty b/templates/ktcore/metadata/chooseFromMetadataLookup.smarty
index e3b5f14..2a7c2b2 100644
--- a/templates/ktcore/metadata/chooseFromMetadataLookup.smarty
+++ b/templates/ktcore/metadata/chooseFromMetadataLookup.smarty
@@ -1,17 +1,20 @@
{foreach from=$aFieldValues key=iFieldId item=aFieldInfo }
{assign var="oField" value=$aFieldInfo.field}
{assign var="aLookups" value=$aFieldInfo.values}
-
- {$oField->getName()|escape}
-
-
- Unset
-{foreach from=$aLookups item=oLookup}
- {$oLookup->getName()}
-{/foreach}
-
+
+
{$oField->getName()|escape}
+
FIXME
+
+
+
+
+ Unset
+ {foreach from=$aLookups item=oLookup}
+ {$oLookup->getName()}
+ {/foreach}
+
+
+
-
-
{/foreach}
diff --git a/templates/ktcore/metadata/editable_metadata_fields.smarty b/templates/ktcore/metadata/editable_metadata_fields.smarty
index ab58aad..b381abb 100644
--- a/templates/ktcore/metadata/editable_metadata_fields.smarty
+++ b/templates/ktcore/metadata/editable_metadata_fields.smarty
@@ -1,40 +1,3 @@
-{literal}
-
-{/literal}
-
{if !$metadata_prefix}
{assign var="metadata_prefix" value="emd"}
diff --git a/templates/ktcore/workflow/editState.smarty b/templates/ktcore/workflow/editState.smarty
index 3727d72..b42d739 100644
--- a/templates/ktcore/workflow/editState.smarty
+++ b/templates/ktcore/workflow/editState.smarty
@@ -1,24 +1,29 @@
-State: {$oState->getName()|escape}
-
-Edit state properties
+State: {$oState->getName()|escape}
-Inform
-
-Please select which roles or groups should be
-informed when this state is reached.
-
*}
-Permissions
+
+
-While in this workflow state, additional permissions
+
Assigned Permissions
+While in this workflow state, additional permissions
may be given. This is done either to expose the document to more users
or to allow a particular role to be fulfilled before a workflow
transition can be accomplished.
-Transitions
+
+
+Transitions
{if $aTransitionsTo}
-Transitions to this state
+
+Transitions to this state
+{if (!empty($aTransitionsTo))}
+{else}
+No transitions lead to this state.
+{/if}
{/if}
@@ -68,22 +83,42 @@ title="Transition
+
+{if (!empty($aTransitions))}
{entity_checkboxes entities=$aTransitions name="fTransitionIds" multiple="true" selected=$aTransitionsSelected}
+
+
+{else}
+No transitions defined.
+{/if}
+
+
+
-Actions allowed
diff --git a/templates/ktcore/workflow/editTransition.smarty b/templates/ktcore/workflow/editTransition.smarty
index 1d473e7..0c98b08 100644
--- a/templates/ktcore/workflow/editTransition.smarty
+++ b/templates/ktcore/workflow/editTransition.smarty
@@ -1,6 +1,9 @@
-Transition: {$oTransition->getName()|escape}
+Transition: {$oTransition->getName()|escape}
-Edit transition properties
+
+
diff --git a/templates/ktcore/workflow/editWorkflow.smarty b/templates/ktcore/workflow/editWorkflow.smarty
index 0bfd06e..606b03b 100644
--- a/templates/ktcore/workflow/editWorkflow.smarty
+++ b/templates/ktcore/workflow/editWorkflow.smarty
@@ -1,28 +1,45 @@
-Workflow: {$oWorkflow->getName()|escape}
+Workflow: {$oWorkflow->getName()|escape}
+
-Edit workflow properties
+
+Edit workflow properties
-
-
+
+{foreach item=oWidget from=$edit_fields}
+ {$oWidget->render()}
+{/foreach}
+
+
+
+
+
-States
+States
+FIXME insert intelligent help.
+
+
+Create a new state
+
+
-{if $aStates}
-Existing states
+{foreach item=oWidget from=$add_state_fields}
+ {$oWidget->render()}
+{/foreach}
+
+
+
+
+
+
+
+{if $aStates}
+Existing states
+Select a state to update its properties.
{/if}
-Create a new state
+
+
+
+
+Transitions
+
+FIXME insert intelligent help.
-
+
+Create a new transition
+
-
-
+
+
+{foreach item=oWidget from=$add_transition_fields}
+ {$oWidget->render()}
+{/foreach}
+
+
+
+
+
-Transitions
{if $aTransitions}
Existing transitions
@@ -55,35 +87,26 @@ title="Transition {$oTransition->getId()}">{$oTransition->getName()|escape}<
{/if}
-Create a new transition
-
-
-
-
-
-
-Actions controlled
+
+Actions controlled
+
+FIXME be helpful
+
+
{entity_checkboxes name="fActions" entities=$aActions idmethod="getName" method="getDisplayName" assign="aCheckboxes" selected="$aActionsSelected"}
{foreach from=$aCheckboxes item=sCheckbox}
{$sCheckbox}
{/foreach}
-
+
+
+
+
diff --git a/templates/ktcore/workflow/listWorkflows.smarty b/templates/ktcore/workflow/listWorkflows.smarty
index 0d5a74b..fbbca58 100644
--- a/templates/ktcore/workflow/listWorkflows.smarty
+++ b/templates/ktcore/workflow/listWorkflows.smarty
@@ -1,8 +1,26 @@
-Workflow
+Workflow
+
+
+
+Create a new workflow
+
+
+
+
+{foreach item=oWidget from=$add_fields}
+ {$oWidget->render()}
+{/foreach}
+
+
+
+
+
+
-{if $aWorkflow}
-Existing workflows
+{if $aWorkflow}
+Existing workflows
+Select a workflow to modify.
{/if}
-Create a new workflow
-
-
-
-
-
+
+