corrected bug from savanah patch #419

infolog could not add new entries, that was caused by a halfway change to a new edit-form-template
This commit is contained in:
Ralf Becker 2002-08-06 07:42:57 +00:00
parent 3a5f1b1288
commit b846881759
2 changed files with 18 additions and 35 deletions

View File

@ -693,11 +693,12 @@
if((!isset($info_id) || !$info_id) && !$action || get_var('cancel',Array('POST')))
{
Header('Location: ' . $this->html->link($referer) );
$GLOBALS['phpgw']->common->phpgw_exit();
}
if(get_var('delete',Array('POST')))
{
Header('Location: ' . $this->html->link('/index.php',$this->menuaction('delete')+
array('info_id' => $info_id, 'referer' => $referer)) );
$this->delete($info_id);
return;
}
// check wether to write dates or not
@ -869,8 +870,6 @@
$GLOBALS['phpgw']->template->set_file(array('info_edit_t' => 'form.tpl'));
$GLOBALS['phpgw']->template->set_block('info_edit_t','info_edit');
$GLOBALS['phpgw']->template->set_block('info_edit_t','add');
$GLOBALS['phpgw']->template->set_block('info_edit_t','edit');
if (is_array($error))
{
@ -996,23 +995,27 @@
{
$GLOBALS['phpgw']->template->set_var('delete_button',$this->html->submit_button('delete','Delete'));
}
$GLOBALS['phpgw']->template->parse('buttons',$is_edit ? 'edit' : 'add');
$GLOBALS['phpgw']->template->fp('phpgw_body','info_edit');
}
function delete( )
function delete( $id=0 )
{
global $info_id,$confirm,$to_del;
//echo "<p>delete(id=$id): info_id='$info_id', confirm='$confirm', to_del='$to_del'</p>\n";
$referer = $this->get_referer();
if ($id)
{
$info_id = $id;
}
if (!$info_id ||
!$this->bo->check_access($info_id,PHPGW_ACL_DELETE))
{
Header('Location: ' . $this->html->link($referer));
$GLOBALS['phpgw']->common->phpgw_exit();
}
if ($confirm)
if ($confirm && !$id)
{
if (!isset($to_del) || $to_del == '.')
{
@ -1023,6 +1026,7 @@
$this->bo->delete_attached($info_id,$to_del);
}
Header('Location: ' . $this->html->link($referer,array( 'cd' => 16 )));
$GLOBALS['phpgw']->common->phpgw_exit();
}
else
{

View File

@ -1,30 +1,3 @@
<!-- BEGIN add -->
<table width="90%" border="0" cellspacing="0" cellpadding="0">
<tr valign="bottom">
<td height="35" width="50%">
<div align="center">
<input type="submit" name="add" value="{lang_addsubmitb}">
</div>
</td>
<td height="35" width="50%">
<div align="center">
<input type="reset" name="reset" value="{lang_addresetb}">
</div>
</td>
</tr>
</table>
<!-- END add -->
<!-- BEGIN edit -->
<table width="90%" border="0">
<tr valing=bottom height=100>
<td>{edit_button}</td>
<td>{cancel_button}</td>
<td width="80%" align=right>{delete_button}</td>
</tr>
</table>
<!-- END edit -->
<!-- BEGIN info_edit -->
{doSearchFkt}
{info_css}
@ -137,7 +110,13 @@
</table>
{buttons}
<table width="90%" border="0">
<tr valing=bottom height=100>
<td>{edit_button}</td>
<td>{cancel_button}</td>
<td width="80%" align=right>{delete_button}</td>
</tr>
</table>
</form>
</center>
<!-- END info_edit -->