The folder given below is where the unit folder will be created. Use the folder collection and path below to browse to the folder you wish to create the unit folder into.
The unit administrators have additional rights within that portion of the document management system.
+
'),
+ 'required' => true,
+ 'name' => 'browse',
+ 'folder_id' => $oFolder->getId(),
+ 'collection' => $collection));
+
+
$add_fields = array();
$add_fields[] = new KTStaticTextWidget(_kt('Unit Name'), _kt('A short name for the unit. e.g. Accounting.'), 'unit_name', $sName, $this->oPage, true);
- $isValid = true;
- if (KTFolderUtil::exists($oFolder, $sName)) {
- $isValid = false; // can't add a unit folder with the same name.
- }
+ $add_fields[] = $oWidget;
$oTemplating =& KTTemplating::getSingleton();
$oTemplate = $oTemplating->loadTemplate("ktcore/principals/addunit2");
$aTemplateData = array(
"context" => $this,
"add_fields" => $add_fields,
- "collection" => $collection,
- "collection_breadcrumbs" => $aBreadcrumbs,
+ "unit_name" => $sName,
"folder" => $oFolder,
"name" => $sName,
- "is_valid" => $isValid,
);
return $oTemplate->render($aTemplateData);
}
@@ -161,9 +151,9 @@ class KTUnitAdminDispatcher extends KTAdminDispatcher {
'message' => _kt('No name given'),
);
$sName = $this->oValidator->validateString($_REQUEST['unit_name'], $aOptions);
- $aOptions['message'] = _kt('A unit with that name already exists.');
- $sName = $this->oValidator->validateDuplicateName('Unit', $sName, $aOptions);
-
+ $aOptions['message'] = _kt('A unit with that name already exists.');
+ $sName = $this->oValidator->validateDuplicateName('Unit', $sName, $aOptions);
+
$oFolder = KTFolderUtil::add($oParentFolder, $sName, $this->oUser);
$aOptions = array(
'redirect_to' => array('addUnit2', sprintf('fFolderId=%d&unit_name=%s', $oParentFolder->getId(), $sName)),
diff --git a/templates/ktcore/principals/addunit2.smarty b/templates/ktcore/principals/addunit2.smarty
index 1dda048..e4ce203 100644
--- a/templates/ktcore/principals/addunit2.smarty
+++ b/templates/ktcore/principals/addunit2.smarty
@@ -13,32 +13,9 @@ your unit folder.{/i18n}
{$oWidget->render()}
{/foreach}
-
-
-
{i18n}The folder given below is where the
-unit folder will be created. Use the folder collection and path below
-to browse to the folder you wish to create the unit folder into.{/i18n}
-
-
{i18n}The unit administrators have additional
-rights within that portion of the document management system.{/i18n}