fixed writeing of temp. alphanumerical info_link_id to the db, as pgSql complains about the wrong type

This commit is contained in:
Ralf Becker 2003-03-20 17:31:01 +00:00
parent 74fc92f617
commit d7db5b4903
2 changed files with 5 additions and 13 deletions

View File

@ -131,7 +131,7 @@
function link_id2from(&$info,$not_app='',$not_id='') function link_id2from(&$info,$not_app='',$not_id='')
{ {
//echo "<p>boinfolog::link_id2title(subject='$info[info_subject]', link_id='$info[info_link_id], from='$info[info_from]')"; //echo "<p>boinfolog::link_id2from(subject='$info[info_subject]', link_id='$info[info_link_id], from='$info[info_from]')";
if ($info['info_link_id'] > 0 && if ($info['info_link_id'] > 0 &&
($link = $this->link->get_link($info['info_link_id'])) !== False) ($link = $this->link->get_link($info['info_link_id'])) !== False)
{ {
@ -165,7 +165,7 @@
{ {
$data['info_subject'] = ''; $data['info_subject'] = '';
} }
$data['info_link_title'] = $this->link_id2title($data,$data['info_link_view']); $this->link_id2from($data);
if ($data['info_link_title'] == $data['info_from']) if ($data['info_link_title'] == $data['info_from'])
{ {
$data['info_from'] = ''; $data['info_from'] = '';
@ -205,9 +205,9 @@
{ {
$values['info_subject'] = substr($values['info_des'],0,60).' ...'; $values['info_subject'] = substr($values['info_des'],0,60).' ...';
} }
if ($values['info_link_id'] && $values['info_from'] == '') if ($values['info_link_id'] && empty($values['info_from']))
{ {
$values['info_from'] = $this->link_id2title($values); $this->link_id2from($values);
} }
} }
$values['info_datemodified'] = time(); $values['info_datemodified'] = time();

View File

@ -96,7 +96,7 @@
} }
$info['info_des'] = nl2br($info['info_des']); $info['info_des'] = nl2br($info['info_des']);
$info['info_anz_subs'] = $this->bo->anzSubs($id); $info['info_anz_subs'] = $this->bo->anzSubs($id);
$this->bo->link_id2from($info,$action,$action_id); $this->bo->link_id2from($info,$action,$action_id); // unset from for $action:$action_id
$readonlys["edit[$id]"] = !$this->bo->check_access($id,PHPGW_ACL_EDIT); $readonlys["edit[$id]"] = !$this->bo->check_access($id,PHPGW_ACL_EDIT);
$readonlys["delete[$id]"] = !$this->bo->check_access($id,PHPGW_ACL_DELETE); $readonlys["delete[$id]"] = !$this->bo->check_access($id,PHPGW_ACL_DELETE);
@ -286,10 +286,6 @@
$info_link_id = $content['info_link_id']; $info_link_id = $content['info_link_id'];
$content['info_link_id'] = 0; // as field has to be int $content['info_link_id'] = 0; // as field has to be int
} }
if ($content['info_link_id'] && empty($content['info_from']))
{
$this->bo->link_id2from($content);
}
$this->bo->write($content); $this->bo->write($content);
if (!$info_id && is_array($content['link_to']['to_id'])) // writing link for new entry if (!$info_id && is_array($content['link_to']['to_id'])) // writing link for new entry
@ -302,10 +298,6 @@
$link = $this->link->get_link('infolog',$content['info_id'],$app,$id); $link = $this->link->get_link('infolog',$content['info_id'],$app,$id);
$content['info_link_id'] = $link['link_id']; $content['info_link_id'] = $link['link_id'];
if (empty($content['info_from']))
{
$this->bo->link_id2from($content);
}
$this->bo->write(array( $this->bo->write(array(
'info_id' => $content['info_id'], 'info_id' => $content['info_id'],
'info_link_id' => $content['info_link_id'], 'info_link_id' => $content['info_link_id'],