support custom date format, remove some html

This commit is contained in:
Uwe Steinmann 2021-05-06 14:22:50 +02:00
parent 1a84cb311a
commit 93192b7e3d
2 changed files with 16 additions and 24 deletions

View File

@ -56,10 +56,11 @@ if (!is_object($content)) {
} }
if (isset($_POST["startdate"])) { if (isset($_POST["startdate"])) {
$startdate = $_POST["startdate"]; $ts = makeTsFromDate($_POST["startdate"]);
} else { } else {
$startdate = date('Y-m-d'); $ts = time();
} }
$startdate = date('Y-m-d', $ts);
if(!$content->setRevisionDate($startdate)) { if(!$content->setRevisionDate($startdate)) {
UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("error_occured")); UI::exitError(getMLText("document_title", array("documentname" => $document->getName())),getMLText("error_occured"));

View File

@ -47,7 +47,7 @@ class SeedDMS_View_SetRevisors extends SeedDMS_Theme_Style {
$this->globalNavigation($folder); $this->globalNavigation($folder);
$this->contentStart(); $this->contentStart();
$this->pageNavigation($this->getFolderPathHTML($folder, true, $document), "view_document", $document); $this->pageNavigation($this->getFolderPathHTML($folder, true, $document), "view_document", $document);
$this->contentHeading(getMLText("change_assignments")); $this->contentHeading(getMLText("update_revisors"));
// Retrieve a list of all users and groups that have review / approve privileges. // Retrieve a list of all users and groups that have review / approve privileges.
$docAccess = $document->getReadAccessList($enableadminrevapp, $enableownerrevapp); $docAccess = $document->getReadAccessList($enableadminrevapp, $enableownerrevapp);
@ -55,7 +55,7 @@ class SeedDMS_View_SetRevisors extends SeedDMS_Theme_Style {
// Retrieve list of currently assigned revisors, along with // Retrieve list of currently assigned revisors, along with
// their latest status. // their latest status.
$revisionStatus = $content->getRevisionStatus(); $revisionStatus = $content->getRevisionStatus();
$startdate = substr($content->getRevisionDate(), 0, 10); $startdate = getReadableDate(makeTsFromDate($content->getRevisionDate()));
// Index the revision results for easy cross-reference with the revisor list. // Index the revision results for easy cross-reference with the revisor list.
$revisionIndex = array("i"=>array(), "g"=>array()); $revisionIndex = array("i"=>array(), "g"=>array());
@ -68,21 +68,15 @@ class SeedDMS_View_SetRevisors extends SeedDMS_Theme_Style {
} }
?> ?>
<?php $this->contentContainerStart(); ?>
<form class="form-horizontal" action="../op/op.SetRevisors.php" method="post" name="form1"> <form class="form-horizontal" action="../op/op.SetRevisors.php" method="post" name="form1">
<?php $this->contentSubHeading(getMLText("update_revisors"));?> <?php
$this->contentContainerStart();
<div class="control-group"> $this->formField(
<label class="control-label"><?php printMLText("revision_date")?>:</label> getMLText("revision_date"),
<div class="controls"> $this->getDateChooser($startdate, "startdate", $this->params['session']->getLanguage())
<span class="input-append date" style="display: inline;" id="revisionstartdate" data-date="<?php echo date('Y-m-d'); ?>" data-date-format="yyyy-mm-dd" data-date-language="<?php echo str_replace('_', '-', $this->params['session']->getLanguage()); ?>"> );
<input class="span4" size="16" name="startdate" type="text" value="<?php if($startdate) echo $startdate; else echo date('Y-m-d'); ?>"> ?>
<span class="add-on"><i class="fa fa-calendar"></i></span>
</span>
</div>
</div>
<div class="control-group"> <div class="control-group">
<label class="control-label"><?php printMLText("individuals")?>:</label> <label class="control-label"><?php printMLText("individuals")?>:</label>
@ -160,15 +154,12 @@ class SeedDMS_View_SetRevisors extends SeedDMS_Theme_Style {
<input type='hidden' name='documentid' value='<?php echo $document->getID() ?>'/> <input type='hidden' name='documentid' value='<?php echo $document->getID() ?>'/>
<input type='hidden' name='version' value='<?php echo $content->getVersion() ?>'/> <input type='hidden' name='version' value='<?php echo $content->getVersion() ?>'/>
<div class="control-group">
<label class="control-label"></label>
<div class="controls">
<input type="submit" class="btn" value="<?php printMLText("update");?>">
</div>
</div>
</form>
<?php <?php
$this->contentContainerEnd(); $this->contentContainerEnd();
$this->formSubmit("<i class=\"fa fa-save\"></i> ".getMLText('update'));
?>
</form>
<?php
$this->contentEnd(); $this->contentEnd();
$this->htmlEndPage(); $this->htmlEndPage();
} /* }}} */ } /* }}} */