[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] CVS: infolog/inc class.customfields_widget.inc.php, N
From: |
Ralf Becker <address@hidden> |
Subject: |
[Phpgroupware-cvs] CVS: infolog/inc class.customfields_widget.inc.php, NONE, 1.1.2.1 class.uicustomfields.inc.php, NONE, 1.1.2.1 class.boinfolog.inc.php, 1.14.2.3.2.8, 1.14.2.3.2.9 class.soinfolog.inc.php, 1.10.2.1.2.4, 1.10.2.1.2.5 class.uiinfolog.inc.php, 1.30.2.12.2.5, 1.30.2.12.2.6 hook_admin.inc.php, 1.4.4.2, 1.4.4.3 |
Date: |
Sun, 24 Aug 2003 18:16:44 -0400 |
Update of /cvsroot/phpgroupware/infolog/inc
In directory subversions:/tmp/cvs-serv29996/inc
Modified Files:
Tag: Version-0_9_16-branch
class.boinfolog.inc.php class.soinfolog.inc.php
class.uiinfolog.inc.php hook_admin.inc.php
Added Files:
Tag: Version-0_9_16-branch
class.customfields_widget.inc.php class.uicustomfields.inc.php
Log Message:
implemented custom fields, type and status
***** Error reading new file: [Errno 2] No such file or directory:
'class.customfields_widget.inc.php'
***** Error reading new file: [Errno 2] No such file or directory:
'class.uicustomfields.inc.php'
Index: class.boinfolog.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/infolog/inc/class.boinfolog.inc.php,v
retrieving revision 1.14.2.3.2.8
retrieving revision 1.14.2.3.2.9
diff -C2 -r1.14.2.3.2.8 -r1.14.2.3.2.9
*** class.boinfolog.inc.php 20 Aug 2003 00:43:19 -0000 1.14.2.3.2.8
--- class.boinfolog.inc.php 24 Aug 2003 22:16:42 -0000 1.14.2.3.2.9
***************
*** 39,43 ****
function boinfolog( $info_id = 0)
{
! $this->enums = array(
'priority' => array (
'urgent' => 'urgent','high' =>
'high','normal' => 'normal',
--- 39,43 ----
function boinfolog( $info_id = 0)
{
! $this->enums = $this->stock_enums = array(
'priority' => array (
'urgent' => 'urgent','high' =>
'high','normal' => 'normal',
***************
*** 55,59 ****
'fax' => 'fax' not implemented so far
*/ )
);
! $this->status = array(
'defaults' => array(
'task' => 'ongoing', 'phone' => 'call',
'note' => 'done'),
--- 55,59 ----
'fax' => 'fax' not implemented so far
*/ )
);
! $this->status = $this->stock_status = array(
'defaults' => array(
'task' => 'ongoing', 'phone' => 'call',
'note' => 'done'),
***************
*** 77,84 ****
--- 77,108 ----
$this->config->read_repository();
+ $this->customfields = array();
if ($this->config->config_data)
{
$this->link_pathes =
$this->config->config_data['link_pathes'];
$this->send_file_ips =
$this->config->config_data['send_file_ips'];
+
+ if (isset($this->config->config_data['status'])
&& is_array($this->config->config_data['status']))
+ {
+
foreach($this->config->config_data['status'] as $key => $data)
+ {
+ if
(!is_array($this->status[$key]))
+ {
+ $this->status[$key] =
array();
+ }
+ $this->status[$key] +=
$this->config->config_data['status'][$key];
+ }
+ }
+ if (isset($this->config->config_data['types'])
&& is_array($this->config->config_data['types']))
+ {
+ //echo "stock-types:<pre>";
print_r($this->enums['type']); echo "</pre>\n";
+ //echo "config-types:<pre>";
print_r($this->config->config_data['types']); echo "</pre>\n";
+ $this->enums['type'] +=
$this->config->config_data['types'];
+ //echo "types:<pre>";
print_r($this->enums['type']); echo "</pre>\n";
+ }
+ if
(isset($this->config->config_data['customfields']) &&
is_array($this->config->config_data['customfields']))
+ {
+ $this->customfields =
$this->config->config_data['customfields'];
+ }
}
***************
*** 86,89 ****
--- 110,129 ----
}
+ /*!
+ @function has_customfields
+ @abstract checks if there are customfields for typ $typ
+ */
+ function has_customfields($typ)
+ {
+ foreach($this->customfields as $name => $field)
+ {
+ if (empty($field['typ']) || $field['typ'] ==
$typ)
+ {
+ return True;
+ }
+ }
+ return False;
+ }
+
/*
* check's if user has the requiered rights on entry $info_id
***************
*** 125,128 ****
--- 165,169 ----
{
$info['info_link_title'] = $info['info_from'];
+ $info['info_link_id'] = 0; // link might
have been deleted
}
return False;
***************
*** 154,158 ****
while (list($key,$val) = each($values))
{
! if (substr($key,0,5) != 'info_')
{
$values['info_'.$key] = $val;
--- 195,199 ----
while (list($key,$val) = each($values))
{
! if ($key[0] != '#' && substr($key,0,5) !=
'info_')
{
$values['info_'.$key] = $val;
***************
*** 195,203 ****
}
! function
search($order,$sort,$filter,$cat_id,$query,$action,$action_id,
!
$ordermethod,&$start,&$total)
{
! return
$this->so->search($order,$sort,$filter,$cat_id,$query,
!
$action,$action_id,$ordermethod,$start,$total);
}
--- 236,242 ----
}
! function
search($order,$sort,$filter,$cat_id,$query,$action,$action_id,$ordermethod,&$start,&$total)
{
! return
$this->so->search($order,$sort,$filter,$cat_id,$query,$action,$action_id,$ordermethod,$start,$total);
}
***************
*** 214,218 ****
$info = $this->read( $info );
}
! return $info['info_subject'];
}
--- 253,257 ----
$info = $this->read( $info );
}
! return $info ? $info['info_subject'] : False;
}
Index: class.soinfolog.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/infolog/inc/class.soinfolog.inc.php,v
retrieving revision 1.10.2.1.2.4
retrieving revision 1.10.2.1.2.5
diff -C2 -r1.10.2.1.2.4 -r1.10.2.1.2.5
*** class.soinfolog.inc.php 11 Aug 2003 22:32:55 -0000 1.10.2.1.2.4
--- class.soinfolog.inc.php 24 Aug 2003 22:16:42 -0000 1.10.2.1.2.5
***************
*** 237,242 ****
if ($info_id <= 0 || $info_id != $this->data['info_id']
&&
! (!$this->db->query("select * FROM phpgw_infolog
where info_id=$info_id",__LINE__,__FILE__) ||
! !$this->db->next_record()))
{
$this->init( );
--- 237,242 ----
if ($info_id <= 0 || $info_id != $this->data['info_id']
&&
! (!$this->db->query("select * FROM phpgw_infolog
WHERE info_id=$info_id",__LINE__,__FILE__) ||
! !$this->db->next_record()))
{
$this->init( );
***************
*** 246,249 ****
--- 246,255 ----
{
$this->db2data($this->data);
+
+ $this->db->query("SELECT
info_extra_name,info_extra_value FROM phpgw_infolog_extra WHERE
info_id=$info_id",__LINE__,__FILE__);
+ while ($this->db->next_record())
+ {
+ $this->data['#'.$this->db->f(0)] =
$this->db->f(1);
+ }
}
return $this->data;
***************
*** 255,260 ****
@syntax delete( $info_id )
@param $info_id id of log-entry
*/
! function delete($info_id) // did _not_ ensure ACL
{
if (($info_id = intval($info_id)) <= 0)
--- 261,267 ----
@syntax delete( $info_id )
@param $info_id id of log-entry
+ @param int $delete_children delete the children, if not set
there parent-id to 0
*/
! function delete($info_id,$delete_children=True) // did _not_
ensure ACL
{
if (($info_id = intval($info_id)) <= 0)
***************
*** 262,269 ****
return;
}
! $this->db->query("delete FROM phpgw_infolog where
info_id=$info_id or info_id_parent=$info_id" .
! " AND ((info_access='public' and info_owner !=
$this->user) OR (info_owner=$this->user))",
! __LINE__,__FILE__);
!
$this->links->unlink(0,'infolog',$info_id);
--- 269,274 ----
return;
}
! $this->db->query("DELETE FROM phpgw_infolog WHERE
info_id=$info_id",__LINE__,__FILE__);
! $this->db->query("DELETE FORM phpgw_infolog_extra WHERE
info_id=$info_id");
$this->links->unlink(0,'infolog',$info_id);
***************
*** 272,275 ****
--- 277,292 ----
$this->init( );
}
+ // delete children, if they are owned by the user
+ if ($delete_children)
+ {
+ $db2 = $this->db; // we need an extra
result-set
+ $db2->query("SELECT info_id FROM phpgw_infolog
WHERE info_id_parent=$info_id AND info_owner=$this->user",__LINE__,__FILE__);
+ while ($db2->next_record())
+ {
+
$this->delete($db2->f(0),$delete_children);
+ }
+ }
+ // set parent_id to 0 for all not deleted children
+ $this->db->query("UPDATA phpgw_infolog SET
info_parent_id=0 WHERE info_parent_id=$info_id",__LINE__,__FILE__);
}
***************
*** 286,299 ****
if (!($new_owner = intval($new_owner)))
{
! $sql = "delete FROM phpgw_infolog where
info_owner=$owner";
! $sql2 = "update phpgw_infolog set
info_responsible=0 where info_responsible=$owner";
}
else
{
! $sql = "update phpgw_infolog set
info_owner=$new_owner where info_owner=$owner";
! $sql2 = "update phpgw_infolog set
info_responsible=$new_owner where info_responsible=$owner";
}
! $this->db->query($sql,__LINE__,__FILE__);
! $this->db->query($sql2,__LINE__,__FILE__);
}
--- 303,318 ----
if (!($new_owner = intval($new_owner)))
{
! $db2 = $this->db; // we need an extra
result-set
! $db2->db->query("SELECT info_id FROM
phpgw_infolog WHERE info_owner=$owner",__LINE__,__FILE__);
! while($db2->next_record())
! {
! $this->delete($this->db->f(0),False);
! }
}
else
{
! $this->db->query("UPDATE phpgw_infolog SET
info_owner=$new_owner WHERE info_owner=$owner",__LINE__,__FILE__);
}
! $this->db->query("UPDATE phpgw_infolog SET
info_responsible=$new_owner WHERE info_responsible=$owner",__LINE__,__FILE__);
}
***************
*** 311,315 ****
unset($phpgw_baseline);
! while (list($key,$val) = each($values))
{
if ($key != 'info_id')
--- 330,336 ----
unset($phpgw_baseline);
! $info_id = intval($values['info_id']) > 0 ?
intval($values['info_id']) : 0;
!
! foreach($values as $key => $val)
{
if ($key != 'info_id')
***************
*** 335,341 ****
}
}
! if (($this->data['info_id'] =
intval($values['info_id'])) > 0)
{
! $query = "UPDATE phpgw_infolog SET $query where
info_id='".$this->data['info_id']."'";
$this->db->query($query,__LINE__,__FILE__);
}
--- 356,362 ----
}
}
! if (($this->data['info_id'] = $info_id))
{
! $query = "UPDATE phpgw_infolog SET $query WHERE
info_id=$info_id";
$this->db->query($query,__LINE__,__FILE__);
}
***************
*** 346,350 ****
$this->data['info_id']=$this->db->get_last_insert_id('phpgw_infolog','info_id');
}
! // echo "<p>soinfolog.write values= ";
_debug_array($values);
// echo "<p>soinfolog.write this->data= ";
_debug_array($this->data);
--- 367,402 ----
$this->data['info_id']=$this->db->get_last_insert_id('phpgw_infolog','info_id');
}
! //echo "<p>soinfolog.write values= ";
_debug_array($values);
!
! // write customfields now
! $existing = array();
! if ($info_id) // existing entry
! {
! $this->db->query("SELECT info_extra_name FROM
phpgw_infolog_extra WHERE info_id=$info_id",__LINE__,__FILE__);
! while($this->db->next_record())
! {
! $existing[strtolower($this->db->f(0))]
= True;
! }
! }
! foreach($values as $key => $val)
! {
! if ($key[0] != '#')
! {
! continue; // no customfield
! }
! $this->data[$key] = $val; // update
internal data
!
! $val = $this->db->db_addslashes($val);
! $name = $this->db->db_addslashes($key =
substr($key,1));
! if ($existing[strtolower($key)])
! {
! $query = "UPDATE phpgw_infolog_extra
SET info_extra_value='$val' WHERE info_id=$info_id AND info_extra_name='$name'";
! }
! else
! {
! $query = "INSERT INTO
phpgw_infolog_extra (info_id,info_extra_name,info_extra_value) VALUES
($info_id,'$name','$val')";
! }
! $this->db->query($query,__LINE__,__FILE__);
! }
// echo "<p>soinfolog.write this->data= ";
_debug_array($this->data);
***************
*** 365,369 ****
return 0;
}
! $this->db->query("select count(*) FROM phpgw_infolog
where info_id_parent=$info_id",__LINE__,__FILE__);
$this->db->next_record();
--- 417,421 ----
return 0;
}
! $this->db->query("select count(*) FROM phpgw_infolog
WHERE info_id_parent=$info_id",__LINE__,__FILE__);
$this->db->next_record();
***************
*** 423,431 ****
$filtermethod .= ' AND info_cat='.intval($cat_id).' ';
}
! if ($query) // we search in
_from, _subject and _des for $query
{
$query = $this->db->db_addslashes($query);
$sql_query = "AND (info_from like '%$query%' OR
info_subject ".
! "LIKE
'%$query%' OR info_des LIKE '%$query%') ";
}
$pid = 'AND info_id_parent='.($action == 'sp' ?
$action_id : 0);
--- 475,483 ----
$filtermethod .= ' AND info_cat='.intval($cat_id).' ';
}
! if ($query) // we search in
_from, _subject, _des and _extra_value for $query
{
$query = $this->db->db_addslashes($query);
$sql_query = "AND (info_from like '%$query%' OR
info_subject ".
! "LIKE
'%$query%' OR info_des LIKE '%$query%' OR info_extra_value LIKE '%$query%') ";
}
$pid = 'AND info_id_parent='.($action == 'sp' ?
$action_id : 0);
***************
*** 439,446 ****
if ($action == '' || $action == 'sp' || count($links))
{
! $this->db->query($sql="SELECT COUNT(*) FROM
phpgw_infolog i WHERE ($filtermethod $pid $sql_query)
$link_extra",__LINE__,__FILE__);
!
! $this->db->next_record();
! $total = $this->db->f(0);
if (!$start || $start > $total)
--- 491,497 ----
if ($action == '' || $action == 'sp' || count($links))
{
! $query = "FROM phpgw_infolog LEFT JOIN
phpgw_infolog_extra ON phpgw_infolog.info_id=phpgw_infolog_extra.info_id WHERE
($filtermethod $pid $sql_query) $link_extra";
! $this->db->query($sql='SELECT DISTINCT
phpgw_infolog.info_id '.$query,__LINE__,__FILE__);
! $total = $this->db->num_rows();
if (!$start || $start > $total)
***************
*** 448,453 ****
$start = 0;
}
! $this->db->limit_query($sql="SELECT * FROM
phpgw_infolog WHERE ($filtermethod $pid $sql_query) $link_extra
$ordermethod",$start,__LINE__,__FILE__);
!
while ($this->db->next_record())
{
--- 499,503 ----
$start = 0;
}
! $this->db->limit_query($sql="SELECT DISTINCT
phpgw_infolog.* $query $ordermethod",$start,__LINE__,__FILE__);
while ($this->db->next_record())
{
Index: class.uiinfolog.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/infolog/inc/class.uiinfolog.inc.php,v
retrieving revision 1.30.2.12.2.5
retrieving revision 1.30.2.12.2.6
diff -C2 -r1.30.2.12.2.5 -r1.30.2.12.2.6
*** class.uiinfolog.inc.php 20 Aug 2003 00:43:19 -0000 1.30.2.12.2.5
--- class.uiinfolog.inc.php 24 Aug 2003 22:16:42 -0000 1.30.2.12.2.6
***************
*** 116,119 ****
--- 116,122 ----
}
}
+ $info['info_type_label'] =
$this->bo->enums['type'][$info['info_type']];
+ $info['info_status_label'] =
$this->bo->status[$info['info_type']][$info['info_status']];
+
return $info;
}
***************
*** 442,447 ****
$GLOBALS['phpgw_info']['flags']['app_header'] =
lang($this->messages[$info_id ? 'edit' : ($action == 'sp' ? 'add_sub' :
'add')]);
- //echo "<p>uiinfolog.edit(info_id=$info_id,mode=$mode)
content = "; _debug_array($content);
$this->tmpl->read('infolog.edit');
$this->tmpl->exec('infolog.uiinfolog.edit',$content,array(
'info_type' => $this->bo->enums['type'],
--- 445,459 ----
$GLOBALS['phpgw_info']['flags']['app_header'] =
lang($this->messages[$info_id ? 'edit' : ($action == 'sp' ? 'add_sub' :
'add')]);
$this->tmpl->read('infolog.edit');
+ if ($this->bo->has_customfields($content['info_type']))
+ {
+ $content['customfields'] =
$this->bo->customfields;
+ $content['customfields']['###typ###'] =
$content['info_type'];
+ }
+ else
+ {
+
$this->tmpl->set_cell_attribute('description|links|delegation|customfields','name','description|links|delegation');
+ }
+ //echo "<p>uiinfolog.edit(info_id=$info_id,mode=$mode)
content = "; _debug_array($content);
$this->tmpl->exec('infolog.uiinfolog.edit',$content,array(
'info_type' => $this->bo->enums['type'],
Index: hook_admin.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/infolog/inc/hook_admin.inc.php,v
retrieving revision 1.4.4.2
retrieving revision 1.4.4.3
diff -C2 -r1.4.4.2 -r1.4.4.3
*** hook_admin.inc.php 11 Aug 2003 22:32:55 -0000 1.4.4.2
--- hook_admin.inc.php 24 Aug 2003 22:16:42 -0000 1.4.4.3
***************
*** 14,20 ****
$file = Array
(
! 'Site configuration' =>
$GLOBALS['phpgw']->link('/index.php',array('menuaction' =>
'infolog.uiinfolog.admin' )),
! 'Global Categories' =>
$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uicategories.index&appname='
. $appname . '&global_cats=True'),
! 'CSV-Import' =>
$GLOBALS['phpgw']->link('/infolog/csv_import.php')
);
--- 14,26 ----
$file = Array
(
! 'Site configuration' =>
$GLOBALS['phpgw']->link('/index.php',array(
! 'menuaction' => 'infolog.uiinfolog.admin' )),
! 'Global Categories' =>
$GLOBALS['phpgw']->link('/index.php',array(
! 'menuaction' => 'admin.uicategories.index',
! 'appname' => $appname,
! 'global_cats'=> True)),
! 'Custom fields, typ and status' =>
$GLOBALS['phpgw']->link('/index.php',array(
! 'menuaction' => 'infolog.uicustomfields.edit')),
! 'CSV-Import' =>
$GLOBALS['phpgw']->link('/infolog/csv_import.php')
);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] CVS: infolog/inc class.customfields_widget.inc.php, NONE, 1.1.2.1 class.uicustomfields.inc.php, NONE, 1.1.2.1 class.boinfolog.inc.php, 1.14.2.3.2.8, 1.14.2.3.2.9 class.soinfolog.inc.php, 1.10.2.1.2.4, 1.10.2.1.2.5 class.uiinfolog.inc.php, 1.30.2.12.2.5, 1.30.2.12.2.6 hook_admin.inc.php, 1.4.4.2, 1.4.4.3,
Ralf Becker <address@hidden> <=
- Prev by Date:
[Phpgroupware-cvs] CVS: etemplate/inc class.boetemplate.inc.php, 1.35.2.1, 1.35.2.2 class.soetemplate.inc.php, 1.28.2.1, 1.28.2.2 class.uietemplate.inc.php, 1.62.2.3, 1.62.2.4
- Next by Date:
[Phpgroupware-cvs] CVS: sitemgr/sitemgr-site config.inc.php, 1.3.2.1, 1.3.2.2
- Previous by thread:
[Phpgroupware-cvs] CVS: etemplate/inc class.boetemplate.inc.php, 1.35.2.1, 1.35.2.2 class.soetemplate.inc.php, 1.28.2.1, 1.28.2.2 class.uietemplate.inc.php, 1.62.2.3, 1.62.2.4
- Next by thread:
[Phpgroupware-cvs] CVS: sitemgr/sitemgr-site config.inc.php, 1.3.2.1, 1.3.2.2
- Index(es):