pass form field by array to formField()

This commit is contained in:
Uwe Steinmann 2018-06-07 07:46:19 +02:00
parent 7c4538193a
commit 00bbda39bb
26 changed files with 446 additions and 136 deletions

View File

@ -96,11 +96,22 @@ $(document).ready(function() {
);
$this->formField(
getMLText("name"),
'<input type="text" name="name" size="60">'
array(
'element'=>'input',
'type'=>'text',
'id'=>'name',
'name'=>'name',
'required'=>true
)
);
$this->formField(
getMLText("comment"),
'<textarea name="comment" rows="4" cols="80"></textarea>'
array(
'element'=>'textarea',
'name'=>'comment',
'rows'=>4,
'cols'=>80
)
);
$this->formSubmit(getMLText('add_event'));
?>

View File

@ -157,28 +157,52 @@ $(document).ready( function() {
getMLText("local_file"),
($enablelargefileupload ? $this->getFineUploaderHtml() : $this->getFileChooser('userfile[]', false))
);
$html = '<select name="version" id="version">
<option value="">'.getMLText('document').'</option>';
$options = array();
$options[] = array("", getMLText('document'));
$versions = $document->getContent();
foreach($versions as $version)
$html .= "<option value=\"".$version->getVersion()."\">".getMLText('version')." ".$version->getVersion()."</option>";
$html .= '</select>';
foreach($versions as $version) {
$options[] = array($version->getVersion(), getMLText('version')." ".$version->getVersion());
}
$this->formField(
getMLText("version"),
$html
array(
'element'=>'select',
'id'=>'version',
'name'=>'version',
'options'=>$options
)
);
$this->formField(
getMLText("name"),
'<input type="text" name="name" id="name" size="60">'
array(
'element'=>'input',
'type'=>'text',
'id'=>'name',
'name'=>'name',
)
);
$this->formField(
getMLText("comment"),
'<textarea name="comment" id="comment" rows="4" cols="80"'.($strictformcheck ? ' required' : '').'></textarea>'
array(
'element'=>'textarea',
'id'=>'comment',
'name'=>'comment',
'rows'=>4,
'cols'=>80,
'required'=>$strictformcheck
)
);
if ($document->getAccessMode($user) >= M_READWRITE) {
$this->formField(
getMLText("document_link_public"),
'<input type="checkbox" name="public" value="true" checked />'
array(
'element'=>'input',
'type'=>'checkbox',
'id'=>'public',
'name'=>'public',
'value'=>'true',
'checked'=>true,
)
);
}
$this->formSubmit(getMLText('add'));

View File

@ -86,11 +86,23 @@ $(document).ready( function() {
<?php
$this->formField(
getMLText("name"),
'<input type="text" name="name" size="60" required>'
array(
'element'=>'input',
'type'=>'text',
'id'=>'name',
'name'=>'name',
'required'=>true
)
);
$this->formField(
getMLText("comment"),
'<textarea name="comment" rows="4" cols="80"'.($strictformcheck ? ' required' : '').'></textarea>'
array(
'element'=>'textarea',
'name'=>'comment',
'rows'=>4,
'cols'=>80,
'required'=>$strictformcheck
)
);
$this->formField(getMLText("sequence"), $this->getSequenceChooser($folder->getSubFolders('s')).($orderby != 's' ? "<br />".getMLText('order_by_sequence_off') : ''));

View File

@ -134,15 +134,29 @@ $(document).ready(function() {
<?php
$this->formField(
getMLText("comment"),
'<textarea name="comment" cols="80" rows="4"></textarea>'
array(
'element'=>'textarea',
'name'=>'comment',
'rows'=>4,
'cols'=>80
)
);
$this->formField(
getMLText("approval_file"),
$this->getFileChooser('approvalfile', false)
);
$options = array();
if($approvalStatus['status'] != 1)
$options[] = array('1', getMLText("status_approved"));
if($approvalStatus['status'] != -1)
$options[] = array('-1', getMLText("rejected"));
$this->formField(
getMLText("approval_status"),
'<select name="approvalStatus">'.($approvalStatus['status'] != 1 ? '<option value="1">'.getMLText("status_approved").'</option>' : '').($approvalStatus['status'] != -1 ? '<option value="-1">'.getMLText("rejected").'</option>' : '').'</select>'
array(
'element'=>'select',
'name'=>'approvalStatus',
'options'=>$options,
)
);
$this->formSubmit(getMLText('submit_approval'), $approvaltype.'Approval');
?>

View File

@ -191,7 +191,12 @@ $(document).ready( function() {
}
$this->formField(
getMLText("attrdef_name"),
'<input type="text" name="name" value="'.($attrdef ? htmlspecialchars($attrdef->getName()) : '').'">'
array(
'element'=>'input',
'type'=>'text',
'name'=>'name',
'value'=>($attrdef ? htmlspecialchars($attrdef->getName()) : '')
)
);
?>
<div class="control-group">
@ -213,24 +218,56 @@ $(document).ready( function() {
<?php
$this->formField(
getMLText("attrdef_multiple"),
'<input type="checkbox" value="1" name="multiple"'.($attrdef && $attrdef->getMultipleValues() ? " checked" : "").'/>'
array(
'element'=>'input',
'type'=>'checkbox',
'name'=>'multiple',
'value'=>1,
'checked'=>($attrdef && $attrdef->getMultipleValues())
)
);
$this->formField(
getMLText("attrdef_minvalues"),
'<input type="text" value="'.($attrdef ? $attrdef->getMinValues() : '').'" name="minvalues" />'
array(
'element'=>'input',
'type'=>'text',
'name'=>'minvalues',
'value'=>($attrdef ? $attrdef->getMinValues() : ''),
)
);
$this->formField(
getMLText("attrdef_maxvalues"),
'<input type="text" value="'.($attrdef ? $attrdef->getMaxValues() : '').'" name="maxvalues" />'
array(
'element'=>'input',
'type'=>'text',
'name'=>'maxvalues',
'value'=>($attrdef ? $attrdef->getMaxValues() : ''),
)
);
$this->formField(
getMLText("attrdef_valueset"),
(($attrdef && strlen($attrdef->getValueSet()) > 30) ? '<textarea name="valueset" rows="5">'.(($attrdef && $attrdef->getValueSet()) ? $attrdef->getValueSetSeparator().implode("\n".$attrdef->getValueSetSeparator(), $attrdef->getValueSetAsArray()) : '').'</textarea>
' : '<input type="text" value="'.($attrdef ? $attrdef->getValueSet() : '').'" name="valueset" />')
(($attrdef && strlen($attrdef->getValueSet()) > 30)
? array(
'element'=>'textarea',
'name'=>'valueset',
'rows'=>5,
'value'=>(($attrdef && $attrdef->getValueSet()) ? $attrdef->getValueSetSeparator().implode("\n".$attrdef->getValueSetSeparator(), $attrdef->getValueSetAsArray()) : ''),
)
: array(
'element'=>'input',
'type'=>'text',
'name'=>'valueset',
'value'=>($attrdef ? $attrdef->getValueSet() : ''),
))
);
$this->formField(
getMLText("attrdef_regex"),
'<input type="text" value="'.($attrdef ? $attrdef->getRegex() : '').'" name="regex" />'
array(
'element'=>'input',
'type'=>'text',
'name'=>'regex',
'value'=>($attrdef ? $attrdef->getRegex() : ''),
)
);
$this->formSubmit('<i class="icon-save"></i> '.getMLText('save'));
?>

View File

@ -845,15 +845,36 @@ background-image: linear-gradient(to bottom, #882222, #111111);;
echo $value;
} elseif(is_array($value)) {
switch($value['element']) {
case 'select':
echo '<select'.
(!empty($value['id']) ? ' id="'.$value['id'].'"' : '').
(!empty($value['name']) ? ' name="'.$value['name'].'"' : '').
(!empty($value['multiple']) ? ' multiple"' : '').">";
if(isset($value['options']) && is_array($value['options'])) {
foreach($value['options'] as $val)
echo '<option value="'.$val[0].'"'.(!empty($val[2]) ? ' selected' : '').'>'.$val[1].'</option>';
}
echo '</select>';
break;
case 'textarea':
echo '<textarea'.
(!empty($value['id']) ? ' id="'.$value['id'].'"' : '').
(!empty($value['name']) ? ' name="'.$value['name'].'"' : '').
(!empty($value['rows']) ? ' rows="'.$value['rows'].'"' : '').
(!empty($value['cols']) ? ' rows="'.$value['cols'].'"' : '').
(!empty($value['required']) ? ' required' : '').">".(!empty($value['value']) ? $value['value'] : '')."</textarea>";
break;
case 'input':
default:
echo '<input'.
(!empty($value['type']) ? ' type="'.$value['type'].'"' : '').
(!empty($value['id']) ? ' id="'.$value['id'].'"' : '').
(!empty($value['name']) ? ' name="'.$value['name'].'"' : '').
(!empty($value['placeholder']) ? ' placeholder="'.$value['placeholder'].'"' : '').
(!empty($value['autocomplete']) ? ' autocomplete="'.$value['autocomplete'].'"' : '').
(!empty($value['required']) ? ' required' : '').">";
echo '<input'.
(!empty($value['type']) ? ' type="'.$value['type'].'"' : '').
(!empty($value['id']) ? ' id="'.$value['id'].'"' : '').
(!empty($value['name']) ? ' name="'.$value['name'].'"' : '').
(!empty($value['value']) ? ' value="'.$value['value'].'"' : '').
(!empty($value['placeholder']) ? ' placeholder="'.$value['placeholder'].'"' : '').
(!empty($value['autocomplete']) ? ' autocomplete="'.$value['autocomplete'].'"' : '').
(!empty($value['checked']) ? ' checked' : '').
(!empty($value['required']) ? ' required' : '').">";
break;
}
}

View File

@ -81,11 +81,23 @@ class SeedDMS_View_Calendar extends SeedDMS_Bootstrap_Style {
);
$this->formField(
getMLText("name"),
'<input type="text" name="name" value="'.htmlspecialchars($event["name"]).'" size="60" required>'
array(
'element'=>'input',
'type'=>'text',
'name'=>'name',
'value'=>htmlspecialchars($event["name"])
)
);
$this->formField(
getMLText("comment"),
'<textarea name="comment" rows="4" cols="80"'.($strictformcheck ? ' required' : '').'>'.htmlspecialchars($event["comment"]).'</textarea>'
array(
'element'=>'textarea',
'name'=>'comment',
'rows'=>4,
'cols'=>80,
'value'=>htmlspecialchars($event["comment"]),
'required'=>$strictformcheck
)
);
$this->formSubmit("<i class=\"icon-save\"></i> ".getMLText('save'));
?>

View File

@ -113,7 +113,12 @@ $(document).ready( function() {
<?php
$this->formField(
getMLText("name"),
'<input type="text" name="name" value="'.($category ? htmlspecialchars($category->getName()) : '').'">'
array(
'element'=>'input',
'type'=>'text',
'name'=>'name',
'value'=>($category ? htmlspecialchars($category->getName()) : '')
)
);
$this->formSubmit("<i class=\"icon-save\"></i> ".getMLText('save'));
?>

View File

@ -74,7 +74,13 @@ document.form1.newpassword.focus();
}
$this->formField(
getMLText("confirm_pwd"),
'<input type="password" name="newpasswordrepeat" id="passwordrepeat">'
array(
'element'=>'input',
'type'=>'password',
'id'=>'passwordrepeat',
'name'=>'newpasswordrepeat',
'autocomplete'=>'off',
)
);
$this->formSubmit(getMLText('submit_password'));
?>

View File

@ -91,7 +91,13 @@ $(document).ready(function() {
<?php
$this->formField(
getMLText("comment"),
'<textarea name="comment" rows="4" cols="80">'.htmlspecialchars($version->getComment()).'</textarea>'
array(
'element'=>'textarea',
'name'=>'comment',
'rows'=>4,
'cols'=>80,
'value'=>htmlspecialchars($version->getComment())
)
);
$this->formSubmit("<i class=\"icon-save\"></i> ".getMLText('save'));
?>

View File

@ -51,27 +51,48 @@ class SeedDMS_View_EditDocumentFile extends SeedDMS_Bootstrap_Style {
<input type="hidden" name="documentid" value="<?php echo $document->getID()?>">
<input type="hidden" name="fileid" value="<?php echo $file->getID()?>">
<?php
$html = '<select name="version" id="version">
<option value="">'.getMLText('document').'</option>';
$options = array();
$options[] = array("", getMLText('document'));
$versions = $document->getContent();
foreach($versions as $version)
$html .= "<option value=\"".$version->getVersion()."\"".($version->getVersion() == $file->getVersion() ? " selected" : "").">".getMLText('version')." ".$version->getVersion()."</option>";
$html .= "</select>";
$options[] = array($version->getVersion(), getMLText('version')." ".$version->getVersion(), $version->getVersion() == $file->getVersion());
$this->formField(
getMLText("version"),
$html
array(
'element'=>'select',
'name'=>'version',
'id'=>'version',
'options'=>$options,
)
);
$this->formField(
getMLText("name"),
'<input name="name" type="text" value="'.htmlspecialchars($file->getName()).'"/>'
array(
'element'=>'input',
'type'=>'text',
'name'=>'name',
'value'=>htmlspecialchars($file->getName()),
)
);
$this->formField(
getMLText("comment"),
'<textarea name="comment" rows="4" cols="80">'.htmlspecialchars($file->getComment()).'</textarea>'
array(
'element'=>'textarea',
'name'=>'comment',
'rows'=>4,
'cols'=>80,
'value'=>htmlspecialchars($file->getComment())
)
);
$this->formField(
getMLText("document_link_public"),
'<input name="public" type="checkbox" value="true"'.($file->isPublic() ? " checked" : "").' />'
array(
'element'=>'input',
'type'=>'checkbox',
'name'=>'public',
'value'=>'true',
'checked'=>$file->isPublic()
)
);
?>
<?php

View File

@ -86,11 +86,24 @@ $(document).ready(function() {
<?php
$this->formField(
getMLText("name"),
'<input type="text" name="name" value="'.htmlspecialchars($folder->getName()).'" size="60" required>'
array(
'element'=>'input',
'type'=>'text',
'name'=>'name',
'value'=>htmlspecialchars($folder->getName()),
'required'=>true
)
);
$this->formField(
getMLText("comment"),
'<textarea name="comment" rows="4" cols="80"'.($strictformcheck ? ' required' : '').'>'.htmlspecialchars($folder->getComment()).'</textarea>'
array(
'element'=>'textarea',
'name'=>'comment',
'rows'=>4,
'cols'=>80,
'value'=>htmlspecialchars($folder->getComment()),
'required'=>$strictformcheck
)
);
$parent = ($folder->getID() == $rootfolderid) ? false : $folder->getParent();
if ($parent && $parent->getAccessMode($user) > M_READ) {

View File

@ -104,7 +104,14 @@ $(document).ready( function() {
<?php
$this->formField(
getMLText("current_password"),
'<input id="currentpwd" type="password" name="currentpwd" size="30">'
array(
'element'=>'input',
'type'=>'password',
'id'=>'currentpwd',
'name'=>'currentpwd',
'autocomplete'=>'off',
'required'=>true
)
);
$this->formField(
getMLText("new_password"),
@ -118,19 +125,42 @@ $(document).ready( function() {
}
$this->formField(
getMLText("confirm_pwd"),
'<input id="pwdconf" type="Password" id="pwdconf" name="pwdconf">'
array(
'element'=>'input',
'type'=>'password',
'id'=>'pwdconf',
'name'=>'pwdconf',
'autocomplete'=>'off',
)
);
$this->formField(
getMLText("name"),
'<input type="text" id="fullname" name="fullname" value="'.htmlspecialchars($user->getFullName()).'">'
array(
'element'=>'input',
'type'=>'text',
'id'=>'fullname',
'name'=>'fullname',
'value'=>htmlspecialchars($user->getFullName()),
)
);
$this->formField(
getMLText("email"),
'<input type="text" id="email" name="email" value="'.htmlspecialchars($user->getEmail()).'">'
array(
'element'=>'input',
'type'=>'text',
'id'=>'email',
'name'=>'email',
'value'=>htmlspecialchars($user->getEmail()),
)
);
$this->formField(
getMLText("comment"),
'<textarea name="comment" rows="4" cols="80">'.htmlspecialchars($user->getComment()).'</textarea>'
array(
'element'=>'textarea',
'name'=>'comment',
'rows'=>4,
'value'=>htmlspecialchars($user->getComment()),
)
);
if ($enableuserimage){
@ -144,27 +174,33 @@ $(document).ready( function() {
);
}
if ($enablelanguageselector){
$html = '<select name="language">';
$options = array();
$languages = getLanguages();
foreach ($languages as $currLang) {
$html .= "<option value=\"".$currLang."\" ".(($user->getLanguage()==$currLang) ? "selected" : "").">".getMLText($currLang)."</option>";
$options[] = array($currLang, getMLText($currLang), ($user->getLanguage()==$currLang));
}
$html .= '</select>';
$this->formField(
getMLText("language"),
$html
array(
'element'=>'select',
'name'=>'language',
'options'=>$options
)
);
}
if ($enablethemeselector){
$html = '<select name="theme">';
$options = array();
$themes = UI::getStyles();
foreach ($themes as $currTheme) {
$html .= "<option value=\"".$currTheme."\" ".(($user->getTheme()==$currTheme) ? "selected" : "").">".$currTheme."</option>";
$options[] = array($currTheme, $currTheme,($user->getTheme()==$currTheme));
}
$html .= '</select>';
$this->formField(
getMLText("theme"),
$html
array(
'element'=>'select',
'name'=>'theme',
'options'=>$options
)
);
}
$this->formSubmit("<i class=\"icon-save\"></i> ".getMLText('save'));

View File

@ -191,11 +191,23 @@ $(document).ready( function() {
}
$this->formField(
getMLText("name"),
'<input type="text" name="name" id="name" value="'.($group ? htmlspecialchars($group->getName()) : '').'">'
array(
'element'=>'input',
'type'=>'text',
'id'=>'name',
'name'=>'name',
'value'=>($group ? htmlspecialchars($group->getName()) : '')
)
);
$this->formField(
getMLText("comment"),
'<textarea name="comment" id="comment" rows="4" cols="50">'.($group ? htmlspecialchars($group->getComment()) : '').'</textarea>'
array(
'element'=>'textarea',
'id'=>'comment',
'name'=>'comment',
'rows'=>4,
'value'=>($group ? htmlspecialchars($group->getComment()) : '')
)
);
$this->formSubmit("<i class=\"icon-save\"></i> ".getMLText('save'));
?>

View File

@ -69,7 +69,12 @@ class SeedDMS_View_ImportFS extends SeedDMS_Bootstrap_Style {
$this->formField(
getMLText("removeFolderFromDropFolder"),
'<input type="checkbox" name="remove" value="1"/>'
array(
'element'=>'input',
'type'=>'checkbox',
'name'=>'remove',
'value'=>'1'
)
);
$this->formSubmit("<i class=\"icon-save\"></i> ".getMLText('import'));
print "</form>\n";

View File

@ -90,16 +90,25 @@ $(document).ready(function() {
<?php
$this->formField(
getMLText("comment"),
'<textarea name="comment" rows="4" cols="40"></textarea>'
array(
'element'=>'textarea',
'name'=>'comment',
'rows'=>4,
)
);
$html = '<select name="overrideStatus">
<option value=""></option>';
if ($overallStatus["status"] == S_OBSOLETE) $html .= "<option value='".S_RELEASED."'>".getOverallStatusText(S_RELEASED)."</option>";
if ($overallStatus["status"] == S_RELEASED) $html .= "<option value='".S_OBSOLETE."'>".getOverallStatusText(S_OBSOLETE)."</option>";
$html .= "</select>";
$options = array();
$options[] = array('', '');
if ($overallStatus["status"] == S_OBSOLETE)
$options[] = array(S_RELEASED, getOverallStatusText(S_RELEASED));
if ($overallStatus["status"] == S_RELEASED)
$options[] = array(S_OBSOLETE, getOverallStatusText(S_OBSOLETE));
$this->formField(
getMLText("status"),
$html
array(
'element'=>'select',
'name'=>'overrideStatus',
'options'=>$options,
)
);
$this->formSubmit("<i class=\"icon-save\"></i> ".getMLText('update'));
?>

View File

@ -83,11 +83,27 @@ document.form1.email.focus();
<?php
$this->formField(
getMLText("user_login"),
'<input type="text" name="login" id="login">'
array(
'element'=>'input',
'type'=>'text',
'id'=>'login',
'name'=>'login',
'placeholder'=>'login',
'autocomplete'=>'off',
'required'=>true
)
);
$this->formField(
getMLText("email"),
'<input type="text" name="email" id="email">'
array(
'element'=>'input',
'type'=>'text',
'id'=>'email',
'name'=>'email',
'placeholder'=>'email',
'autocomplete'=>'off',
'required'=>true
)
);
$this->formSubmit(getMLText('submit_password_forgotten'));
?>

View File

@ -49,7 +49,10 @@ class SeedDMS_View_SendLoginData extends SeedDMS_Bootstrap_Style {
<?php
$this->formField(
getMLText("comment"),
'<textarea name="comment"></textarea>'
array(
'element'=>'textarea',
'name'=>'comment',
)
);
$this->formSubmit("<i class=\"icon-envelope-alt\"></i> ".getMLText('send_email'));
?>

View File

@ -67,18 +67,21 @@ $(document).ready( function() {
<form class="form-horizontal" action="../op/op.SetExpires.php" method="post">
<input type="hidden" name="documentid" value="<?php print $document->getID();?>">
<?php
$html ='
<select name="presetexpdate" id="presetexpdate">
<option value="never">'.getMLText('does_not_expire').'</option>
<option value="date"'.($expdate != '' ? " selected" : "").'>'.getMLText('expire_by_date').'</option>
<option value="1w">'.getMLText('expire_in_1w').'</option>
<option value="1m">'.getMLText('expire_in_1m').'</option>
<option value="1y">'.getMLText('expire_in_1y').'</option>
<option value="2y">'.getMLText('expire_in_2y').'</option>
</select>';
$options = array();
$options[] = array('never', getMLText('does_not_expire'));
$options[] = array('date', getMLText('expire_by_date'), $expdate != '');
$options[] = array('1w', getMLText('expire_in_1w'));
$options[] = array('1m', getMLText('expire_in_1m'));
$options[] = array('1y', getMLText('expire_in_1y'));
$options[] = array('2y', getMLText('expire_in_2y'));
$this->formField(
getMLText("preset_expires"),
$html
array(
'element'=>'select',
'id'=>'presetexpdate',
'name'=>'presetexpdate',
'options'=>$options
)
);
$this->formField(
getMLText("expires"),

View File

@ -83,19 +83,21 @@ $(document).ready( function() {
<input type="hidden" name="showtree" value="<?php echo showtree();?>">
<?php
$html = "<select id=\"selector\" class=\"_chzn-select-deselect\" name=\"workflow\" data-placeholder=\"".getMLText('select_workflow')."\">";
$mandatoryworkflow = $user->getMandatoryWorkflow();
$workflows=$dms->getAllWorkflows();
$options = array();
foreach ($workflows as $workflow) {
$html .= "<option value=\"".$workflow->getID()."\"";
if($mandatoryworkflow && $mandatoryworkflow->getID() == $workflow->getID())
$html .= " selected=\"selected\"";
$html .= ">". htmlspecialchars($workflow->getName())."</option>";
$options[] = array($workflow->getID(), htmlspecialchars($workflow->getName()), $mandatoryworkflow && $mandatoryworkflow->getID() == $workflow->getID());
}
$html .= "</select>";
$this->formField(
getMLText("workflow"),
$html
array(
'element'=>'select',
'id'=>'selector',
'name'=>'workflow',
'data-placeholder'=>getMLText('select_workflow'),
'options'=>$options
)
);
$this->formSubmit(getMLText('set_workflow'));
?>

View File

@ -51,18 +51,22 @@ class SeedDMS_View_TransferObjects extends SeedDMS_Bootstrap_Style {
<input type="hidden" name="action" value="transferobjects">
<?php echo createHiddenFieldWithKey('transferobjects'); ?>
<?php
$html = '<select name="assignTo" class="chzn-select">';
$options = array();
foreach ($allusers as $currUser) {
if ($currUser->isGuest() || ($currUser->getID() == $rmuser->getID()) )
continue;
if ($rmuser && $currUser->getID()==$rmuser->getID()) $selected=$count;
$html .= "<option value=\"".$currUser->getID()."\">" . htmlspecialchars($currUser->getLogin()." - ".$currUser->getFullName());
$options[] = array($currUser->getID(), htmlspecialchars($currUser->getLogin()." - ".$currUser->getFullName()));
}
$html .= '</select>';
$this->formField(
getMLText("transfer_objects_to_user"),
$html
array(
'element'=>'select',
'name'=>'assignTo',
'class'=>'chzn-select',
'options'=>$options
)
);
$this->formSubmit("<i class=\"icon-share-alt\"></i> ".getMLText('transfer_objects'));
?>

View File

@ -114,7 +114,11 @@ $(document).ready(function() {
<?php
$this->formField(
getMLText("comment"),
'<textarea name="comment" cols="80" rows="4"></textarea>'
array(
'element'=>'textarea',
'name'=>'comment',
'rows'=>4
)
);
$this->formSubmit(getMLText("action_".strtolower($action->getName()), array(), $action->getName()));
?>

View File

@ -80,25 +80,27 @@ $(document).ready(function() {
<?php $this->contentContainerStart(); ?>
<form class="form-horizontal">
<?php
$html = '<select id="selector">
<option value="-1">'.getMLText("choose_category").'
<option value="0">'.getMLText("new_default_keyword_category");
$selected=0;
$count=2;
$options = array();
$options[] = array('-1', getMLText("choose_category"));
$options[] = array('0', getMLText("new_default_keyword_category"));
foreach ($categories as $category) {
$owner = $category->getOwner();
if ($owner->getID() != $user->getID()) continue;
if (isset($_GET["categoryid"]) && $category->getID()==$_GET["categoryid"]) $selected=$count;
$html .= "<option value=\"".$category->getID()."\">" . htmlspecialchars($category->getName())."</option>";
$options[] = array($category->getID(), htmlspecialchars($category->getName()));
$count++;
}
$html .= '</select>';
$this->formField(
getMLText("selection"),
$html
array(
'element'=>'select',
'id'=>'selector',
'options'=>$options,
)
);
?>
</form>
@ -114,7 +116,11 @@ $(document).ready(function() {
<?php
$this->formField(
getMLText("name"),
'<input type="text" name="name">'
array(
'element'=>'input',
'type'=>'text',
'name'=>'name',
)
);
$this->formSubmit(getMLText("new_default_keyword_category"));
?>

View File

@ -132,7 +132,13 @@ $(document).ready( function() {
}
$this->formField(
getMLText("workflow_action_name"),
'<input type="text" id="name" name="name" value="'.($action ? htmlspecialchars($action->getName()) : '').'">'
array(
'element'=>'input',
'type'=>'text',
'id'=>'name',
'name'=>'name',
'value'=>($action ? htmlspecialchars($action->getName()) : '')
)
);
$this->formSubmit('<i class="icon-save"></i> '.getMLText("save"));
?>
@ -166,16 +172,19 @@ $(document).ready( function() {
<?php $this->contentContainerStart(); ?>
<form class="form-horizontal">
<?php
$html = '<select id="selector" class="span9">
<option value="-1">'.getMLText("choose_workflow_action").'</option>
<option value="0">'.getMLText("add_workflow_action").'</option>';
$options = array();
$options[] = array('-1', getMLText("choose_workflow_action"));
$options[] = array('0', getMLText("add_workflow_action"));
foreach ($workflowactions as $currWorkflowAction) {
$html .= "<option value=\"".$currWorkflowAction->getID()."\" ".($selworkflowaction && $currWorkflowAction->getID()==$selworkflowaction->getID() ? 'selected' : '').">" . htmlspecialchars($currWorkflowAction->getName());
$options[] = array($currWorkflowAction->getID(), htmlspecialchars($currWorkflowAction->getName()), $selworkflowaction && $currWorkflowAction->getID()==$selworkflowaction->getID());
}
$html .= '</select>';
$this->formField(
getMLText("selection"),
$html
array(
'element'=>'select',
'id'=>'selector',
'options'=>$options
)
);
?>
</form>

View File

@ -161,20 +161,25 @@ $(document).ready(function() {
}
$this->formField(
getMLText("workflow_name"),
'<input type="text" id="name" name="name" value="'.($workflow ? htmlspecialchars($workflow->getName()) : '').'">'
array(
'element'=>'input',
'type'=>'text',
'id'=>'name',
'name'=>'name',
'value'=>($workflow ? htmlspecialchars($workflow->getName()) : '')
)
);
$html = '
<select name="initstate">';
$options = array();
foreach($workflowstates as $workflowstate) {
$html .= "<option value=\"".$workflowstate->getID()."\"";
if($workflow && $workflow->getInitState()->getID() == $workflowstate->getID())
$html .= " selected=\"selected\"";
$html .= ">".htmlspecialchars($workflowstate->getName())."</option>\n";
$options[] = array($workflowstate->getID(), htmlspecialchars($workflowstate->getName()), $workflow && $workflow->getInitState()->getID() == $workflowstate->getID());
}
$html .= '</select>';
$this->formField(
getMLText("workflow_initstate"),
$html
array(
'element'=>'select',
'name'=>'initstate',
'options'=>$options
)
);
$this->formSubmit('<i class="icon-save"></i> '.getMLText("save"));
?>
@ -316,16 +321,19 @@ $(document).ready(function() {
<?php $this->contentContainerStart(); ?>
<form class="form-horizontal">
<?php
$html = '<select id="selector" class="span9">
<option value="-1">'.getMLText("choose_workflow").'</option>
<option value="0">'.getMLText("add_workflow").'</option>';
$options = array();
$options[] = array("-1", getMLText("choose_workflow"));
$options[] = array("0", getMLText("add_workflow"));
foreach ($workflows as $currWorkflow) {
$html .= "<option value=\"".$currWorkflow->getID()."\" ".($selworkflow && $currWorkflow->getID()==$selworkflow->getID() ? 'selected' : '').">" . htmlspecialchars($currWorkflow->getName());
$options[] = array($currWorkflow->getID(), htmlspecialchars($currWorkflow->getName()),$selworkflow && $currWorkflow->getID()==$selworkflow->getID());
}
$html .= '</select>';
$this->formField(
getMLText("selection"),
$html
array(
'element'=>'select',
'id'=>'selector',
'options'=>$options
)
);
?>
</form>

View File

@ -133,17 +133,25 @@ $(document).ready(function() {
}
$this->formField(
getMLText("workflow_state_name"),
'<input type="text" id="name" name="name" value="'.($state ? htmlspecialchars($state->getName()) : '').'">'
array(
'element'=>'input',
'type'=>'text',
'id'=>'name',
'name'=>'name',
'value'=>($state ? htmlspecialchars($state->getName()) : '')
)
);
$html = '
<select name="docstatus">
<option value="">'.getMLText('keep_doc_status').'</option>
<option value="'.S_RELEASED.'" '.(($state && $state->getDocumentStatus() == S_RELEASED) ? "selected" : '').'>'.getMLText('released').'</option>
<option value="'.S_REJECTED.'" '.(($state && $state->getDocumentStatus() == S_REJECTED) ? "selected" : '').'>'.getMLText('rejected').'</option>';
$html .= '</select>';
$options = array();
$options[] = array("", getMLText("keep_doc_status"));
$options[] = array(S_RELEASED, getMLText("released"), ($state && $state->getDocumentStatus() == S_RELEASED));
$options[] = array(S_REJECTED, getMLText("rejected"), ($state && $state->getDocumentStatus() == S_REJECTED));
$this->formField(
getMLText("workflow_state_docstatus"),
$html
array(
'element'=>'select',
'name'=>'docstatus',
'options'=>$options
)
);
$this->formSubmit('<i class="icon-save"></i> '.getMLText("save"));
?>
@ -177,16 +185,19 @@ $(document).ready(function() {
<?php $this->contentContainerStart(); ?>
<form class="form-horizontal">
<?php
$html = '<select id="selector" class="span9">
<option value="-1">'.getMLText("choose_workflow_state").'</option>
<option value="0">'.getMLText("add_workflow_state").'</option>';
$options = array();
$options[] = array("-1", getMLText("choose_workflow_state"));
$options[] = array("0", getMLText("add_workflow_state"));
foreach ($workflowstates as $currWorkflowState) {
$html .= "<option value=\"".$currWorkflowState->getID()."\" ".($selworkflowstate && $currWorkflowState->getID()==$selworkflowstate->getID() ? 'selected' : '').">" . htmlspecialchars($currWorkflowState->getName());
$options[] = array($currWorkflowState->getID(), htmlspecialchars($currWorkflowState->getName()), $selworkflowstate && $currWorkflowState->getID()==$selworkflowstate->getID());
}
$html .= '</select>';
$this->formField(
getMLText("selection"),
$html
array(
'element'=>'select',
'id'=>'selector',
'options'=>$options
)
);
?>
</form>