mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-02-06 15:14:58 +00:00
do not use plain html, but use methods from theme class
This commit is contained in:
parent
dbd43d5877
commit
c3058176f3
|
@ -70,78 +70,93 @@ class SeedDMS_View_SetRecipients extends SeedDMS_Theme_Style {
|
|||
<input type='hidden' name='documentid' value='<?php echo $document->getID() ?>'/>
|
||||
<input type='hidden' name='version' value='<?php echo $content->getVersion() ?>'/>
|
||||
|
||||
<?php $this->contentContainerStart(); ?>
|
||||
|
||||
<div class="control-group">
|
||||
<label class="control-label"><?php printMLText("individuals")?>:</label>
|
||||
<div class="controls">
|
||||
<select class="chzn-select span9" name="indRecipients[]" multiple="multiple" data-placeholder="<?php printMLText('select_ind_recipients'); ?>" data-no_results_text="<?php printMLText('unknown_owner'); ?>">
|
||||
<?php
|
||||
$this->contentContainerStart();
|
||||
|
||||
$options = [];
|
||||
foreach ($docAccess["users"] as $usr) {
|
||||
if (isset($receiptIndex["i"][$usr->getID()])) {
|
||||
|
||||
switch ($receiptIndex["i"][$usr->getID()]["status"]) {
|
||||
case 0:
|
||||
print "<option value='". $usr->getID() ."' selected='selected'>".htmlspecialchars($usr->getLogin() . " - ". $usr->getFullName())."</option>";
|
||||
$options[] = array($usr->getID(), htmlspecialchars($usr->getLogin() . " - ". $usr->getFullName()), true);
|
||||
break;
|
||||
case -2:
|
||||
print "<option value='". $usr->getID() ."'>".htmlspecialchars($usr->getLogin() . " - ". $usr->getFullName())."</option>";
|
||||
case S_LOG_USER_REMOVED:
|
||||
$options[] = array($usr->getID(), htmlspecialchars($usr->getLogin() . " - ". $usr->getFullName()), false, array(array('data-subtitle', getMLText('user_previously_removed_from_recipients'))));
|
||||
break;
|
||||
default:
|
||||
print "<option value='". $usr->getID() ."' disabled='disabled'>".htmlspecialchars($usr->getLogin() . " - ". $usr->getFullName())."</option>";
|
||||
$options[] = array($usr->getID(), htmlspecialchars($usr->getLogin() . " - ". $usr->getFullName()), false, ['disabled', 'disabled']);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
print "<option value='". $usr->getID() ."'>". htmlspecialchars($usr->getLogin() . " - ". $usr->getFullName())."</option>";
|
||||
$options[] = array($usr->getID(), htmlspecialchars($usr->getLogin() . " - ". $usr->getFullName()));
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
$this->formField(
|
||||
getMLText("individuals"),
|
||||
array(
|
||||
'element'=>'select',
|
||||
'id'=>'indRecipients',
|
||||
'name'=>'indRecipients[]',
|
||||
'class'=>'chzn-select',
|
||||
'multiple'=>true,
|
||||
'attributes'=>array(array('data-allow-clear', 'true'), array('data-placeholder', getMLText('select_ind_recipients')), array('data-no_results_text', getMLText('unknown_user'))),
|
||||
'options'=>$options
|
||||
)
|
||||
);
|
||||
|
||||
<div class="control-group">
|
||||
<label class="control-label"><?php printMLText("individuals_in_groups")?>:</label>
|
||||
<div class="controls">
|
||||
<select class="chzn-select span9" name="grpIndRecipients[]" multiple="multiple" data-placeholder="<?php printMLText('select_grp_ind_recipients'); ?>" data-no_results_text="<?php printMLText('unknown_group'); ?>">
|
||||
<?php
|
||||
$options = [];
|
||||
foreach ($docAccess["groups"] as $group) {
|
||||
print "<option value='". $group->getID() ."'>".htmlspecialchars($group->getName())."</option>";
|
||||
$grpusers = $group->getUsers();
|
||||
if(count($grpusers) == 0)
|
||||
$optopt[] = ['disabled', 'disabled'];
|
||||
$options[] = array($group->getID(), htmlspecialchars($group->getName().' ('.count($grpusers).')'), false, $optopt);
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
$this->formField(
|
||||
getMLText("individuals_in_groups"),
|
||||
array(
|
||||
'element'=>'select',
|
||||
'id'=>'grpIndRecipients',
|
||||
'name'=>'grpIndRecipients[]',
|
||||
'class'=>'chzn-select',
|
||||
'multiple'=>true,
|
||||
'attributes'=>array(array('data-allow-clear', 'true'), array('data-placeholder', getMLText('select_grp_ind_recipients')), array('data-no_results_text', getMLText('unknown_group'))),
|
||||
'options'=>$options
|
||||
)
|
||||
);
|
||||
|
||||
<div class="control-group">
|
||||
<label class="control-label"><?php printMLText("groups")?>:</label>
|
||||
<div class="controls">
|
||||
<select class="chzn-select span9" name="grpRecipients[]" multiple="multiple" data-placeholder="<?php printMLText('select_grp_recipients'); ?>" data-no_results_text="<?php printMLText('unknown_group'); ?>">
|
||||
<?php
|
||||
$options = [];
|
||||
foreach ($docAccess["groups"] as $group) {
|
||||
$grpusers = $group->getUsers();
|
||||
if (isset($receiptIndex["g"][$group->getID()])) {
|
||||
switch ($receiptIndex["g"][$group->getID()]["status"]) {
|
||||
case 0:
|
||||
print "<option value='". $group->getID() ."' selected='selected'>".htmlspecialchars($group->getName())."</option>";
|
||||
$options[] = array($group->getID(), htmlspecialchars($group->getName().' ('.count($grpusers).')'), true);
|
||||
break;
|
||||
case -2:
|
||||
print "<option value='". $group->getID() ."'>".htmlspecialchars($group->getName())."</option>";
|
||||
case S_LOG_USER_REMOVED:
|
||||
$options[] = array($group->getID(), htmlspecialchars($group->getName().' ('.count($grpusers).')'), false, array(array('data-subtitle', getMLText('group_previously_removed_from_recipients'))));
|
||||
break;
|
||||
default:
|
||||
print "<option id='recGrp".$group->getID()."' type='checkbox' name='grpRecipients[]' value='". $group->getID() ."' disabled='disabled'>".htmlspecialchars($group->getName())."</option>";
|
||||
$options[] = array($group->getID(), htmlspecialchars($group->getName().' ('.count($grpusers).')'), false, array(array('disabled', 'disabled')));
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
print "<option value='". $group->getID() ."'>".htmlspecialchars($group->getName())."</option>";
|
||||
$options[] = array($group->getID(), htmlspecialchars($group->getName().' ('.count($grpusers).')'));
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
$this->formField(
|
||||
getMLText("groups"),
|
||||
array(
|
||||
'element'=>'select',
|
||||
'id'=>'grpRecipients',
|
||||
'name'=>'grpRecipients[]',
|
||||
'class'=>'chzn-select',
|
||||
'multiple'=>true,
|
||||
'attributes'=>array(array('data-allow-clear', 'true'), array('data-placeholder', getMLText('select_grp_recipients')), array('data-no_results_text', getMLText('unknown_group'))),
|
||||
'options'=>$options
|
||||
)
|
||||
);
|
||||
|
||||
<?php
|
||||
$this->contentContainerEnd();
|
||||
$this->formSubmit("<i class=\"fa fa-save\"></i> ".getMLText('update'));
|
||||
?>
|
||||
|
|
|
@ -82,14 +82,8 @@ class SeedDMS_View_SetRevisors extends SeedDMS_Theme_Style {
|
|||
$this->getDateChooser($startdate, "startdate", $this->params['session']->getLanguage())
|
||||
);
|
||||
}
|
||||
?>
|
||||
|
||||
<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'); ?>">
|
||||
<?php
|
||||
|
||||
$options = [];
|
||||
foreach ($docAccess["users"] as $usr) {
|
||||
if (isset($revisionIndex["i"][$usr->getID()])) {
|
||||
|
||||
|
@ -98,67 +92,85 @@ class SeedDMS_View_SetRevisors extends SeedDMS_Theme_Style {
|
|||
case S_LOG_SLEEPING:
|
||||
case S_LOG_ACCEPTED:
|
||||
case S_LOG_REJECTED:
|
||||
print "<option value='". $usr->getID() ."' selected='selected'>".htmlspecialchars($usr->getLogin() . " - ". $usr->getFullName())."</option>";
|
||||
$options[] = array($usr->getID(), htmlspecialchars($usr->getLogin() . " - ". $usr->getFullName()), true);
|
||||
break;
|
||||
case S_LOG_USER_REMOVED:
|
||||
print "<option value='". $usr->getID() ."'>".htmlspecialchars($usr->getLogin() . " - ". $usr->getFullName())."</option>";
|
||||
$options[] = array($usr->getID(), htmlspecialchars($usr->getLogin() . " - ". $usr->getFullName()), false, array(array('data-subtitle', getMLText('user_previously_removed_from_revisors'))));
|
||||
break;
|
||||
default:
|
||||
print "<option value='". $usr->getID() ."' disabled='disabled'>".htmlspecialchars($usr->getLogin() . " - ". $usr->getFullName())."</option>";
|
||||
$options[] = array($usr->getID(), htmlspecialchars($usr->getLogin() . " - ". $usr->getFullName()), false, ['disabled', 'disabled']);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
if (!$enableselfrevapp && $usr->getID()==$user->getID()) continue;
|
||||
print "<option value='". $usr->getID() ."'>". htmlspecialchars($usr->getLogin() . " - ". $usr->getFullName())."</option>";
|
||||
$options[] = array($usr->getID(), htmlspecialchars($usr->getLogin() . " - ". $usr->getFullName()));
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="control-group">
|
||||
<label class="control-label"><?php printMLText("individuals_in_groups")?>:</label>
|
||||
<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
|
||||
$this->formField(
|
||||
getMLText("individuals"),
|
||||
array(
|
||||
'element'=>'select',
|
||||
'id'=>'indRevisors',
|
||||
'name'=>'indRevisors[]',
|
||||
'class'=>'chzn-select',
|
||||
'multiple'=>true,
|
||||
'attributes'=>array(array('data-allow-clear', 'true'), array('data-placeholder', getMLText('select_ind_revisors')), array('data-no_results_text', getMLText('unknown_user'))),
|
||||
'options'=>$options
|
||||
)
|
||||
);
|
||||
$options = [];
|
||||
foreach ($docAccess["groups"] as $group) {
|
||||
print "<option value='". $group->getID() ."'>".htmlspecialchars($group->getName())."</option>";
|
||||
$optopt = [];
|
||||
$grpusers = $group->getUsers();
|
||||
if(count($grpusers) == 0)
|
||||
$optopt[] = ['disabled', 'disabled'];
|
||||
$options[] = array($group->getID(), htmlspecialchars($group->getName().' ('.count($grpusers).')'), false, $optopt);
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
$this->formField(
|
||||
getMLText("individuals_in_groups"),
|
||||
array(
|
||||
'element'=>'select',
|
||||
'id'=>'grpIndRevisors',
|
||||
'name'=>'grpIndRevisors[]',
|
||||
'class'=>'chzn-select',
|
||||
'multiple'=>true,
|
||||
'attributes'=>array(array('data-allow-clear', 'true'), array('data-placeholder', getMLText('select_grp_ind_revisors')), array('data-no_results_text', getMLText('unknown_group'))),
|
||||
'options'=>$options
|
||||
)
|
||||
);
|
||||
|
||||
<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'); ?>">
|
||||
<?php
|
||||
$options = [];
|
||||
foreach ($docAccess["groups"] as $group) {
|
||||
$grpusers = $group->getUsers();
|
||||
if (isset($revisionIndex["g"][$group->getID()])) {
|
||||
switch ($revisionIndex["g"][$group->getID()]["status"]) {
|
||||
case S_LOG_WAITING:
|
||||
case S_LOG_SLEEPING:
|
||||
print "<option value='". $group->getID() ."' selected='selected'>".htmlspecialchars($group->getName())."</option>";
|
||||
$options[] = array($group->getID(), htmlspecialchars($group->getName().' ('.count($grpusers).')'), true);
|
||||
break;
|
||||
case S_LOG_USER_REMOVED:
|
||||
print "<option value='". $group->getID() ."'>".htmlspecialchars($group->getName())."</option>";
|
||||
$options[] = array($group->getID(), htmlspecialchars($group->getName().' ('.count($grpusers).')'), false, array(array('data-subtitle', getMLText('group_previously_removed_from_revisors'))));
|
||||
break;
|
||||
default:
|
||||
print "<option id='recGrp".$group->getID()."' type='checkbox' name='grpRevisors[]' value='". $group->getID() ."' disabled='disabled'>".htmlspecialchars($group->getName())."</option>";
|
||||
$options[] = array($group->getID(), htmlspecialchars($group->getName().' ('.count($grpusers).')'), false, array(array('disabled', 'disabled')));
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
print "<option value='". $group->getID() ."'>".htmlspecialchars($group->getName())."</option>";
|
||||
$options[] = array($group->getID(), htmlspecialchars($group->getName().' ('.count($grpusers).')'));
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
$this->formField(
|
||||
getMLText("groups"),
|
||||
array(
|
||||
'element'=>'select',
|
||||
'id'=>'grpRevisors',
|
||||
'name'=>'grpRevisors[]',
|
||||
'class'=>'chzn-select',
|
||||
'multiple'=>true,
|
||||
'attributes'=>array(array('data-allow-clear', 'true'), array('data-placeholder', getMLText('select_grp_revisors')), array('data-no_results_text', getMLText('unknown_group'))),
|
||||
'options'=>$options
|
||||
)
|
||||
);
|
||||
$this->contentContainerEnd();
|
||||
$this->formSubmit("<i class=\"fa fa-save\"></i> ".getMLText('update'));
|
||||
?>
|
||||
|
|
Loading…
Reference in New Issue
Block a user