replace table layout with form controlls

This commit is contained in:
Uwe Steinmann 2018-06-21 09:28:31 +02:00
parent 535a91db7e
commit e37e21214a

View File

@ -181,181 +181,164 @@ $(document).ready(function() {
// privileges. // privileges.
$docAccess = $folder->getReadAccessList($enableadminrevapp, $enableownerrevapp); $docAccess = $folder->getReadAccessList($enableadminrevapp, $enableownerrevapp);
?> ?>
<form action="../op/op.AddDocument.php" enctype="multipart/form-data" method="post" id="form1" name="form1"> <form class="form-horizontal" action="../op/op.AddDocument.php" enctype="multipart/form-data" method="post" id="form1" name="form1">
<?php echo createHiddenFieldWithKey('adddocument'); ?> <?php echo createHiddenFieldWithKey('adddocument'); ?>
<input type="hidden" name="folderid" value="<?php print $folderid; ?>"> <input type="hidden" name="folderid" value="<?php print $folderid; ?>">
<input type="hidden" name="showtree" value="<?php echo showtree();?>"> <input type="hidden" name="showtree" value="<?php echo showtree();?>">
<table class="table-condensed">
<tr>
<td>
<?php $this->contentSubHeading(getMLText("document_infos")); ?>
</td>
</tr>
<tr>
<td><?php printMLText("name");?>:</td>
<td><input type="text" name="name" size="60"></td>
</tr>
<tr>
<td><?php printMLText("comment");?>:</td>
<td><textarea name="comment" rows="3" cols="80"<?php echo $strictformcheck ? ' required' : ''; ?>></textarea></td>
</tr>
<tr>
<td><?php printMLText("keywords");?>:</td>
<td><?php $this->printKeywordChooserHtml("form1");?></td>
</tr>
<tr>
<td><?php printMLText("categories")?>:</td>
<td>
<select class="chzn-select" name="categories[]" multiple="multiple" data-placeholder="<?php printMLText('select_category'); ?>" data-no_results_text="<?php printMLText('unknown_document_category'); ?>">
<?php <?php
$this->contentSubHeading(getMLText("document_infos"));
$this->formField(
getMLText("name"),
array(
'element'=>'input',
'type'=>'text',
'id'=>'name',
'name'=>'name',
'required'=>true
)
);
$this->formField(
getMLText("comment"),
array(
'element'=>'textarea',
'name'=>'comment',
'rows'=>4,
'cols'=>80,
'required'=>$strictformcheck
)
);
$this->formField(
getMLText("keywords"),
$this->getKeywordChooserHtml('form1')
);
$options = array();
$categories = $dms->getDocumentCategories(); $categories = $dms->getDocumentCategories();
foreach($categories as $category) { foreach($categories as $category) {
echo "<option value=\"".$category->getID()."\""; $options[] = array($category->getID(), $category->getName());
echo ">".$category->getName()."</option>";
} }
?> $this->formField(
</select> getMLText("categories"),
</td> array(
</tr> 'element'=>'select',
<tr> 'class'=>'chzn-select',
<td><?php printMLText("sequence");?>:</td> 'name'=>'categories[]',
<td><?php $this->printSequenceChooser($folder->getDocuments('s')); if($orderby != 's') echo "<br />".getMLText('order_by_sequence_off'); ?></td> 'multiple'=>true,
</tr> 'attributes'=>array(array('data-placeholder', getMLText('select_category'), array('data-no_results_text', getMLText('unknown_document_category')))),
<?php 'options'=>$options
)
);
$this->formField(getMLText("sequence"), $this->getSequenceChooser($folder->getDocuments('s')).($orderby != 's' ? "<br />".getMLText('order_by_sequence_off') : ''));
if($presetexpiration) { if($presetexpiration) {
if(!($expts = strtotime($presetexpiration))) if(!($expts = strtotime($presetexpiration)))
$expts = false; $expts = false;
} else { } else {
$expts = false; $expts = false;
} }
?> $options = array();
<tr> $options[] = array('never', getMLText('does_not_expire'));
<td><?php printMLText("preset_expires");?>:</td> $options[] = array('date', getMLText('expire_by_date'), $expts);
<td> $options[] = array('1w', getMLText('expire_in_1w'));
<select class="span3" name="presetexpdate" id="presetexpdate"> $options[] = array('1m', getMLText('expire_in_1m'));
<option value="never"><?php printMLText('does_not_expire');?></option> $options[] = array('1y', getMLText('expire_in_1y'));
<option value="date"<?php echo ($expts != '' ? " selected" : ""); ?>><?php printMLText('expire_by_date');?></option> $options[] = array('2y', getMLText('expire_in_2y'));
<option value="1w"><?php printMLText('expire_in_1w');?></option> $this->formField(
<option value="1m"><?php printMLText('expire_in_1m');?></option> getMLText("preset_expires"),
<option value="1y"><?php printMLText('expire_in_1y');?></option> array(
<option value="2y"><?php printMLText('expire_in_2y');?></option> 'element'=>'select',
</select> 'id'=>'presetexpdate',
</td> 'name'=>'presetexpdate',
</tr> 'options'=>$options
<tr id="control_expdate" <?php echo ($expts == false ? 'style="display: none;"' : ''); ?>> )
<td><?php printMLText("expires");?>:</td> );
<td> $this->formField(
<span class="input-append date span6" id="expirationdate" data-date="<?php echo ($expts ? date('Y-m-d', $expts) : ''); ?>" data-date-format="yyyy-mm-dd" data-date-language="<?php echo str_replace('_', '-', $this->params['session']->getLanguage()); ?>" data-checkbox="#expires"> getMLText("expires"),
<input class="span3" size="16" name="expdate" type="text" value="<?php echo ($expts ? date('Y-m-d', $expts) : ''); ?>"> $this->getDateChooser(($expts ? date('Y-m-d', $expts) : ''), "expdate", $this->params['session']->getLanguage())
<span class="add-on"><i class="icon-calendar"></i></span> );
</span> if($user->isAdmin()) {
</td> $options = array();
</tr>
<?php if($user->isAdmin()) { ?>
<tr>
<td><?php printMLText("owner");?>:</td>
<td>
<select class="chzn-select" name="ownerid">
<?php
$allUsers = $dms->getAllUsers($sortusersinlist); $allUsers = $dms->getAllUsers($sortusersinlist);
foreach ($allUsers as $currUser) { foreach ($allUsers as $currUser) {
if ($currUser->isGuest()) if (!$currUser->isGuest())
continue; $options[] = array($currUser->getID(), htmlspecialchars($currUser->getLogin()), ($currUser->getID()==$user->getID()), array(array('data-subtitle', htmlspecialchars($currUser->getFullName()))));
print "<option value=\"".$currUser->getID()."\" ".($currUser->getID()==$user->getID() ? 'selected' : '')." data-subtitle=\"".htmlspecialchars($currUser->getFullName())."\""; }
print ">" . htmlspecialchars($currUser->getLogin()) . "</option>\n"; $this->formField(
getMLText("owner"),
array(
'element'=>'select',
'id'=>'ownerid',
'name'=>'ownerid',
'class'=>'chzn-select',
'options'=>$options
)
);
} }
?>
</select>
</td>
</tr>
<?php } ?>
<?php
$attrdefs = $dms->getAllAttributeDefinitions(array(SeedDMS_Core_AttributeDefinition::objtype_document, SeedDMS_Core_AttributeDefinition::objtype_all)); $attrdefs = $dms->getAllAttributeDefinitions(array(SeedDMS_Core_AttributeDefinition::objtype_document, SeedDMS_Core_AttributeDefinition::objtype_all));
if($attrdefs) { if($attrdefs) {
foreach($attrdefs as $attrdef) { foreach($attrdefs as $attrdef) {
$arr = $this->callHook('addDocumentAttribute', null, $attrdef); $arr = $this->callHook('addDocumentAttribute', null, $attrdef);
if(is_array($arr)) { if(is_array($arr)) {
if($arr) { if($arr) {
echo "<tr>"; $this->formField($arr[0], $arr[1]);
echo "<td>".$arr[0].":</td>";
echo "<td>".$arr[1]."</td>";
echo "</tr>";
} }
} else { } else {
?> $this->formField(htmlspecialchars($attrdef->getName()), $this->getAttributeEditField($attrdef, ''));
<tr>
<td><?php echo htmlspecialchars($attrdef->getName()); ?></td>
<td><?php $this->printAttributeEditField($attrdef, '') ?></td>
</tr>
<?php
} }
} }
} }
$arrs = $this->callHook('addDocumentAttributes', $folder); $arrs = $this->callHook('addDocumentAttributes', $folder);
if(is_array($arrs)) { if(is_array($arrs)) {
foreach($arrs as $arr) { foreach($arrs as $arr) {
echo "<tr>"; $this->formField($arr[0], $arr[1]);
echo "<td>".$arr[0].":</td>";
echo "<td>".$arr[1]."</td>";
echo "</tr>";
} }
} }
?>
<tr> $this->contentSubHeading(getMLText("version_info"));
<td> $this->formField(
<?php $this->contentSubHeading(getMLText("version_info")); ?> getMLText("version"),
</td> array(
</tr> 'element'=>'input',
<tr> 'type'=>'text',
<td><?php printMLText("version");?>:</td> 'id'=>'reqversion',
<td><input type="text" name="reqversion" value="1"></td> 'name'=>'reqversion',
</tr> 'value'=>1
<tr> )
<td><?php printMLText("local_file");?>:</td> );
<td> $this->formField(
<?php getMLText("local_file"),
if($enablelargefileupload) $enablelargefileupload ? $this->getFineUploaderHtml() : $this->printFileChooser('userfile[]', false).($enablemultiupload ? '<a class="" id="new-file"><?php printMLtext("add_multiple_files") ?></a>' : '')
$this->printFineUploaderHtml(); );
else { if($dropfolderdir) {
$this->printFileChooser('userfile[]', false); $this->formField(
if($enablemultiupload) { getMLText("dropfolder_file"),
?> $this->getDropFolderChooserHtml("form1", $dropfolderfile)
<a class="" id="new-file"><?php printMLtext("add_multiple_files") ?></a> );
<?php
} }
} $this->formField(
?> getMLText("comment_for_current_version"),
</td> array(
</tr> 'element'=>'textarea',
<?php if($dropfolderdir) { ?> 'name'=>'version_comment',
<tr> 'rows'=>4,
<td><?php printMLText("dropfolder_file");?>:</td> 'cols'=>80
<td><?php $this->printDropFolderChooserHtml("form1", $dropfolderfile);?></td> )
</tr> );
<?php } ?> $this->formField(
<tr> getMLText("use_comment_of_document"),
<td><?php printMLText("comment_for_current_version");?>:</td> array(
<td><textarea name="version_comment" rows="3" cols="80"></textarea><br /> 'element'=>'input',
<label class="checkbox inline"><input type="checkbox" name="use_comment" value="1" /> <?php printMLText("use_comment_of_document"); ?></label></td> 'type'=>'checkbox',
</tr> 'name'=>'use_comment',
<?php 'value'=>1
)
);
$attrdefs = $dms->getAllAttributeDefinitions(array(SeedDMS_Core_AttributeDefinition::objtype_documentcontent, SeedDMS_Core_AttributeDefinition::objtype_all)); $attrdefs = $dms->getAllAttributeDefinitions(array(SeedDMS_Core_AttributeDefinition::objtype_documentcontent, SeedDMS_Core_AttributeDefinition::objtype_all));
if($attrdefs) { if($attrdefs) {
foreach($attrdefs as $attrdef) { foreach($attrdefs as $attrdef) {
$arr = $this->callHook('addDocumentContentAttribute', null, $attrdef); $arr = $this->callHook('addDocumentContentAttribute', null, $attrdef);
if(is_array($arr)) { if(is_array($arr)) {
echo "<tr>"; $this->formField($arr[0], $arr[1]);
echo "<td>".$arr[0].":</td>";
echo "<td>".$arr[1]."</td>";
echo "</tr>";
} else { } else {
?> $this->formField(htmlspecialchars($attrdef->getName()), $this->getAttributeEditField($attrdef, '', 'attributes_version'));
<tr>
<td><?php echo htmlspecialchars($attrdef->getName()); ?></td>
<td><?php $this->printAttributeEditField($attrdef, '', 'attributes_version') ?></td>
</tr>
<?php
} }
} }
} }
@ -363,92 +346,82 @@ $(document).ready(function() {
$arrs = $this->callHook('addDocumentContentAttributes', $folder); $arrs = $this->callHook('addDocumentContentAttributes', $folder);
if(is_array($arrs)) { if(is_array($arrs)) {
foreach($arrs as $arr) { foreach($arrs as $arr) {
echo "<tr>"; $this->formField($arr[0], $arr[1]);
echo "<td>".$arr[0].":</td>";
echo "<td>".$arr[1]."</td>";
echo "</tr>";
} }
} }
if($workflowmode == 'advanced') { if($workflowmode == 'advanced') {
?> ?>
<tr>
<td>
<div class="cbSelectTitle"><?php printMLText("workflow");?>:</div> <div class="cbSelectTitle"><?php printMLText("workflow");?>:</div>
</td>
<td>
<?php <?php
$mandatoryworkflows = $user->getMandatoryWorkflows(); $mandatoryworkflows = $user->getMandatoryWorkflows();
if($mandatoryworkflows) { if($mandatoryworkflows) {
if(count($mandatoryworkflows) == 1) { if(count($mandatoryworkflows) == 1) {
?> $this->formField(
<?php echo htmlspecialchars($mandatoryworkflows[0]->getName()); ?> getMLText("workflow"),
<input type="hidden" name="workflow" value="<?php echo $mandatoryworkflows[0]->getID(); ?>"> htmlspecialchars($mandatoryworkflows[0]->getName()).'<input type="hidden" name="workflow" value="'.$mandatoryworkflows[0]->getID().'">'
<?php );
} else { } else {
?> $options = array();
<select class="_chzn-select-deselect span9" name="workflow" data-placeholder="<?php printMLText('select_workflow'); ?>">
<?php
foreach ($mandatoryworkflows as $workflow) { foreach ($mandatoryworkflows as $workflow) {
print "<option value=\"".$workflow->getID()."\""; $options[] = array($workflow->getID(), htmlspecialchars($workflow->getName()));
print ">". htmlspecialchars($workflow->getName())."</option>";
} }
?> $this->formField(
</select> getMLText("owner"),
<?php array(
'element'=>'select',
'id'=>'workflow',
'name'=>'workflow',
'class'=>'chzn-select-deselect',
'attributes'=>array(array('data-placeholder', getMLText('select_workflow'))),
'options'=>$options
)
);
} }
} else { } else {
?> $options = array();
<select class="_chzn-select-deselect span9" name="workflow" data-placeholder="<?php printMLText('select_workflow'); ?>">
<?php
$workflows=$dms->getAllWorkflows(); $workflows=$dms->getAllWorkflows();
print "<option value=\"\">"."</option>";
foreach ($workflows as $workflow) { foreach ($workflows as $workflow) {
print "<option value=\"".$workflow->getID()."\""; $options[] = array($workflow->getID(), htmlspecialchars($workflow->getName()));
print ">". htmlspecialchars($workflow->getName())."</option>";
} }
?> $this->formField(
</select> getMLText("owner"),
<?php array(
'element'=>'select',
'id'=>'workflow',
'name'=>'workflow',
'class'=>'chzn-select-deselect',
'attributes'=>array(array('data-placeholder', getMLText('select_workflow'))),
'options'=>$options
)
);
} }
?> $this->warningMsg(getMLText("add_doc_workflow_warning"));
</td>
</tr>
<tr>
<td colspan="2">
<?php $this->warningMsg(getMLText("add_doc_workflow_warning")); ?>
</td>
</tr>
<?php
} else { } else {
if($workflowmode == 'traditional') { if($workflowmode == 'traditional') {
?> $this->contentSubHeading(getMLText("assign_reviewers"));
<tr> $options = array();
<td>
<?php $this->contentSubHeading(getMLText("assign_reviewers")); ?>
</td>
</tr>
<tr>
<td>
<div class="cbSelectTitle"><?php printMLText("individuals");?>:</div>
</td>
<td>
<?php
$res=$user->getMandatoryReviewers();
?>
<select class="chzn-select span9" name="indReviewers[]" multiple="multiple" data-placeholder="<?php printMLText('select_ind_reviewers'); ?>">
<?php
foreach ($docAccess["users"] as $usr) { foreach ($docAccess["users"] as $usr) {
if (!$enableselfrevapp && $usr->getID()==$user->getID()) continue; if (!$enableselfrevapp && $usr->getID()==$user->getID()) continue;
$mandatory=false; $mandatory=false;
foreach ($res as $r) if ($r['reviewerUserID']==$usr->getID()) $mandatory=true; foreach ($res as $r) if ($r['reviewerUserID']==$usr->getID()) $mandatory=true;
if ($mandatory) print "<option disabled=\"disabled\" value=\"".$usr->getID()."\">". htmlspecialchars($usr->getLogin()." - ".$usr->getFullName())."</option>"; $option = array($usr->getID(), htmlspecialchars($usr->getLogin()." - ".$usr->getFullName()), null);
else print "<option value=\"".$usr->getID()."\">". htmlspecialchars($usr->getLogin()." - ".$usr->getFullName())."</option>"; if ($mandatory) $option[] = array(array('disabled', 'disabled'));
$options[] = $option;
} }
?> $this->formField(
</select> getMLText("individuals"),
<?php array(
'element'=>'select',
'name'=>'indReviewers[]',
'class'=>'chzn-select',
'attributes'=>array(array('data-placeholder', getMLText('select_ind_reviewers'))),
'multiple'=>true,
'options'=>$options
)
);
/* List all mandatory reviewers */ /* List all mandatory reviewers */
if($res) { if($res) {
$tmp = array(); $tmp = array();
@ -479,27 +452,27 @@ $(document).ready(function() {
} }
} }
} }
?> $options = array();
</td>
</tr>
<tr>
<td>
<div class="cbSelectTitle"><?php printMLText("groups");?>:</div>
</td>
<td>
<select class="chzn-select span9" name="grpReviewers[]" multiple="multiple" data-placeholder="<?php printMLText('select_grp_reviewers'); ?>">
<?php
foreach ($docAccess["groups"] as $grp) { foreach ($docAccess["groups"] as $grp) {
$mandatory=false; $mandatory=false;
foreach ($res as $r) if ($r['reviewerGroupID']==$grp->getID()) $mandatory=true; foreach ($res as $r) if ($r['reviewerGroupID']==$grp->getID()) $mandatory=true;
if ($mandatory || !$grp->getUsers()) print "<option value=\"".$grp->getID()."\" disabled=\"disabled\">".htmlspecialchars($grp->getName())."</option>"; $option = array($grp->getID(), htmlspecialchars($grp->getName()), null);
else print "<option value=\"".$grp->getID()."\">".htmlspecialchars($grp->getName())."</option>"; if ($mandatory || !$grp->getUsers()) $option[] = array(array('disabled', 'disabled'));
$options[] = $option;
} }
?> $this->formField(
</select> getMLText("groups"),
<?php array(
'element'=>'select',
'name'=>'grpReviewers[]',
'class'=>'chzn-select',
'attributes'=>array(array('data-placeholder', getMLText('select_grp_reviewers'))),
'multiple'=>true,
'options'=>$options
)
);
/* List all mandatory groups of reviewers */ /* List all mandatory groups of reviewers */
if($res) { if($res) {
$tmp = array(); $tmp = array();
@ -529,23 +502,10 @@ $(document).ready(function() {
} }
} }
} }
?> }
</td>
</tr>
<?php } ?>
<tr>
<td>
<?php $this->contentSubHeading(getMLText("assign_approvers")); ?>
</td>
</tr>
<tr> $this->contentSubHeading(getMLText("assign_approvers"));
<td> $options = array();
<div class="cbSelectTitle"><?php printMLText("individuals");?>:</div>
</td>
<td>
<select class="chzn-select span9" name="indApprovers[]" multiple="multiple" data-placeholder="<?php printMLText('select_ind_approvers'); ?>">
<?php
$res=$user->getMandatoryApprovers(); $res=$user->getMandatoryApprovers();
foreach ($docAccess["users"] as $usr) { foreach ($docAccess["users"] as $usr) {
if (!$enableselfrevapp && $usr->getID()==$user->getID()) continue; if (!$enableselfrevapp && $usr->getID()==$user->getID()) continue;
@ -553,12 +513,22 @@ $(document).ready(function() {
$mandatory=false; $mandatory=false;
foreach ($res as $r) if ($r['approverUserID']==$usr->getID()) $mandatory=true; foreach ($res as $r) if ($r['approverUserID']==$usr->getID()) $mandatory=true;
if ($mandatory) print "<option value=\"". $usr->getID() ."\" disabled='disabled'>". htmlspecialchars($usr->getFullName())."</option>"; $option = array($usr->getID(), htmlspecialchars($usr->getLogin()." - ".$usr->getFullName()), null);
else print "<option value=\"". $usr->getID() ."\">". htmlspecialchars($usr->getLogin()." - ".$usr->getFullName())."</option>"; if ($mandatory) $option[] = array(array('disabled', 'disabled'));
$options[] = $option;
} }
?> $this->formField(
</select> getMLText("individuals"),
<?php array(
'element'=>'select',
'name'=>'indApprovers[]',
'class'=>'chzn-select',
'attributes'=>array(array('data-placeholder', getMLText('select_ind_approvers'))),
'multiple'=>true,
'options'=>$options
)
);
/* List all mandatory approvers */ /* List all mandatory approvers */
if($res) { if($res) {
$tmp = array(); $tmp = array();
@ -589,28 +559,28 @@ $(document).ready(function() {
} }
} }
} }
?> $options = array();
</td>
</tr>
<tr>
<td>
<div class="cbSelectTitle"><?php printMLText("groups");?>:</div>
</td>
<td>
<select class="chzn-select span9" name="grpApprovers[]" multiple="multiple" data-placeholder="<?php printMLText('select_grp_approvers'); ?>">
<?php
foreach ($docAccess["groups"] as $grp) { foreach ($docAccess["groups"] as $grp) {
$mandatory=false; $mandatory=false;
foreach ($res as $r) if ($r['approverGroupID']==$grp->getID()) $mandatory=true; foreach ($res as $r) if ($r['approverGroupID']==$grp->getID()) $mandatory=true;
if ($mandatory || !$grp->getUsers()) print "<option value=\"". $grp->getID() ."\" disabled=\"disabled\">".htmlspecialchars($grp->getName())."</option>"; $option = array($grp->getID(), htmlspecialchars($grp->getName()), null);
else print "<option value=\"". $grp->getID() ."\">".htmlspecialchars($grp->getName())."</option>"; if ($mandatory || !$grp->getUsers()) $option[] = array(array('disabled', 'disabled'));
$options[] = $option;
} }
?> $this->formField(
</select> getMLText("groups"),
<?php array(
'element'=>'select',
'name'=>'grpApprovers[]',
'class'=>'chzn-select',
'attributes'=>array(array('data-placeholder', getMLText('select_grp_approvers'))),
'multiple'=>true,
'options'=>$options
)
);
/* List all mandatory groups of approvers */ /* List all mandatory groups of approvers */
if($res) { if($res) {
$tmp = array(); $tmp = array();
@ -642,57 +612,47 @@ $(document).ready(function() {
} }
} }
?> ?>
</td>
</tr>
<tr>
<td colspan="2">
<div class="alert"><?php printMLText("add_doc_reviewer_approver_warning")?></div> <div class="alert"><?php printMLText("add_doc_reviewer_approver_warning")?></div>
</td>
</tr>
<?php <?php
} }
?> $this->contentSubHeading(getMLText("add_document_notify"));
<tr>
<td>
<?php $this->contentSubHeading(getMLText("add_document_notify")); ?>
</td>
</tr>
<tr> $options = array();
<td>
<div class="cbSelectTitle"><?php printMLText("individuals");?>:</div>
</td>
<td>
<select class="chzn-select span9" name="notification_users[]" multiple="multiple" data-placeholder="<?php printMLText('select_ind_notification'); ?>">
<?php
$allUsers = $dms->getAllUsers($sortusersinlist); $allUsers = $dms->getAllUsers($sortusersinlist);
foreach ($allUsers as $userObj) { foreach ($allUsers as $userObj) {
if (!$userObj->isGuest() && $folder->getAccessMode($userObj) >= M_READ) if (!$userObj->isGuest() && $folder->getAccessMode($userObj) >= M_READ)
print "<option value=\"".$userObj->getID()."\">" . htmlspecialchars($userObj->getLogin() . " - " . $userObj->getFullName()) . "\n"; $options[] = array($userObj->getID(), htmlspecialchars($userObj->getLogin() . " - " . $userObj->getFullName()));
} }
?> $this->formField(
</select> getMLText("individuals"),
</td> array(
</tr> 'element'=>'select',
<tr> 'name'=>'notification_users[]',
<td> 'class'=>'chzn-select',
<div class="cbSelectTitle"><?php printMLText("groups");?>:</div> 'attributes'=>array(array('data-placeholder', getMLText('select_ind_notification'))),
</td> 'multiple'=>true,
<td> 'options'=>$options
<select class="chzn-select span9" name="notification_groups[]" multiple="multiple" data-placeholder="<?php printMLText('select_grp_notification'); ?>"> )
<?php );
$options = array();
$allGroups = $dms->getAllGroups(); $allGroups = $dms->getAllGroups();
foreach ($allGroups as $groupObj) { foreach ($allGroups as $groupObj) {
if ($folder->getGroupAccessMode($groupObj) >= M_READ) if ($folder->getGroupAccessMode($groupObj) >= M_READ)
print "<option value=\"".$groupObj->getID()."\">" . htmlspecialchars($groupObj->getName()) . "\n"; $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->formSubmit("<i class=\"icon-save\"></i> ".getMLText('add_document'));
?> ?>
</select>
</td>
</tr>
</table>
<p><input type="submit" class="btn" value="<?php printMLText("add_document");?>"></p>
</form> </form>
<?php <?php
$this->contentContainerEnd(); $this->contentContainerEnd();