set individual recipients from group

This commit is contained in:
Uwe Steinmann 2015-12-08 09:00:42 +01:00
parent 52b64822c5
commit ffc709c557
2 changed files with 21 additions and 0 deletions

View File

@ -87,6 +87,18 @@ foreach ($receiptStatus as $i=>$rs) {
// Get the list of proposed recipients, stripping out any duplicates.
$pIndRev = (isset($_POST["indRecipients"]) ? array_values(array_unique($_POST["indRecipients"])) : array());
// Retrieve the list of recipient groups whose members become individual recipients
if (isset($_POST["grpIndRecipients"])) {
foreach ($_POST["grpIndRecipients"] as $grp) {
if($group = $dms->getGroup($grp)) {
$members = $group->getUsers();
foreach($members as $member) {
if(!in_array($member->getID(), $pIndRev))
$pIndRev[] = $member->getID();
}
}
}
}
$pGrpRev = (isset($_POST["grpRecipients"]) ? array_values(array_unique($_POST["grpRecipients"])) : array());
foreach ($pIndRev as $p) {
if (is_numeric($p)) {

View File

@ -95,6 +95,15 @@ class SeedDMS_View_SetRecipients extends SeedDMS_Bootstrap_Style {
?>
</select>
<div class="cbSelectTitle"><?php printMLText("indivіduals_in_groups")?>:</div>
<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
foreach ($docAccess["groups"] as $group) {
print "<option value='". $group->getID() ."'>".htmlspecialchars($group->getName())."</option>";
}
?>
</select>
<div class="cbSelectTitle"><?php printMLText("groups")?>:</div>
<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