Commit e533cabfe68e92a8e4777070fce91c5481be2932

Authored by bshuttle
1 parent 9a4b0df6

fixes for:

+ KTS-187       Read version history:  still a "compare with current" version.
+ KTS-79        Printable document details
+ KTS-75        Useability of document details when doc is checked out.
+ KTS-92        inconsistent groups/users pages (?)
+ KTS-184       Message is invalid

and a few small tweaks to the ui.


git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/trunk@4678 c91229c3-7414-0410-bfa2-8a42b809f60b
lib/widgets/fieldsetDisplay.inc.php
... ... @@ -185,6 +185,8 @@ class GenericFieldsetDisplay extends KTFieldsetDisplay {
185 185 "document_data" => $aDocumentData,
186 186 "document" => $aDocumentData["document"],
187 187  
  188 + "filename" => $document->getFileName(),
  189 +
188 190 "creator" => $creator,
189 191 "creation_date" => $creation_date,
190 192  
... ... @@ -249,6 +251,9 @@ class GenericFieldsetDisplay extends KTFieldsetDisplay {
249 251 "document_data" => $aDocumentData,
250 252 "document" => $aDocumentData["document"],
251 253  
  254 + "filename" => $document->getFileName(),
  255 + "comparison_filename" => $comparison_document->getFileName(),
  256 +
252 257 "creator" => $creator,
253 258 "creation_date" => $creation_date,
254 259  
... ...
plugins/ktcore/admin/groupManagement.php
... ... @@ -21,6 +21,11 @@ class KTGroupAdminDispatcher extends KTAdminDispatcher {
21 21 $show_all = KTUtil::arrayGet($_REQUEST, 'show_all', false);
22 22 $group_id = KTUtil::arrayGet($_REQUEST, 'group_id');
23 23  
  24 + $no_search = true;
  25 +
  26 + if (KTUtil::arrayGet($_REQUEST, 'do_search', false) != false) {
  27 + $no_search = false;
  28 + }
24 29  
25 30 $search_fields = array();
26 31 $search_fields[] = new KTStringWidget(_('Group Name'),_("Enter part of the group's name. e.g. <strong>ad</strong> will match <strong>administrators</strong>."), 'name', $name, $this->oPage, true);
... ... @@ -29,6 +34,7 @@ class KTGroupAdminDispatcher extends KTAdminDispatcher {
29 34 $search_results =& Group::getList('WHERE name LIKE "%' . DBUtil::escapeSimple($name) . '%"');
30 35 } else if ($show_all !== false) {
31 36 $search_results =& Group::getList();
  37 + $no_search = false;
32 38 }
33 39  
34 40  
... ... @@ -38,6 +44,7 @@ class KTGroupAdminDispatcher extends KTAdminDispatcher {
38 44 "context" => $this,
39 45 "search_fields" => $search_fields,
40 46 "search_results" => $search_results,
  47 + 'no_search' => $no_search,
41 48 );
42 49 return $oTemplate->render($aTemplateData);
43 50 }
... ...
plugins/ktcore/admin/userManagement.php
... ... @@ -25,6 +25,13 @@ class KTUserAdminDispatcher extends KTAdminDispatcher {
25 25 $show_all = KTUtil::arrayGet($_REQUEST, 'show_all', false);
26 26 $user_id = KTUtil::arrayGet($_REQUEST, 'user_id');
27 27  
  28 + $no_search = true;
  29 +
  30 + if (KTUtil::arrayGet($_REQUEST, 'do_search', false) != false) {
  31 + $no_search = false;
  32 + }
  33 +
  34 +
28 35  
29 36 $search_fields = array();
30 37 $search_fields[] = new KTStringWidget(_('Username'),_("Enter part of the person's username. e.g. <strong>ra</strong> will match <strong>brad</strong>."), 'name', $name, $this->oPage, true);
... ... @@ -35,6 +42,7 @@ class KTUserAdminDispatcher extends KTAdminDispatcher {
35 42 $search_results =& User::getList('WHERE username LIKE "%' . DBUtil::escapeSimple($name) . '%"');
36 43 } else if ($show_all !== false) {
37 44 $search_results =& User::getList();
  45 + $no_search = false;
38 46 }
39 47  
40 48 $oTemplating = new KTTemplating;
... ... @@ -43,6 +51,7 @@ class KTUserAdminDispatcher extends KTAdminDispatcher {
43 51 "context" => $this,
44 52 "search_fields" => $search_fields,
45 53 "search_results" => $search_results,
  54 + 'no_search' => $no_search,
46 55 );
47 56 return $oTemplate->render($aTemplateData);
48 57 }
... ...
templates/kt3/document/metadata_history.smarty
... ... @@ -22,7 +22,13 @@
22 22 {capture assign=version}{$oVersion->getMajorVersionNumber()}.{$oVersion->getMinorVersionNumber()}{/capture}
23 23 {capture assign=versionid}{$oVersion->getContentVersionId()}{/capture}
24 24 <td class="date"><a href="{$downloadaction->getURL()}&version={$versionid}">{$version}</a></td>
25   - <td class="compare"><a href="{$smarty.server.PHP_SELF}?action=viewComparison&fDocumentId={$document->getId()}&fComparisonVersion={$oVersion->getCurrentMetadataVersionId()}">{i18n}compare with current{/i18n}</a></td>
  25 + <td class="compare">
  26 + {if ($document->getMetadataVersion() == $oVersion->getMetadataVersion())}
  27 + <strong>{i18n}current version{/i18n}</strong>
  28 + {else}
  29 + <a href="{$smarty.server.PHP_SELF}?action=viewComparison&fDocumentId={$document->getId()}&fComparisonVersion={$oVersion->getCurrentMetadataVersionId()}">{i18n}compare with current{/i18n}</a></td>
  30 + {/if}
  31 + </td>
26 32 </tr>
27 33 {/foreach}
28 34 </tbody>
... ...
templates/kt3/document/view.smarty
1 1 <h2>{$document->getName()}</h2>
  2 +
  3 +
2 4 {capture assign=version}
3 5 {$document->getMajorVersionNumber()}.{$document->getMinorVersionNumber()}
4 6 {/capture}
5 7 <p class="descriptiveText">{i18n arg_version=$version}showing information for <strong>version #version#</strong>{/i18n}</p>
6   -
  8 +
7 9 {foreach item=oFieldset from=$fieldsets}
8 10 {$oFieldset->render($document_data)}
9 11 {/foreach}
... ...
templates/kt3/fieldsets/generic.smarty
... ... @@ -5,8 +5,11 @@
5 5 document.{/i18n}
6 6 </p>
7 7 <dl class="metadata">
  8 + <dt>{i18n}Document Filename{/i18n}</dt>
  9 + <dd>{$filename} ({$context->_sizeHelper($document->getSize())})</dd>
  10 +
8 11 <dt>{i18n}File is a{/i18n} </dt>
9   - <dd>{$context->_mimeHelper($document->getMimeTypeID())} ({$context->_sizeHelper($document->getSize())})</dd>
  12 + <dd>{$context->_mimeHelper($document->getMimeTypeID())}</dd>
10 13  
11 14 <dt>{i18n}Created by{/i18n}</dt>
12 15 <dd>{$creator} ({$creation_date})</dd>
... ...
templates/kt3/fieldsets/generic_versioned.smarty
... ... @@ -5,10 +5,16 @@
5 5 document.{/i18n}
6 6 </p>
7 7 <dl class="metadata versioned">
  8 + <dt>{i18n}Document Filename{/i18n}</dt>
  9 + <dd>
  10 + <div class="current">{$filename} ({$context->_sizeHelper($document->getSize())})</div>
  11 + <div class="previous">{$comparison_filename} ({$context->_sizeHelper($comparison_document->getSize())})</div>
  12 + </dd>
  13 +
8 14 <dt>{i18n}File is a{/i18n} </dt>
9 15 <dd>
10   - <div class="current">{$context->_mimeHelper($document->getMimeTypeID())} ({$context->_sizeHelper($document->getSize())})</div>
11   - <div class="previous">{$context->_mimeHelper($comparison_document->getMimeTypeID())} ({$context->_sizeHelper($comparison_document->getSize())})</div>
  16 + <div class="current">{$context->_mimeHelper($document->getMimeTypeID())}</div>
  17 + <div class="previous">{$context->_mimeHelper($comparison_document->getMimeTypeID())}</div>
12 18 </dd>
13 19  
14 20 <dt>{i18n}Created by{/i18n}</dt>
... ...
templates/kt3/standard_page.smarty
... ... @@ -5,10 +5,14 @@
5 5 <title>{$page->title} | {$page->systemName}</title>
6 6  
7 7 <!-- CSS Files. -->
  8 +
8 9 {foreach item=sResourceURL from=$page->getCSSResources()}
9 10 <link rel="stylesheet" type="text/css" href="{$rootUrl}/{$sResourceURL}" />
10 11 {/foreach}
11 12  
  13 + <link rel="stylesheet" type="text/css" href="{$rootUrl}/resources/css/kt-print.css"
  14 + media="print" />
  15 +
12 16 <!-- Standalone CSS. -->
13 17 {foreach item=sCSS from=$page->getCSSStandalone()}
14 18 <style>
... ...
templates/kt3/view_document.smarty
... ... @@ -4,7 +4,14 @@
4 4 {/capture}
5 5 <p class="descriptiveText">{i18n arg_version=$version}showing information for <strong>version
6 6 #version#</strong>{/i18n}</p>
7   -
  7 +{if ($document->getIsCheckedOut() == 1)}
  8 +{capture assign=checkout_user}<strong>{$sCheckoutUser}</strong>{/capture}
  9 +<div class="ktInfo">
  10 +<p>{i18n arg_checkoutuser=$checkout_user}This document is currently checked out by #checkoutuser#. You cannot make
  11 +changes until that user checks it in. If you have urgent modifications to make, please
  12 +contact your KnowledgeTree Administrator.{/i18n}</p>
  13 +</div>
  14 +{/if}
8 15 {foreach item=oFieldset from=$fieldsets}
9 16 {$oFieldset->render($document_data)}
10 17 {/foreach}
... ...
templates/ktcore/principals/groupadmin.smarty
... ... @@ -20,7 +20,10 @@ action may take some time if you have many groups).{/i18n}&lt;/p&gt;
20 20 </div class="form_actions">
21 21 </fieldset>
22 22 </form>
  23 +{if ($no_search === true)}
23 24  
  25 +{else}
  26 +{if (!empty($search_results))}
24 27 <table class="listing">
25 28 <thead>
26 29 <tr>
... ... @@ -33,7 +36,7 @@ action may take some time if you have many groups).{/i18n}&lt;/p&gt;
33 36 </tr>
34 37 </thead>
35 38 <tbody>
36   - {if (!empty($search_results))}
  39 +
37 40 <!-- do we want to batch here? -->
38 41 {foreach item=oGroup from=$search_results}
39 42 <tr>
... ... @@ -52,12 +55,12 @@ href=&quot;?action=manageSubgroups&amp;group_id={$oGroup-&gt;getId()}&quot;&gt;{i18n}Manage sub-grou
52 55 class="ktAction ktDelete">{i18n}Delete{/i18n}</a></td>
53 56 </tr>
54 57 {/foreach}
55   - {else}
56   - <tr>
57   - <td colspan="7" class="ktInfo">
58   - <p>{i18n}No search specified, or no results for your search.{/i18n}</p>
59   - </td>
60   - </tr>
61   - {/if}
  58 +
62 59 </tbody>
63 60 </table>
  61 +
  62 +{else}
  63 +<div class="ktError"><p>{i18n}No results for your search.{/i18n}</p></div>
  64 +
  65 +{/if}
  66 +{/if}
64 67 \ No newline at end of file
... ...
templates/ktcore/principals/useradmin.smarty
... ... @@ -9,6 +9,7 @@ href=&quot;?action=addUser&quot;&gt;{i18n}Add a new user{/i18n}&lt;/a&gt;.&lt;/p&gt;
9 9  
10 10 <!-- we roll both in here. -->
11 11 <form action="{$smarty.server.PHP_SELF}" method="POST">
  12 +<input type="hidden" name="do_search" value="1" />
12 13 <fieldset>
13 14 <legend>Search for users</legend>
14 15 <p class="descriptiveText">{i18n}Since there may be many users in the system, please
... ... @@ -26,6 +27,11 @@ very slow if you have many users.{/i18n}&lt;/p&gt;
26 27 </fieldset>
27 28 </form>
28 29  
  30 +{if (no_search === true)}
  31 +
  32 +{else}
  33 +
  34 + {if (!empty($search_results))}
29 35 <table class="listing">
30 36 <thead>
31 37 <tr>
... ... @@ -37,7 +43,6 @@ very slow if you have many users.{/i18n}&lt;/p&gt;
37 43 </tr>
38 44 </thead>
39 45 <tbody>
40   - {if (!empty($search_results))}
41 46 <!-- do we want to batch here? -->
42 47 {foreach item=oUser from=$search_results}
43 48 <tr>
... ... @@ -48,21 +53,12 @@ very slow if you have many users.{/i18n}&lt;/p&gt;
48 53 <td><a href="?action=editgroups&user_id={$oUser->getId()}">{i18n}Groups{/i18n}</a></td>
49 54 </tr>
50 55 {/foreach}
51   - {else}
52   - <tr>
53   - <td colspan="5" class="ktInfo">
54   - <!-- never show a very large set, if you can help it. -->
55   - <p>
56   -{i18n}
57   -No search specified, or no results for your search. Please choose some
58   -criteria from the list above to find users.
59   -{/i18n}
60   -</p>
61   - </td>
62   - </tr>
63   - {/if}
64   -<!--
65   -
66   --->
  56 +
67 57 </tbody>
68 58 </table>
  59 +
  60 +{else}
  61 +<div class="ktError"><p>{i18n}No results for your search.{/i18n}</p></div>
  62 +
  63 +{/if}
  64 +{/if}
69 65 \ No newline at end of file
... ...
view.php
... ... @@ -124,10 +124,21 @@ class ViewDocumentDispatcher extends KTStandardDispatcher {
124 124 array_push($fieldsets, new $displayClass($oFieldset));
125 125 }
126 126  
  127 +
  128 + $checkout_user = 'Unknown user';
  129 + if ($oDocument->getIsCheckedOut() == 1) {
  130 + $oCOU = User::get($oDocument->getCheckedOutUserId());
  131 + if (!(PEAR::isError($oCOU) || ($oCOU == false))) {
  132 + $checkout_user = $oCOU->getName();
  133 + }
  134 + }
  135 +
  136 +
127 137 $oTemplating = new KTTemplating;
128 138 $oTemplate = $oTemplating->loadTemplate("kt3/view_document");
129 139 $aTemplateData = array(
130 140 "context" => $this,
  141 + "sCheckoutUser" => $checkout_user,
131 142 "document_id" => $document_id,
132 143 "document" => $oDocument,
133 144 "document_data" => $document_data,
... ...