mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-02-06 23:24:57 +00:00
use formField() instead of plain html, scroll to top for editing a task
This commit is contained in:
parent
6b0b517bed
commit
c9faef81f7
|
@ -42,6 +42,7 @@ $(document).ready( function() {
|
||||||
$('body').on('click', '.edittask', function(ev){
|
$('body').on('click', '.edittask', function(ev){
|
||||||
ev.preventDefault();
|
ev.preventDefault();
|
||||||
$('#editaddtask.ajax').trigger('update', {taskid: $(this).data('id'), action: $(this).data('action')});
|
$('#editaddtask.ajax').trigger('update', {taskid: $(this).data('id'), action: $(this).data('action')});
|
||||||
|
$("html, body").animate({ scrollTop: 0 }, "slow");
|
||||||
});
|
});
|
||||||
$('#listtasks.ajax').trigger('update', {});
|
$('#listtasks.ajax').trigger('update', {});
|
||||||
|
|
||||||
|
@ -188,7 +189,7 @@ $(document).ready( function() {
|
||||||
getMLText('task_'.$extname."_".$taskname."_".$param['name']),
|
getMLText('task_'.$extname."_".$taskname."_".$param['name']),
|
||||||
array(
|
array(
|
||||||
'element'=>'input',
|
'element'=>'input',
|
||||||
'type'=>'text',
|
'type'=>(($param['type'] == 'integer') ? 'number' : 'text'),
|
||||||
'id'=>'params_'.$param['name'],
|
'id'=>'params_'.$param['name'],
|
||||||
'name'=>'params['.$param['name'].']',
|
'name'=>'params['.$param['name'].']',
|
||||||
'required'=>false
|
'required'=>false
|
||||||
|
@ -241,32 +242,51 @@ $(document).ready( function() {
|
||||||
<span class="input uneditable-input"><?= $task->getExtension() ?>::<?= $task->getTask() ?></span>
|
<span class="input uneditable-input"><?= $task->getExtension() ?>::<?= $task->getTask() ?></span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="control-group">
|
|
||||||
<label class="control-label" for="name"><?php printMLText("task_name");?>:</label>
|
|
||||||
<div class="controls">
|
|
||||||
<input type="text" id="name" name="name" value="<?= $task->getName() ?>">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="control-group">
|
|
||||||
<label class="control-label" for="description"><?php printMLText("task_description");?>:</label>
|
|
||||||
<div class="controls">
|
|
||||||
<input type="text" id="description" name="description" value="<?= $task->getDescription() ?>">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="control-group">
|
|
||||||
<label class="control-label" for="frequency"><?php printMLText("task_frequency");?>:</label>
|
|
||||||
<div class="controls">
|
|
||||||
<input type="text" id="frequency" name="frequency" value="<?= $task->getFrequency() ?>">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="control-group">
|
|
||||||
<div class="controls">
|
|
||||||
<label class="checkbox">
|
|
||||||
<input type="checkbox" name="disabled" value="1"<?= ($task->getDisabled() ? ' checked' : '') ?>> <?= getMLText('task_disabled'); ?>
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<?php
|
<?php
|
||||||
|
$this->formField(
|
||||||
|
getMLText('task_name'),
|
||||||
|
array(
|
||||||
|
'element'=>'input',
|
||||||
|
'type'=>'text',
|
||||||
|
'id'=>'name',
|
||||||
|
'name'=>'name',
|
||||||
|
'value'=>$task->getName(),
|
||||||
|
'required'=>true,
|
||||||
|
)
|
||||||
|
);
|
||||||
|
$this->formField(
|
||||||
|
getMLText('task_description'),
|
||||||
|
array(
|
||||||
|
'element'=>'input',
|
||||||
|
'type'=>'text',
|
||||||
|
'id'=>'description',
|
||||||
|
'name'=>'description',
|
||||||
|
'value'=>$task->getDescription(),
|
||||||
|
'required'=>false,
|
||||||
|
)
|
||||||
|
);
|
||||||
|
$this->formField(
|
||||||
|
getMLText('task_frequency'),
|
||||||
|
array(
|
||||||
|
'element'=>'input',
|
||||||
|
'type'=>'text',
|
||||||
|
'id'=>'frequency',
|
||||||
|
'name'=>'frequency',
|
||||||
|
'value'=>$task->getFrequency(),
|
||||||
|
'required'=>true,
|
||||||
|
)
|
||||||
|
);
|
||||||
|
$this->formField(
|
||||||
|
getMLText('task_disabled'),
|
||||||
|
array(
|
||||||
|
'element'=>'input',
|
||||||
|
'type'=>'checkbox',
|
||||||
|
'id'=>'disabled',
|
||||||
|
'name'=>'disabled',
|
||||||
|
'value'=>'1',
|
||||||
|
'checked'=>$task->getDisabled(),
|
||||||
|
)
|
||||||
|
);
|
||||||
if($additionalparams = $taskobj->getAdditionalParams()) {
|
if($additionalparams = $taskobj->getAdditionalParams()) {
|
||||||
foreach($additionalparams as $param) {
|
foreach($additionalparams as $param) {
|
||||||
switch($param['type']) {
|
switch($param['type']) {
|
||||||
|
@ -301,7 +321,7 @@ $(document).ready( function() {
|
||||||
getMLText("task_".$task->getExtension()."_".$task->getTask()."_".$param['name']),
|
getMLText("task_".$task->getExtension()."_".$task->getTask()."_".$param['name']),
|
||||||
array(
|
array(
|
||||||
'element'=>'input',
|
'element'=>'input',
|
||||||
'type'=>'text',
|
'type'=>(($param['type'] == 'integer') ? 'number' : 'text'),
|
||||||
'id'=>'params_'.$param['name'],
|
'id'=>'params_'.$param['name'],
|
||||||
'name'=>'params['.$param['name'].']',
|
'name'=>'params['.$param['name'].']',
|
||||||
'value'=>$task->getParameter()[$param['name']],
|
'value'=>$task->getParameter()[$param['name']],
|
||||||
|
@ -364,10 +384,10 @@ $(document).ready( function() {
|
||||||
echo $task->getFrequency();
|
echo $task->getFrequency();
|
||||||
echo "</td>";
|
echo "</td>";
|
||||||
echo "<td>";
|
echo "<td>";
|
||||||
echo $task->getNextRun();
|
echo getLongReadableDate(makeTsFromDate($task->getNextRun()));
|
||||||
echo "</td>";
|
echo "</td>";
|
||||||
echo "<td>";
|
echo "<td>";
|
||||||
echo $task->getLastRun();
|
echo getLongReadableDate(makeTsFromDate($task->getLastRun()));
|
||||||
echo "</td>";
|
echo "</td>";
|
||||||
echo "<td nowrap>";
|
echo "<td nowrap>";
|
||||||
print "<div class=\"list-action\">";
|
print "<div class=\"list-action\">";
|
||||||
|
|
Loading…
Reference in New Issue
Block a user