diff --git a/views/bootstrap/class.AddDocument.php b/views/bootstrap/class.AddDocument.php index ea329edeb..c838ef474 100644 --- a/views/bootstrap/class.AddDocument.php +++ b/views/bootstrap/class.AddDocument.php @@ -348,6 +348,46 @@ $(document).ready(function() { } $this->contentContainerEnd(); + if(!$nodocumentformfields || !in_array('notification', $nodocumentformfields)) { + $this->contentSubHeading(getMLText("add_document_notify")); + $this->contentContainerStart(); + + $options = array(); + $allUsers = $dms->getAllUsers($sortusersinlist); + foreach ($allUsers as $userObj) { + if (!$userObj->isGuest() && $folder->getAccessMode($userObj) >= M_READ) + $options[] = array($userObj->getID(), htmlspecialchars($userObj->getLogin() . " - " . $userObj->getFullName())); + } + $this->formField( + getMLText("individuals"), + array( + 'element'=>'select', + 'name'=>'notification_users[]', + 'class'=>'chzn-select', + 'attributes'=>array(array('data-placeholder', getMLText('select_ind_notification'))), + 'multiple'=>true, + 'options'=>$options + ) + ); + $options = array(); + $allGroups = $dms->getAllGroups(); + foreach ($allGroups as $groupObj) { + if ($folder->getGroupAccessMode($groupObj) >= M_READ) + $options[] = array($groupObj->getID(), htmlspecialchars($groupObj->getName())); + } + $this->formField( + getMLText("groups"), + array( + 'element'=>'select', + 'name'=>'notification_groups[]', + 'class'=>'chzn-select', + 'attributes'=>array(array('data-placeholder', getMLText('select_grp_notification'))), + 'multiple'=>true, + 'options'=>$options + ) + ); + $this->contentContainerEnd(); + } $this->columnEnd(); $this->columnStart(6); $this->contentSubHeading(getMLText("version_info")); @@ -771,46 +811,6 @@ $(document).ready(function() { $this->contentContainerEnd(); } - if(!$nodocumentformfields || !in_array('notification', $nodocumentformfields)) { - $this->contentSubHeading(getMLText("add_document_notify")); - $this->contentContainerStart(); - - $options = array(); - $allUsers = $dms->getAllUsers($sortusersinlist); - foreach ($allUsers as $userObj) { - if (!$userObj->isGuest() && $folder->getAccessMode($userObj) >= M_READ) - $options[] = array($userObj->getID(), htmlspecialchars($userObj->getLogin() . " - " . $userObj->getFullName())); - } - $this->formField( - getMLText("individuals"), - array( - 'element'=>'select', - 'name'=>'notification_users[]', - 'class'=>'chzn-select', - 'attributes'=>array(array('data-placeholder', getMLText('select_ind_notification'))), - 'multiple'=>true, - 'options'=>$options - ) - ); - $options = array(); - $allGroups = $dms->getAllGroups(); - foreach ($allGroups as $groupObj) { - if ($folder->getGroupAccessMode($groupObj) >= M_READ) - $options[] = array($groupObj->getID(), htmlspecialchars($groupObj->getName())); - } - $this->formField( - getMLText("groups"), - array( - 'element'=>'select', - 'name'=>'notification_groups[]', - 'class'=>'chzn-select', - 'attributes'=>array(array('data-placeholder', getMLText('select_grp_notification'))), - 'multiple'=>true, - 'options'=>$options - ) - ); - $this->contentContainerEnd(); - } $this->columnEnd(); $this->rowEnd(); $this->formSubmit(" ".getMLText('add_document'));