2015-04-22 08:33:49 +00:00
|
|
|
<?php
|
|
|
|
/**
|
2015-05-11 07:30:13 +00:00
|
|
|
* Implementation of SetRevisors view
|
2015-04-22 08:33:49 +00:00
|
|
|
*
|
|
|
|
* @category DMS
|
|
|
|
* @package SeedDMS
|
|
|
|
* @license GPL 2
|
|
|
|
* @version @version@
|
|
|
|
* @author Uwe Steinmann <uwe@steinmann.cx>
|
|
|
|
* @copyright Copyright (C) 2002-2005 Markus Westphal,
|
|
|
|
* 2006-2008 Malcolm Cowe, 2010 Matteo Lucarelli,
|
|
|
|
* 2010-2015 Uwe Steinmann
|
|
|
|
* @version Release: @package_version@
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Include parent class
|
|
|
|
*/
|
2021-04-19 17:45:40 +00:00
|
|
|
//require_once("class.Bootstrap.php");
|
2015-04-22 08:33:49 +00:00
|
|
|
|
|
|
|
/**
|
2015-05-11 07:30:13 +00:00
|
|
|
* Class which outputs the html page for SetRevisors view
|
2015-04-22 08:33:49 +00:00
|
|
|
*
|
|
|
|
* @category DMS
|
|
|
|
* @package SeedDMS
|
|
|
|
* @author Markus Westphal, Malcolm Cowe, Uwe Steinmann <uwe@steinmann.cx>
|
|
|
|
* @copyright Copyright (C) 2002-2005 Markus Westphal,
|
|
|
|
* 2006-2008 Malcolm Cowe, 2010 Matteo Lucarelli,
|
|
|
|
* 2010-2015 Uwe Steinmann
|
|
|
|
* @version Release: @package_version@
|
|
|
|
*/
|
2021-04-19 17:45:40 +00:00
|
|
|
class SeedDMS_View_SetRevisors extends SeedDMS_Theme_Style {
|
2015-04-22 08:33:49 +00:00
|
|
|
|
|
|
|
function show() { /* {{{ */
|
|
|
|
$dms = $this->params['dms'];
|
|
|
|
$user = $this->params['user'];
|
|
|
|
$folder = $this->params['folder'];
|
|
|
|
$document = $this->params['document'];
|
|
|
|
$content = $this->params['version'];
|
2016-10-27 12:22:49 +00:00
|
|
|
$enableadminrevapp = $this->params['enableadminrevapp'];
|
|
|
|
$enableownerrevapp = $this->params['enableownerrevapp'];
|
|
|
|
$enableselfrevapp = $this->params['enableselfrevapp'];
|
2015-04-22 08:33:49 +00:00
|
|
|
|
|
|
|
$overallStatus = $content->getStatus();
|
|
|
|
|
|
|
|
$this->htmlStartPage(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))));
|
|
|
|
$this->globalNavigation($folder);
|
|
|
|
$this->contentStart();
|
|
|
|
$this->pageNavigation($this->getFolderPathHTML($folder, true, $document), "view_document", $document);
|
2021-05-06 12:22:50 +00:00
|
|
|
$this->contentHeading(getMLText("update_revisors"));
|
2015-04-22 08:33:49 +00:00
|
|
|
|
2016-10-27 12:22:49 +00:00
|
|
|
// Retrieve a list of all users and groups that have review / approve privileges.
|
|
|
|
$docAccess = $document->getReadAccessList($enableadminrevapp, $enableownerrevapp);
|
2015-04-22 08:33:49 +00:00
|
|
|
|
2015-05-11 07:30:13 +00:00
|
|
|
// Retrieve list of currently assigned revisors, along with
|
2015-04-22 08:33:49 +00:00
|
|
|
// their latest status.
|
|
|
|
$revisionStatus = $content->getRevisionStatus();
|
2021-05-06 12:22:50 +00:00
|
|
|
$startdate = getReadableDate(makeTsFromDate($content->getRevisionDate()));
|
2015-04-22 08:33:49 +00:00
|
|
|
|
2015-05-11 07:30:13 +00:00
|
|
|
// Index the revision results for easy cross-reference with the revisor list.
|
2015-04-22 08:33:49 +00:00
|
|
|
$revisionIndex = array("i"=>array(), "g"=>array());
|
|
|
|
foreach ($revisionStatus as $i=>$rs) {
|
|
|
|
if ($rs["type"]==0) {
|
|
|
|
$revisionIndex["i"][$rs["required"]] = array("status"=>$rs["status"], "idx"=>$i);
|
|
|
|
} elseif ($rs["type"]==1) {
|
|
|
|
$revisionIndex["g"][$rs["required"]] = array("status"=>$rs["status"], "idx"=>$i);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
|
2017-01-04 17:08:18 +00:00
|
|
|
<form class="form-horizontal" action="../op/op.SetRevisors.php" method="post" name="form1">
|
2015-04-22 08:33:49 +00:00
|
|
|
|
2021-05-06 12:22:50 +00:00
|
|
|
<?php
|
|
|
|
$this->contentContainerStart();
|
|
|
|
$this->formField(
|
|
|
|
getMLText("revision_date"),
|
|
|
|
$this->getDateChooser($startdate, "startdate", $this->params['session']->getLanguage())
|
|
|
|
);
|
|
|
|
?>
|
2017-01-04 17:08:18 +00:00
|
|
|
|
|
|
|
<div class="control-group">
|
|
|
|
<label class="control-label"><?php printMLText("individuals")?>:</label>
|
|
|
|
<div class="controls">
|
|
|
|
<select class="chzn-select span9" name="indRevisors[]" multiple="multiple" data-placeholder="<?php printMLText('select_ind_revisors'); ?>" data-no_results_text="<?php printMLText('unknown_owner'); ?>">
|
2015-04-22 08:33:49 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
foreach ($docAccess["users"] as $usr) {
|
|
|
|
if (isset($revisionIndex["i"][$usr->getID()])) {
|
|
|
|
|
|
|
|
switch ($revisionIndex["i"][$usr->getID()]["status"]) {
|
2015-05-11 07:30:13 +00:00
|
|
|
case S_LOG_WAITING:
|
|
|
|
case S_LOG_SLEEPING:
|
2016-03-24 14:43:00 +00:00
|
|
|
case S_LOG_ACCEPTED:
|
|
|
|
case S_LOG_REJECTED:
|
2015-04-22 08:33:49 +00:00
|
|
|
print "<option value='". $usr->getID() ."' selected='selected'>".htmlspecialchars($usr->getLogin() . " - ". $usr->getFullName())."</option>";
|
|
|
|
break;
|
2015-05-11 07:30:13 +00:00
|
|
|
case S_LOG_USER_REMOVED:
|
2015-04-22 08:33:49 +00:00
|
|
|
print "<option value='". $usr->getID() ."'>".htmlspecialchars($usr->getLogin() . " - ". $usr->getFullName())."</option>";
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
print "<option value='". $usr->getID() ."' disabled='disabled'>".htmlspecialchars($usr->getLogin() . " - ". $usr->getFullName())."</option>";
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
} else {
|
2016-10-27 12:22:49 +00:00
|
|
|
if (!$enableselfrevapp && $usr->getID()==$user->getID()) continue;
|
2015-04-22 08:33:49 +00:00
|
|
|
print "<option value='". $usr->getID() ."'>". htmlspecialchars($usr->getLogin() . " - ". $usr->getFullName())."</option>";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|
2017-01-04 17:08:18 +00:00
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2017-12-18 07:41:31 +00:00
|
|
|
<div class="control-group">
|
2019-02-01 08:01:18 +00:00
|
|
|
<label class="control-label"><?php printMLText("individuals_in_groups")?>:</label>
|
2017-12-18 07:41:31 +00:00
|
|
|
<div class="controls">
|
|
|
|
<select class="chzn-select span9" name="grpIndRevisors[]" multiple="multiple" data-placeholder="<?php printMLText('select_grp_ind_revisors'); ?>" data-no_results_text="<?php printMLText('unknown_group'); ?>">
|
|
|
|
<?php
|
|
|
|
foreach ($docAccess["groups"] as $group) {
|
|
|
|
print "<option value='". $group->getID() ."'>".htmlspecialchars($group->getName())."</option>";
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2017-01-04 17:08:18 +00:00
|
|
|
<div class="control-group">
|
|
|
|
<label class="control-label"><?php printMLText("groups")?>:</label>
|
|
|
|
<div class="controls">
|
|
|
|
<select class="chzn-select span9" name="grpRevisors[]" multiple="multiple" data-placeholder="<?php printMLText('select_grp_revisors'); ?>" data-no_results_text="<?php printMLText('unknown_group'); ?>">
|
2015-04-22 08:33:49 +00:00
|
|
|
<?php
|
|
|
|
foreach ($docAccess["groups"] as $group) {
|
|
|
|
if (isset($revisionIndex["g"][$group->getID()])) {
|
|
|
|
switch ($revisionIndex["g"][$group->getID()]["status"]) {
|
2015-05-11 07:30:13 +00:00
|
|
|
case S_LOG_WAITING:
|
|
|
|
case S_LOG_SLEEPING:
|
2015-04-22 08:33:49 +00:00
|
|
|
print "<option value='". $group->getID() ."' selected='selected'>".htmlspecialchars($group->getName())."</option>";
|
|
|
|
break;
|
2015-05-11 07:30:13 +00:00
|
|
|
case S_LOG_USER_REMOVED:
|
2015-04-22 08:33:49 +00:00
|
|
|
print "<option value='". $group->getID() ."'>".htmlspecialchars($group->getName())."</option>";
|
|
|
|
break;
|
|
|
|
default:
|
2015-05-11 07:30:13 +00:00
|
|
|
print "<option id='recGrp".$group->getID()."' type='checkbox' name='grpRevisors[]' value='". $group->getID() ."' disabled='disabled'>".htmlspecialchars($group->getName())."</option>";
|
2015-04-22 08:33:49 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
print "<option value='". $group->getID() ."'>".htmlspecialchars($group->getName())."</option>";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|
2017-01-04 17:08:18 +00:00
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<input type='hidden' name='documentid' value='<?php echo $document->getID() ?>'/>
|
|
|
|
<input type='hidden' name='version' value='<?php echo $content->getVersion() ?>'/>
|
2015-04-22 08:33:49 +00:00
|
|
|
<?php
|
|
|
|
$this->contentContainerEnd();
|
2021-05-06 12:22:50 +00:00
|
|
|
$this->formSubmit("<i class=\"fa fa-save\"></i> ".getMLText('update'));
|
|
|
|
?>
|
|
|
|
</form>
|
|
|
|
<?php
|
2016-03-21 05:20:19 +00:00
|
|
|
$this->contentEnd();
|
2015-04-22 08:33:49 +00:00
|
|
|
$this->htmlEndPage();
|
|
|
|
} /* }}} */
|
|
|
|
}
|
|
|
|
?>
|