[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] ged index.php setup/tables_current.inc.php setu...
From: |
Pascal Vilarem |
Subject: |
[Phpgroupware-cvs] ged index.php setup/tables_current.inc.php setu... |
Date: |
Sat, 17 Jun 2006 18:19:26 +0000 |
CVSROOT: /sources/phpgroupware
Module name: ged
Changes by: Pascal Vilarem <maat> 06/06/17 18:19:26
Modified files:
. : index.php
setup : tables_current.inc.php tables_update.inc.php
setup.inc.php
inc : hook_home.inc.php class.ged_ui.inc.php
hook_settings.inc.php class.ged_dm.inc.php
hook_admin.inc.php hook_preferences.inc.php
doc : TODO
Log message:
Cleaning commit : s/ *= */=/g;s/ *=> */=>/g;
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/ged/index.php?cvsroot=phpgroupware&r1=1.3&r2=1.4
http://cvs.savannah.gnu.org/viewcvs/ged/setup/tables_current.inc.php?cvsroot=phpgroupware&r1=1.1.1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/ged/setup/tables_update.inc.php?cvsroot=phpgroupware&r1=1.1.1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/ged/setup/setup.inc.php?cvsroot=phpgroupware&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/ged/inc/hook_home.inc.php?cvsroot=phpgroupware&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/ged/inc/class.ged_ui.inc.php?cvsroot=phpgroupware&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/ged/inc/hook_settings.inc.php?cvsroot=phpgroupware&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/ged/inc/class.ged_dm.inc.php?cvsroot=phpgroupware&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/ged/inc/hook_admin.inc.php?cvsroot=phpgroupware&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/ged/inc/hook_preferences.inc.php?cvsroot=phpgroupware&r1=1.1.1.1&r2=1.2
http://cvs.savannah.gnu.org/viewcvs/ged/doc/TODO?cvsroot=phpgroupware&r1=1.1&r2=1.2
Patches:
Index: index.php
===================================================================
RCS file: /sources/phpgroupware/ged/index.php,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -b -r1.3 -r1.4
--- index.php 17 Jun 2006 18:06:33 -0000 1.3
+++ index.php 17 Jun 2006 18:19:25 -0000 1.4
@@ -11,11 +11,11 @@
* option) any later version
***************************************************************************/
- $GLOBALS['phpgw_info']['flags'] = array
+ $GLOBALS['phpgw_info']['flags']=array
(
- 'currentapp' => 'ged',
- 'noheader' => True,
- 'nonavbar' => True
+ 'currentapp'=>'ged',
+ 'noheader'=>True,
+ 'nonavbar'=>True
);
include('../header.inc.php');
Index: setup/tables_current.inc.php
===================================================================
RCS file: /sources/phpgroupware/ged/setup/tables_current.inc.php,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -b -r1.1.1.1 -r1.2
--- setup/tables_current.inc.php 30 Mar 2006 12:29:20 -0000 1.1.1.1
+++ setup/tables_current.inc.php 17 Jun 2006 18:19:25 -0000 1.2
@@ -14,134 +14,134 @@
* edited by hand. *
\**************************************************************************/
- /* $Id: tables_current.inc.php,v 1.1.1.1 2006/03/30 12:29:20 skwashd Exp $ */
+ /* $Id: tables_current.inc.php,v 1.2 2006/06/17 18:19:25 maat Exp $ */
/* table array for ged */
- $phpgw_baseline = array(
- 'ged_comments' => array(
- 'fd' => array(
- 'comment_id' => array('type' =>
'auto','nullable' => False),
- 'element_id' => array('type' => 'int',
'precision' => 4,'nullable' => False,'default' => '0'),
- 'account_id' => array('type' => 'int',
'precision' => 4,'nullable' => False,'default' => '0'),
- 'comment_date' => array('type' =>
'timestamp','nullable' => False,'default' => '0000-00-00 00:00:00'),
- 'comment' => array('type' => 'text','nullable'
=> False)
- ),
- 'pk' => array('comment_id'),
- 'fk' => array(),
- 'ix' => array(),
- 'uc' => array()
- ),
- 'ged_elements' => array(
- 'fd' => array(
- 'name' => array('type' => 'varchar',
'precision' => 255,'nullable' => False),
- 'owner_id' => array('type' => 'int',
'precision' => 4,'nullable' => False,'default' => '0'),
- 'element_id' => array('type' =>
'auto','nullable' => False),
- 'parent_id' => array('type' => 'int',
'precision' => 4,'nullable' => False,'default' => '0'),
- 'reference' => array('type' => 'varchar',
'precision' => 100,'nullable' => False),
- 'type' => array('type' => 'varchar',
'precision' => 100,'nullable' => False,'default' => '0'),
- 'creator_id' => array('type' => 'int',
'precision' => 4,'nullable' => False,'default' => '0'),
- 'creation_date' => array('type' => 'int',
'precision' => 4,'nullable' => False,'default' => '0'),
- 'validity_period' => array('type' => 'int',
'precision' => 4,'nullable' => True),
- 'cat_id' => array('type' => 'int', 'precision'
=> 4,'nullable' => False,'default' => '0'),
- 'lock_status' => array('type' => 'varchar',
'precision' => 100,'nullable' => False,'default' => '0'),
- 'lock_user_id' => array('type' => 'int',
'precision' => 4,'nullable' => False,'default' => '0'),
- 'description' => array('type' =>
'text','nullable' => False),
- 'doc_type' => array('type' => 'varchar',
'precision' => 255,'nullable' => True)
- ),
- 'pk' => array('element_id'),
- 'fk' => array(),
- 'ix' => array(),
- 'uc' => array()
- ),
- 'ged_history' => array(
- 'fd' => array(
- 'history_id' => array('type' =>
'auto','nullable' => False),
- 'account_id' => array('type' => 'int',
'precision' => 4,'nullable' => True),
- 'filename' => array('type' => 'varchar',
'precision' => 255,'nullable' => True),
- 'parent_id' => array('type' => 'int',
'precision' => 4,'nullable' => True),
- 'action' => array('type' => 'varchar',
'precision' => 40,'nullable' => True),
- 'details' => array('type' => 'text','nullable'
=> True),
- 'ip' => array('type' => 'varchar', 'precision'
=> 16,'nullable' => True),
- 'agent' => array('type' => 'varchar',
'precision' => 100,'nullable' => True),
- 'logdate' => array('type' =>
'timestamp','nullable' => False,'default' => '0000-00-00 00:00:00'),
- 'type' => array('type' => 'varchar',
'precision' => 20,'nullable' => True)
- ),
- 'pk' => array('history_id'),
- 'fk' => array(),
- 'ix' => array(),
- 'uc' => array()
- ),
- 'ged_mimes' => array(
- 'fd' => array(
- 'file_extension' => array('type' => 'char',
'precision' => 10,'nullable' => False),
- 'mime_type' => array('type' => 'char',
'precision' => 50,'nullable' => False)
- ),
- 'pk' => array('file_extension'),
- 'fk' => array(),
- 'ix' => array(),
- 'uc' => array()
- ),
- 'ged_versions' => array(
- 'fd' => array(
- 'url' => array('type' => 'varchar', 'precision'
=> 100,'nullable' => False),
- 'size' => array('type' => 'int', 'precision' =>
4,'nullable' => False,'default' => '0'),
- 'status' => array('type' => 'varchar',
'precision' => 100,'nullable' => False),
- 'creator_id' => array('type' => 'int',
'precision' => 4,'nullable' => False,'default' => '0'),
- 'validation_date' => array('type' => 'int',
'precision' => 4,'nullable' => True ),
- 'creation_date' => array('type' => 'int',
'precision' => 4,'nullable' => False,'default' => '0'),
- 'minor' => array('type' => 'int', 'precision'
=> 4,'nullable' => False,'default' => '0'),
- 'version_id' => array('type' =>
'auto','nullable' => False),
- 'element_id' => array('type' => 'int',
'precision' => 4,'nullable' => False,'default' => '0'),
- 'description' => array('type' => 'varchar',
'precision' => 255,'nullable' => False),
- 'file_extension' => array('type' => 'varchar',
'precision' => 100,'nullable' => False),
- 'file_name' => array('type' => 'varchar',
'precision' => 255,'nullable' => False,'default' => '0'),
- 'major' => array('type' => 'int', 'precision'
=> 4,'nullable' => False,'default' => '0'),
- 'stored_name' => array('type' => 'varchar',
'precision' => 255,'nullable' => False)
- ),
- 'pk' => array('version_id'),
- 'fk' => array(),
- 'ix' => array(),
- 'uc' => array()
- ),
- 'ged_acl' => array(
- 'fd' => array(
- 'acl_id' => array('type' => 'auto','nullable'
=> False),
- 'element_id' => array('type' => 'int',
'precision' => 4,'nullable' => False,'default' => '0'),
- 'account_id' => array('type' => 'int',
'precision' => 4,'nullable' => False,'default' => '0'),
- 'date_begin' => array('type' => 'int',
'precision' => 4,'nullable' => True,'default' => '0'),
- 'date_expire' => array('type' => 'int',
'precision' => 4,'nullable' => True,'default' => '0'),
- 'inherited' => array('type' => 'int',
'precision' => 2,'nullable' => True,'default' => '0'),
- 'aclread' => array('type' => 'int', 'precision'
=> 2,'nullable' => True),
- 'aclwrite' => array('type' => 'int',
'precision' => 2,'nullable' => True),
- 'aclchangeacl' => array('type' => 'int',
'precision' => 2,'nullable' => True,'default' => '0')
- ),
- 'pk' => array('acl_id'),
- 'fk' => array(),
- 'ix' => array(),
- 'uc' => array()
- ),
- 'ged_doc_types' => array(
- 'fd' => array(
- 'type_ref' => array('type' => 'varchar',
'precision' => 255,'nullable' => False),
- 'type_desc' => array('type' => 'varchar',
'precision' => 255,'nullable' => True),
- 'type_chrono' => array('type' => 'int',
'precision' => 4,'nullable' => False,'default' => '0'),
- 'type_smq_ref' => array('type' => 'varchar',
'precision' => 255,'nullable' => True),
- 'ged_parent_id' => array('type' => 'int',
'precision' => 4,'nullable' => False,'default' => '0')
- ),
- 'pk' => array(),
- 'fk' => array(),
- 'ix' => array(),
- 'uc' => array()
- ),
- 'ged_periods' => array(
- 'fd' => array(
- 'period' => array('type' => 'int', 'precision'
=> 4,'nullable' => False,'default' => '0'),
- 'description' => array('type' => 'varchar',
'precision' => 100,'nullable' => False)
- ),
- 'pk' => array('period'),
- 'fk' => array(),
- 'ix' => array(),
- 'uc' => array()
+ $phpgw_baseline=array(
+ 'ged_comments'=>array(
+ 'fd'=>array(
+
'comment_id'=>array('type'=>'auto','nullable'=>False),
+ 'element_id'=>array('type'=>'int',
'precision'=>4,'nullable'=>False,'default'=>'0'),
+ 'account_id'=>array('type'=>'int',
'precision'=>4,'nullable'=>False,'default'=>'0'),
+
'comment_date'=>array('type'=>'timestamp','nullable'=>False,'default'=>'0000-00-00
00:00:00'),
+
'comment'=>array('type'=>'text','nullable'=>False)
+ ),
+ 'pk'=>array('comment_id'),
+ 'fk'=>array(),
+ 'ix'=>array(),
+ 'uc'=>array()
+ ),
+ 'ged_elements'=>array(
+ 'fd'=>array(
+ 'name'=>array('type'=>'varchar',
'precision'=>255,'nullable'=>False),
+ 'owner_id'=>array('type'=>'int',
'precision'=>4,'nullable'=>False,'default'=>'0'),
+
'element_id'=>array('type'=>'auto','nullable'=>False),
+ 'parent_id'=>array('type'=>'int',
'precision'=>4,'nullable'=>False,'default'=>'0'),
+ 'reference'=>array('type'=>'varchar',
'precision'=>100,'nullable'=>False),
+ 'type'=>array('type'=>'varchar',
'precision'=>100,'nullable'=>False,'default'=>'0'),
+ 'creator_id'=>array('type'=>'int',
'precision'=>4,'nullable'=>False,'default'=>'0'),
+ 'creation_date'=>array('type'=>'int',
'precision'=>4,'nullable'=>False,'default'=>'0'),
+ 'validity_period'=>array('type'=>'int',
'precision'=>4,'nullable'=>True),
+ 'cat_id'=>array('type'=>'int',
'precision'=>4,'nullable'=>False,'default'=>'0'),
+ 'lock_status'=>array('type'=>'varchar',
'precision'=>100,'nullable'=>False,'default'=>'0'),
+ 'lock_user_id'=>array('type'=>'int',
'precision'=>4,'nullable'=>False,'default'=>'0'),
+
'description'=>array('type'=>'text','nullable'=>False),
+ 'doc_type'=>array('type'=>'varchar',
'precision'=>255,'nullable'=>True)
+ ),
+ 'pk'=>array('element_id'),
+ 'fk'=>array(),
+ 'ix'=>array(),
+ 'uc'=>array()
+ ),
+ 'ged_history'=>array(
+ 'fd'=>array(
+
'history_id'=>array('type'=>'auto','nullable'=>False),
+ 'account_id'=>array('type'=>'int',
'precision'=>4,'nullable'=>True),
+ 'filename'=>array('type'=>'varchar',
'precision'=>255,'nullable'=>True),
+ 'parent_id'=>array('type'=>'int',
'precision'=>4,'nullable'=>True),
+ 'action'=>array('type'=>'varchar',
'precision'=>40,'nullable'=>True),
+
'details'=>array('type'=>'text','nullable'=>True),
+ 'ip'=>array('type'=>'varchar',
'precision'=>16,'nullable'=>True),
+ 'agent'=>array('type'=>'varchar',
'precision'=>100,'nullable'=>True),
+
'logdate'=>array('type'=>'timestamp','nullable'=>False,'default'=>'0000-00-00
00:00:00'),
+ 'type'=>array('type'=>'varchar',
'precision'=>20,'nullable'=>True)
+ ),
+ 'pk'=>array('history_id'),
+ 'fk'=>array(),
+ 'ix'=>array(),
+ 'uc'=>array()
+ ),
+ 'ged_mimes'=>array(
+ 'fd'=>array(
+ 'file_extension'=>array('type'=>'char',
'precision'=>10,'nullable'=>False),
+ 'mime_type'=>array('type'=>'char',
'precision'=>50,'nullable'=>False)
+ ),
+ 'pk'=>array('file_extension'),
+ 'fk'=>array(),
+ 'ix'=>array(),
+ 'uc'=>array()
+ ),
+ 'ged_versions'=>array(
+ 'fd'=>array(
+ 'url'=>array('type'=>'varchar',
'precision'=>100,'nullable'=>False),
+ 'size'=>array('type'=>'int',
'precision'=>4,'nullable'=>False,'default'=>'0'),
+ 'status'=>array('type'=>'varchar',
'precision'=>100,'nullable'=>False),
+ 'creator_id'=>array('type'=>'int',
'precision'=>4,'nullable'=>False,'default'=>'0'),
+ 'validation_date'=>array('type'=>'int',
'precision'=>4,'nullable'=>True ),
+ 'creation_date'=>array('type'=>'int',
'precision'=>4,'nullable'=>False,'default'=>'0'),
+ 'minor'=>array('type'=>'int',
'precision'=>4,'nullable'=>False,'default'=>'0'),
+
'version_id'=>array('type'=>'auto','nullable'=>False),
+ 'element_id'=>array('type'=>'int',
'precision'=>4,'nullable'=>False,'default'=>'0'),
+ 'description'=>array('type'=>'varchar',
'precision'=>255,'nullable'=>False),
+ 'file_extension'=>array('type'=>'varchar',
'precision'=>100,'nullable'=>False),
+ 'file_name'=>array('type'=>'varchar',
'precision'=>255,'nullable'=>False,'default'=>'0'),
+ 'major'=>array('type'=>'int',
'precision'=>4,'nullable'=>False,'default'=>'0'),
+ 'stored_name'=>array('type'=>'varchar',
'precision'=>255,'nullable'=>False)
+ ),
+ 'pk'=>array('version_id'),
+ 'fk'=>array(),
+ 'ix'=>array(),
+ 'uc'=>array()
+ ),
+ 'ged_acl'=>array(
+ 'fd'=>array(
+
'acl_id'=>array('type'=>'auto','nullable'=>False),
+ 'element_id'=>array('type'=>'int',
'precision'=>4,'nullable'=>False,'default'=>'0'),
+ 'account_id'=>array('type'=>'int',
'precision'=>4,'nullable'=>False,'default'=>'0'),
+ 'date_begin'=>array('type'=>'int',
'precision'=>4,'nullable'=>True,'default'=>'0'),
+ 'date_expire'=>array('type'=>'int',
'precision'=>4,'nullable'=>True,'default'=>'0'),
+ 'inherited'=>array('type'=>'int',
'precision'=>2,'nullable'=>True,'default'=>'0'),
+ 'aclread'=>array('type'=>'int',
'precision'=>2,'nullable'=>True),
+ 'aclwrite'=>array('type'=>'int',
'precision'=>2,'nullable'=>True),
+ 'aclchangeacl'=>array('type'=>'int',
'precision'=>2,'nullable'=>True,'default'=>'0')
+ ),
+ 'pk'=>array('acl_id'),
+ 'fk'=>array(),
+ 'ix'=>array(),
+ 'uc'=>array()
+ ),
+ 'ged_doc_types'=>array(
+ 'fd'=>array(
+ 'type_ref'=>array('type'=>'varchar',
'precision'=>255,'nullable'=>False),
+ 'type_desc'=>array('type'=>'varchar',
'precision'=>255,'nullable'=>True),
+ 'type_chrono'=>array('type'=>'int',
'precision'=>4,'nullable'=>False,'default'=>'0'),
+ 'type_smq_ref'=>array('type'=>'varchar',
'precision'=>255,'nullable'=>True),
+ 'ged_parent_id'=>array('type'=>'int',
'precision'=>4,'nullable'=>False,'default'=>'0')
+ ),
+ 'pk'=>array(),
+ 'fk'=>array(),
+ 'ix'=>array(),
+ 'uc'=>array()
+ ),
+ 'ged_periods'=>array(
+ 'fd'=>array(
+ 'period'=>array('type'=>'int',
'precision'=>4,'nullable'=>False,'default'=>'0'),
+ 'description'=>array('type'=>'varchar',
'precision'=>100,'nullable'=>False)
+ ),
+ 'pk'=>array('period'),
+ 'fk'=>array(),
+ 'ix'=>array(),
+ 'uc'=>array()
)
);
?>
\ No newline at end of file
Index: setup/tables_update.inc.php
===================================================================
RCS file: /sources/phpgroupware/ged/setup/tables_update.inc.php,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -b -r1.1.1.1 -r1.2
--- setup/tables_update.inc.php 30 Mar 2006 12:29:19 -0000 1.1.1.1
+++ setup/tables_update.inc.php 17 Jun 2006 18:19:25 -0000 1.2
@@ -9,57 +9,57 @@
* option) any later version.
*
\**************************************************************************/
- $test[] = '0.9.16.000';
+ $test[]='0.9.16.000';
function ged_upgrade0_9_16_000()
{
-
$GLOBALS['phpgw_setup']->oProc->AddColumn('ged_elements','validity_period',array('type'
=> 'int', 'precision' => 4, 'nullable' => True, 'default' => NULL));
+
$GLOBALS['phpgw_setup']->oProc->AddColumn('ged_elements','validity_period',array('type'=>'int',
'precision'=>4, 'nullable'=>True, 'default'=>NULL));
- $old_table_def =array(
- 'fd' => array(
- 'url' => array('type' => 'varchar', 'precision'
=> 100,'nullable' => False),
- 'size' => array('type' => 'int', 'precision' =>
4,'nullable' => False,'default' => '0'),
- 'status' => array('type' => 'varchar',
'precision' => 100,'nullable' => False),
- 'creator_id' => array('type' => 'int',
'precision' => 4,'nullable' => False,'default' => '0'),
- 'validation_date' => array('type' => 'int',
'precision' => 4,'nullable' => False,'default' => '0'),
- 'validity_period' => array('type' => 'int',
'precision' => 4,'nullable' => False,'default' => '0'),
- 'creation_date' => array('type' => 'int',
'precision' => 4,'nullable' => False,'default' => '0'),
- 'minor' => array('type' => 'int', 'precision'
=> 4,'nullable' => False,'default' => '0'),
- 'version_id' => array('type' =>
'auto','nullable' => False),
- 'element_id' => array('type' => 'int',
'precision' => 4,'nullable' => False,'default' => '0'),
- 'description' => array('type' => 'varchar',
'precision' => 255,'nullable' => False),
- 'file_extension' => array('type' => 'varchar',
'precision' => 100,'nullable' => False),
- 'file_name' => array('type' => 'varchar',
'precision' => 255,'nullable' => False,'default' => '0'),
- 'major' => array('type' => 'int', 'precision'
=> 4,'nullable' => False,'default' => '0'),
- 'stored_name' => array('type' => 'varchar',
'precision' => 255,'nullable' => False)
+ $old_table_def=array(
+ 'fd'=>array(
+ 'url'=>array('type'=>'varchar',
'precision'=>100,'nullable'=>False),
+ 'size'=>array('type'=>'int',
'precision'=>4,'nullable'=>False,'default'=>'0'),
+ 'status'=>array('type'=>'varchar',
'precision'=>100,'nullable'=>False),
+ 'creator_id'=>array('type'=>'int',
'precision'=>4,'nullable'=>False,'default'=>'0'),
+ 'validation_date'=>array('type'=>'int',
'precision'=>4,'nullable'=>False,'default'=>'0'),
+ 'validity_period'=>array('type'=>'int',
'precision'=>4,'nullable'=>False,'default'=>'0'),
+ 'creation_date'=>array('type'=>'int',
'precision'=>4,'nullable'=>False,'default'=>'0'),
+ 'minor'=>array('type'=>'int',
'precision'=>4,'nullable'=>False,'default'=>'0'),
+
'version_id'=>array('type'=>'auto','nullable'=>False),
+ 'element_id'=>array('type'=>'int',
'precision'=>4,'nullable'=>False,'default'=>'0'),
+ 'description'=>array('type'=>'varchar',
'precision'=>255,'nullable'=>False),
+ 'file_extension'=>array('type'=>'varchar',
'precision'=>100,'nullable'=>False),
+ 'file_name'=>array('type'=>'varchar',
'precision'=>255,'nullable'=>False,'default'=>'0'),
+ 'major'=>array('type'=>'int',
'precision'=>4,'nullable'=>False,'default'=>'0'),
+ 'stored_name'=>array('type'=>'varchar',
'precision'=>255,'nullable'=>False)
),
- 'pk' => array('version_id'),
- 'fk' => array(),
- 'ix' => array(),
- 'uc' => array()
+ 'pk'=>array('version_id'),
+ 'fk'=>array(),
+ 'ix'=>array(),
+ 'uc'=>array()
);
$GLOBALS['phpgw_setup']->oProc->DropColumn('ged_versions',
$old_table_def, 'validity_period');
-
$GLOBALS['phpgw_setup']->oProc->AlterColumn('ged_versions','validation_date',
array('type' => 'int', 'precision' => 4, 'nullable' => True, 'default' =>
NULL));
+
$GLOBALS['phpgw_setup']->oProc->AlterColumn('ged_versions','validation_date',
array('type'=>'int', 'precision'=>4, 'nullable'=>True, 'default'=>NULL));
/*
- 'spcontrol_lifetimes' => array(
- 'fd' => array(
- 'lifetime' => array('type' => 'int',
'precision' => 4,'nullable' => False,'default' => '0'),
- 'description' => array('type' => 'varchar',
'precision' => 100,'nullable' => False)
+ 'spcontrol_lifetimes'=>array(
+ 'fd'=>array(
+ 'lifetime'=>array('type'=>'int',
'precision'=>4,'nullable'=>False,'default'=>'0'),
+ 'description'=>array('type'=>'varchar',
'precision'=>100,'nullable'=>False)
)
*/
$GLOBALS['phpgw_setup']->oProc->CreateTable('ged_periods',
array(
- 'fd' => array(
- 'period' => array('type' => 'int', 'precision'
=> 4,'nullable' => False,'default' => '0'),
- 'description' => array('type' => 'varchar',
'precision' => 100,'nullable' => False)
+ 'fd'=>array(
+ 'period'=>array('type'=>'int',
'precision'=>4,'nullable'=>False,'default'=>'0'),
+ 'description'=>array('type'=>'varchar',
'precision'=>100,'nullable'=>False)
),
- 'pk' => array('period'),
- 'fk' => array(),
- 'ix' => array(),
- 'uc' => array()
+ 'pk'=>array('period'),
+ 'fk'=>array(),
+ 'ix'=>array(),
+ 'uc'=>array()
)
);
@@ -75,7 +75,7 @@
- $GLOBALS['setup_info']['notes']['currentver'] = '0.9.16.000';
+ $GLOBALS['setup_info']['notes']['currentver']='0.9.16.000';
return $GLOBALS['setup_info']['notes']['currentver'];
}
?>
\ No newline at end of file
Index: setup/setup.inc.php
===================================================================
RCS file: /sources/phpgroupware/ged/setup/setup.inc.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- setup/setup.inc.php 1 Apr 2006 01:57:52 -0000 1.2
+++ setup/setup.inc.php 17 Jun 2006 18:19:25 -0000 1.3
@@ -9,26 +9,26 @@
* option) any later version.
*
\**************************************************************************/
- /* $Id: setup.inc.php,v 1.2 2006/04/01 01:57:52 skwashd Exp $ */
+ /* $Id: setup.inc.php,v 1.3 2006/06/17 18:19:25 maat Exp $ */
- $setup_info['ged']['name'] = 'ged';
- $setup_info['ged']['title'] = 'Document Management';
- $setup_info['ged']['version'] = '0.9.16.001';
- $setup_info['ged']['app_order'] = 17;
- $setup_info['ged']['enable'] = 1;
+ $setup_info['ged']['name']='ged';
+ $setup_info['ged']['title']='Document Management';
+ $setup_info['ged']['version']='0.9.16.001';
+ $setup_info['ged']['app_order']=17;
+ $setup_info['ged']['enable']=1;
/* The hooks this app includes, needed for hooks registration */
-// $setup_info['ged']['hooks'][] = 'about';
-// $setup_info['ged']['hooks'][] = 'admin';
-// $setup_info['ged']['hooks'][] = 'manual';
- $setup_info['ged']['hooks'][] = 'preferences';
- $setup_info['ged']['hooks'][] = 'settings';
- $setup_info['ged']['hooks'][] = 'home';
-// $setup_info['ged']['hooks'][] = 'sidebox_menu';
+// $setup_info['ged']['hooks'][]='about';
+// $setup_info['ged']['hooks'][]='admin';
+// $setup_info['ged']['hooks'][]='manual';
+ $setup_info['ged']['hooks'][]='preferences';
+ $setup_info['ged']['hooks'][]='settings';
+ $setup_info['ged']['hooks'][]='home';
+// $setup_info['ged']['hooks'][]='sidebox_menu';
// Tables dans la base de données
- $setup_info['ged']['tables'] = array (
+ $setup_info['ged']['tables']=array (
'ged_comments',
'ged_elements',
'ged_history',
@@ -40,18 +40,18 @@
);
// * Dependacies for this app to work
- $setup_info['ged']['depends'][] = array(
- 'appname' => 'phpgwapi',
- 'versions' => Array('0.9.16','0.9.17', '0.9.18')
+ $setup_info['ged']['depends'][]=array(
+ 'appname'=>'phpgwapi',
+ 'versions'=>Array('0.9.16','0.9.17', '0.9.18')
);
- $setup_info['ged']['depends'][] = array(
- 'appname' => 'admin',
- 'versions' => Array('0.9.16','0.9.17', '0.9.18')
+ $setup_info['ged']['depends'][]=array(
+ 'appname'=>'admin',
+ 'versions'=>Array('0.9.16','0.9.17', '0.9.18')
);
- $setup_info['ged']['depends'][] = array(
- 'appname' => 'preferences',
- 'versions' => Array('0.9.16','0.9.17', '0.9.18')
+ $setup_info['ged']['depends'][]=array(
+ 'appname'=>'preferences',
+ 'versions'=>Array('0.9.16','0.9.17', '0.9.18')
);
?>
Index: inc/hook_home.inc.php
===================================================================
RCS file: /sources/phpgroupware/ged/inc/hook_home.inc.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- inc/hook_home.inc.php 17 Jun 2006 18:06:33 -0000 1.2
+++ inc/hook_home.inc.php 17 Jun 2006 18:19:26 -0000 1.3
@@ -9,78 +9,78 @@
* option) any later version. *
\**************************************************************************/
- $d1 = strtolower(substr(PHPGW_APP_INC,0,3));
- if($d1 == 'htt' || $d1 == 'ftp' )
+ $d1=strtolower(substr(PHPGW_APP_INC,0,3));
+ if($d1=='htt' || $d1=='ftp' )
{
echo 'Failed attempt to break in via an old Security
Hole!<br>'."\n";
$GLOBALS['phpgw']->common->phpgw_exit();
}
unset($d1);
- $tmp_app_inc = $GLOBALS['phpgw']->common->get_inc_dir('ged');
+ $tmp_app_inc=$GLOBALS['phpgw']->common->get_inc_dir('ged');
- if
($GLOBALS['phpgw_info']['user']['preferences']['ged']['mainscreen_show_ged_news']
== 'True')
+ if
($GLOBALS['phpgw_info']['user']['preferences']['ged']['mainscreen_show_ged_news']=='True')
{
- $title = '<font color="#FFFFFF">'.lang('ged').'</font>';
+ $title='<font color="#FFFFFF">'.lang('ged').'</font>';
- $portalbox = CreateObject('phpgwapi.listbox',
+ $portalbox=CreateObject('phpgwapi.listbox',
Array(
- 'title' => $title,
- 'primary' =>
$GLOBALS['phpgw_info']['theme']['navbar_bg'],
- 'secondary' =>
$GLOBALS['phpgw_info']['theme']['navbar_bg'],
- 'tertiary' =>
$GLOBALS['phpgw_info']['theme']['navbar_bg'],
- 'width' => '100%',
- 'outerborderwidth' => '0',
- 'header_background_image' =>
$GLOBALS['phpgw']->common->image('phpgwapi','bg_filler', '.png', False)
+ 'title'=>$title,
+
'primary'=>$GLOBALS['phpgw_info']['theme']['navbar_bg'],
+
'secondary'=>$GLOBALS['phpgw_info']['theme']['navbar_bg'],
+
'tertiary'=>$GLOBALS['phpgw_info']['theme']['navbar_bg'],
+ 'width'=>'100%',
+ 'outerborderwidth'=>'0',
+
'header_background_image'=>$GLOBALS['phpgw']->common->image('phpgwapi','bg_filler',
'.png', False)
)
);
- $app_id = $GLOBALS['phpgw']->applications->name2id('ged');
- $GLOBALS['portal_order'][] = $app_id;
- $var = Array(
- 'up' => Array('url' => '/set_box.php', 'app'
=> $app_id),
- 'down' => Array('url' => '/set_box.php', 'app'
=> $app_id),
- 'close' => Array('url' => '/set_box.php', 'app'
=> $app_id),
- 'question' => Array('url' => '/set_box.php',
'app' => $app_id),
- 'edit' => Array('url' => '/set_box.php', 'app'
=> $app_id)
+ $app_id=$GLOBALS['phpgw']->applications->name2id('ged');
+ $GLOBALS['portal_order'][]=$app_id;
+ $var=Array(
+ 'up'=>Array('url'=>'/set_box.php', 'app'=>$app_id),
+ 'down'=>Array('url'=>'/set_box.php', 'app'=>$app_id),
+ 'close'=>Array('url'=>'/set_box.php', 'app'=>$app_id),
+ 'question'=>Array('url'=>'/set_box.php',
'app'=>$app_id),
+ 'edit'=>Array('url'=>'/set_box.php', 'app'=>$app_id)
);
- while(list($key,$value) = each($var))
+ while(list($key,$value)=each($var))
{
$portalbox->set_controls($key,$value);
}
- $portalbox->data = Array();
+ $portalbox->data=Array();
if($data)
{
- $portalbox->data = $data;
+ $portalbox->data=$data;
}
- $GLOBALS['extra_data'] = '<td style="background:
white;"><div style="margin-left: 1em;">'."\n";
+ $GLOBALS['extra_data']='<td style="background:
white;"><div style="margin-left: 1em;">'."\n";
/* partie interessante */
- $ged_dm= CreateObject('ged.ged_dm', True);
+ $ged_dm=CreateObject('ged.ged_dm', True);
$docs1=$ged_dm->list_new_documents();
if ( is_array($docs1) )
{
- $GLOBALS['extra_data'] .= "<h2>".lang ('New
documents')."</h2>"."\n";
+ $GLOBALS['extra_data'] .="<h2>".lang ('New
documents')."</h2>"."\n";
$GLOBALS['extra_data'] .="<ul
style=\"margin-left: 2em;\">\n";
foreach ( $docs1 as $doc )
{
- $link_data['menuaction']=
'ged.ged_ui.browse';
- $link_data['focused_id']=
$doc['element_id'];
+
$link_data['menuaction']='ged.ged_ui.browse';
+
$link_data['focused_id']=$doc['element_id'];
$link=$GLOBALS['phpgw']->link('/index.php', $link_data);
- if ( $doc['reference'] != "" )
- $GLOBALS['extra_data'] .=
"<li><a href=\"".$link."\" >".$doc['name']."
(".$doc['reference'].")</a>"."</li>\n";
+ if ( $doc['reference'] !="" )
+ $GLOBALS['extra_data']
.="<li><a href=\"".$link."\" >".$doc['name']."
(".$doc['reference'].")</a>"."</li>\n";
else
- $GLOBALS['extra_data'] .=
"<li><a href=\"".$link."\" >".$doc['name']."</a>"."</li>\n";
+ $GLOBALS['extra_data']
.="<li><a href=\"".$link."\" >".$doc['name']."</a>"."</li>\n";
}
$GLOBALS['extra_data'] .="</ul>\n";
}
@@ -89,14 +89,14 @@
if ( is_array($docs2) )
{
- $GLOBALS['extra_data'] .=
"<h2>".lang('Documents to check soon')."</h2>"."\n";
+ $GLOBALS['extra_data'] .="<h2>".lang('Documents
to check soon')."</h2>"."\n";
$GLOBALS['extra_data'] .="<ul
style=\"margin-left: 2em;\">"."\n";
foreach ( $docs2 as $doc )
{
- $link_data['menuaction']=
'ged.ged_ui.browse';
- $link_data['focused_id']=
$doc['element_id'];
+
$link_data['menuaction']='ged.ged_ui.browse';
+
$link_data['focused_id']=$doc['element_id'];
$link=$GLOBALS['phpgw']->link('/index.php', $link_data);
if ( $doc['expiration_date'] > time() )
@@ -104,17 +104,17 @@
else
$expiration=lang("Too late!");
- if ( $doc['reference'] != "" )
- $GLOBALS['extra_data'] .=
"<li><a href=\"".$link."\" >".$doc['name']." (".$doc['reference'].")</a>
[".lang("Deadline")." : ".$expiration."]</li>"."\n";
+ if ( $doc['reference'] !="" )
+ $GLOBALS['extra_data']
.="<li><a href=\"".$link."\" >".$doc['name']." (".$doc['reference'].")</a>
[".lang("Deadline")." : ".$expiration."]</li>"."\n";
else
- $GLOBALS['extra_data'] .=
"<li><a href=\"".$link."\" >".$doc['name']."</a> [".lang("Deadline")." :
".$expiration."]</li>"."\n";
+ $GLOBALS['extra_data']
.="<li><a href=\"".$link."\" >".$doc['name']."</a> [".lang("Deadline")." :
".$expiration."]</li>"."\n";
}
$GLOBALS['extra_data'] .="</ul>"."\n";
}
/* fin partie interessante */
- $GLOBALS['extra_data'] .= '</div></td>';
+ $GLOBALS['extra_data'] .='</div></td>';
// output the portalbox
if ( is_array($docs1) || is_array($docs2) )
Index: inc/class.ged_ui.inc.php
===================================================================
RCS file: /sources/phpgroupware/ged/inc/class.ged_ui.inc.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- inc/class.ged_ui.inc.php 17 Jun 2006 18:06:33 -0000 1.2
+++ inc/class.ged_ui.inc.php 17 Jun 2006 18:19:26 -0000 1.3
@@ -17,10 +17,10 @@
var $theme;
var $categories;
var $ged_dm;
- var $debug= 1;
+ var $debug=1;
var $browser;
- var $public_functions= array('browse' => true, 'add_file' => true,
'add_folder' => true, 'update_file' => true, 'update_folder' => true,
'delete_folder' => true, 'download' => true, 'view' => true, 'update_file' =>
true, 'delete_file' => true, 'change_acl' => true, 'css' => true,
'approve_file' => true );
+ var $public_functions=array('browse'=>true, 'add_file'=>true,
'add_folder'=>true, 'update_file'=>true, 'update_folder'=>true,
'delete_folder'=>true, 'download'=>true, 'view'=>true, 'update_file'=>true,
'delete_file'=>true, 'change_acl'=>true, 'css'=>true, 'approve_file'=>true );
var $icons;
@@ -30,53 +30,53 @@
function ged_ui()
{
- $this->theme= $GLOBALS['phpgw_info']['theme'];
- $this->t= $GLOBALS['phpgw']->template;
+ $this->theme=$GLOBALS['phpgw_info']['theme'];
+ $this->t=&$GLOBALS['phpgw']->template;
// Gestion des groupes et des droits
- //$this->owner = $GLOBALS['phpgw_info']['user']['account_id'];
- //$this->acct= CreateObject('phpgwapi.accounts',$owner);
- //$this->groups= $this->acct->get_list('groups');
+ //$this->owner=$GLOBALS['phpgw_info']['user']['account_id'];
+ //$this->acct=CreateObject('phpgwapi.accounts',$owner);
+ //$this->groups=$this->acct->get_list('groups');
//_debug_array($this->groups);
- //$this->users= $this->acct->get_list('accounts');
+ //$this->users=$this->acct->get_list('accounts');
//_debug_array($this->users);
- $this->ged_dm= CreateObject('ged.ged_dm', True);
- $this->categories= CreateObject('phpgwapi.categories');
- $this->browser= CreateObject('phpgwapi.browser');
- $this->icons["txt"]= "txt";
- $this->icons["doc"]= "word";
- $this->icons["rtf"]= "document";
- $this->icons["xls"]= "excel";
- $this->icons["ppt"]= "powerpoint";
- $this->icons["exe"]= "binary";
- $this->icons["html"]= "html";
- $this->icons["htm"]= "html";
- $this->icons["gif"]= "image";
- $this->icons["jpg"]= "image";
- $this->icons["bmp"]= "image";
- $this->icons["png"]= "image";
- $this->icons["log"]= "log";
- $this->icons["midi"]= "midi";
- $this->icons["pdf"]= "pdf";
- $this->icons["wav"]= "sound";
- $this->icons["mp3"]= "sound";
- $this->icons["c"]= "source_c";
- $this->icons["cpp"]= "source_cpp";
- $this->icons["h"]= "source_h";
- $this->icons["java"]= "source_java";
- $this->icons["py"]= "source_py";
- $this->icons["tar"]= "tar";
- $this->icons["gz"]= "gz";
- $this->icons["zip"]= "gz";
- $this->icons["mpg"]= "video";
- $this->icons["avi"]= "video";
- $this->icons["tex"]= "tex";
- $this->icons["php"]= "php";
- $this->icons["wmv"]= "wmv_movie";
- $this->icons["default"]= "default";
+ $this->ged_dm=CreateObject('ged.ged_dm', True);
+ $this->categories=CreateObject('phpgwapi.categories');
+ $this->browser=CreateObject('phpgwapi.browser');
+ $this->icons["txt"]="txt";
+ $this->icons["doc"]="word";
+ $this->icons["rtf"]="document";
+ $this->icons["xls"]="excel";
+ $this->icons["ppt"]="powerpoint";
+ $this->icons["exe"]="binary";
+ $this->icons["html"]="html";
+ $this->icons["htm"]="html";
+ $this->icons["gif"]="image";
+ $this->icons["jpg"]="image";
+ $this->icons["bmp"]="image";
+ $this->icons["png"]="image";
+ $this->icons["log"]="log";
+ $this->icons["midi"]="midi";
+ $this->icons["pdf"]="pdf";
+ $this->icons["wav"]="sound";
+ $this->icons["mp3"]="sound";
+ $this->icons["c"]="source_c";
+ $this->icons["cpp"]="source_cpp";
+ $this->icons["h"]="source_h";
+ $this->icons["java"]="source_java";
+ $this->icons["py"]="source_py";
+ $this->icons["tar"]="tar";
+ $this->icons["gz"]="gz";
+ $this->icons["zip"]="gz";
+ $this->icons["mpg"]="video";
+ $this->icons["avi"]="video";
+ $this->icons["tex"]="tex";
+ $this->icons["php"]="php";
+ $this->icons["wmv"]="wmv_movie";
+ $this->icons["default"]="default";
}
@@ -276,8 +276,8 @@
$this->t->set_var('lang_up', lang('Up'));
- $link_data['menuaction']= 'ged.ged_ui.browse';
- $link_data['focused_id']= 0;
+ $link_data['menuaction']='ged.ged_ui.browse';
+ $link_data['focused_id']=0;
$top_url=$GLOBALS['phpgw']->link('/index.php', $link_data);
$this->t->set_var('top_link', "<a
href=\"".$top_url."\">".lang('Top')."</a>");
@@ -288,7 +288,7 @@
$GLOBALS['phpgw']->common->phpgw_header(true);
echo parse_navbar();
- //$this->t->set_file(array('header' => 'header.tpl'));
+ //$this->t->set_file(array('header'=>'header.tpl'));
//$this->t->set_block('header', 'ged_header');
//$this->set_app_langs();
//$this->t->fp('app_header', 'ged_header');
@@ -303,9 +303,9 @@
// TODO acl here
function view()
{
- $version_id = get_var('version_id',array('GET','POST'));
+ $version_id=get_var('version_id',array('GET','POST'));
- $version= $this->ged_dm->get_version_info($version_id);
+ $version=$this->ged_dm->get_version_info($version_id);
if ($this->browser->is_ie())
{
@@ -314,7 +314,7 @@
header('Cache-control: private, must-revalidate');
header('Content-type: '.$version['mime_type'], false);
header('Content-Disposition: inline;
filename="'.$version['file_name'].'"', false);
- $download_size= filesize($version['file_full_path']);
+ $download_size=filesize($version['file_full_path']);
header('Content-Length: '.$download_size, false);
readfile($version['file_full_path']);
}
@@ -325,7 +325,7 @@
header('Cache-Control: private, must-revalidate');
header('Content-type: '.$version['mime_type'], false);
header('Content-Disposition: inline;
filename="'.$version['file_name'].'"', false);
- $download_size= filesize($version['file_full_path']);
+ $download_size=filesize($version['file_full_path']);
header('Content-Length: '.$download_size, false);
readfile($version['file_full_path']);
}
@@ -336,9 +336,9 @@
// TODO acl here
function download()
{
- $version_id = get_var('version_id',array('GET','POST'));
+ $version_id=get_var('version_id',array('GET','POST'));
- $version= $this->ged_dm->get_version_info($version_id);
+ $version=$this->ged_dm->get_version_info($version_id);
if ($this->browser->is_ie())
{
@@ -347,7 +347,7 @@
header('Cache-control: private, must-revalidate');
header("Content-Type: application/force-download");
header('Content-Disposition: attachment;
filename="'.$version['file_name'].'"', false);
- $download_size= filesize($version['file_full_path']);
+ $download_size=filesize($version['file_full_path']);
header('Content-Length: '.$download_size, false);
readfile($version['file_full_path']);
}
@@ -358,7 +358,7 @@
header('Cache-Control: must-revalidate', false);
header("Content-type: ".$version['mime_type'], false);
header('Content-Disposition: attachment;
filename="'.$version['file_name'].'"', false);
- $download_size= filesize($version['file_full_path']);
+ $download_size=filesize($version['file_full_path']);
header('Content-Length: '.$download_size, false);
readfile($version['file_full_path']);
}
@@ -367,57 +367,57 @@
}
- function draw_tree($focused_id= 0, $parent_id= 0, $path= "",
$element_info= "", $expand= false)
+ function draw_tree($focused_id=0, $parent_id=0, $path="",
$element_info="", $expand=false)
{
- if ($path == "")
- $path= $this->ged_dm->get_path($focused_id);
+ if ($path=="")
+ $path=$this->ged_dm->get_path($focused_id);
- if ($parent_id == "" || $parent_id == 0)
+ if ($parent_id=="" || $parent_id==0)
{
//on est à la racine
- $parent_id= 0;
- $expand= true;
- $element_info['element_id']= "0";
- $element_info['name']= lang('Root folder');
- $element_info['type']= 'folder';
+ $parent_id=0;
+ $expand=true;
+ $element_info['element_id']="0";
+ $element_info['name']=lang('Root folder');
+ $element_info['type']='folder';
}
- $elements= $this->ged_dm->list_elements($parent_id);
- $itemcount= count($elements);
+ $elements=$this->ged_dm->list_elements($parent_id);
+ $itemcount=count($elements);
- if ($expand == false || $itemcount == 0)
+ if ($expand==false || $itemcount==0)
{
- $this->t->set_file(array('zetree'.$parent_id =>
'tree_item.tpl'));
+
$this->t->set_file(array('zetree'.$parent_id=>'tree_item.tpl'));
$this->t->set_var('imgback',
$GLOBALS['phpgw']->common->image('ged', 'down'));
- if ($element_info['type'] == 'folder')
+ if ($element_info['type']=='folder')
{
- if ($element_info['element_id'] == $focused_id)
+ if ($element_info['element_id']==$focused_id)
$this->t->set_var('imgtype',
$GLOBALS['phpgw']->common->image('ged', 'folder_opened'));
else
$this->t->set_var('imgtype',
$GLOBALS['phpgw']->common->image('ged', 'folder_closed'));
}
- elseif ($element_info['type'] == 'file')
+ elseif ($element_info['type']=='file')
{
- $last_version=
$this->ged_dm->get_last_version($element_info['element_id']);
+
$last_version=$this->ged_dm->get_last_version($element_info['element_id']);
- $extension= $last_version['file_extension'];
- if ( $this->icons[$extension] == '')
- $extension = 'default';
+ $extension=$last_version['file_extension'];
+ if ( $this->icons[$extension]=='')
+ $extension='default';
$this->t->set_var('imgtype',
$GLOBALS['phpgw']->common->image('ged', $this->icons[$extension]));
}
- $link_data['menuaction']= 'ged.ged_ui.browse';
- $link_data['focused_id']= $element_info['element_id'];
+ $link_data['menuaction']='ged.ged_ui.browse';
+ $link_data['focused_id']=$element_info['element_id'];
$this->t->set_var('link',
$GLOBALS['phpgw']->link('/index.php', $link_data));
$this->t->set_var('imgdot',
$GLOBALS['phpgw']->common->image('ged', 'right_in'));
- if ($element_info['element_id'] == $focused_id)
+ if ($element_info['element_id']==$focused_id)
$this->t->set_var('label',
"<b>".$this->truncate($element_info['name'])."</b>");
else
$this->t->set_var('label',
$this->truncate($element_info['name']));
@@ -428,20 +428,20 @@
else
{
//on a forcément affaire à un folder avec au moins un
element
- $this->t->set_file(array('zetree'.$parent_id =>
'tree.tpl'));
+
$this->t->set_file(array('zetree'.$parent_id=>'tree.tpl'));
$this->t->set_block('zetree'.$parent_id, 'items_list',
'items_list_handle'.$parent_id);
- for ($i= 0; $i < $itemcount; $i ++)
+ for ($i=0; $i < $itemcount; $i ++)
{
- $current_element= $elements[$i];
+ $current_element=$elements[$i];
if ($this->ged_dm->is_on_path($current_element,
$path))
$this->t->set_var('itemcontent',
$this->draw_tree($focused_id, $current_element['element_id'], "",
$current_element, true));
else
$this->t->set_var('itemcontent',
$this->draw_tree($focused_id, $current_element['element_id'], "",
$current_element, false));
- if ($i +1 == $itemcount)
+ if ($i +1==$itemcount)
{
$this->t->set_var('itemimgright',
$GLOBALS['phpgw']->common->image('ged', 'right_last'));
$this->t->set_var('itemimgback',
$GLOBALS['phpgw']->common->image('ged', ''));
@@ -455,20 +455,20 @@
$this->t->fp('items_list_handle'.$parent_id,
'items_list', True);
}
- if ($parent_id == 0)
+ if ($parent_id==0)
$this->t->set_var('imgdot',
$GLOBALS['phpgw']->common->image('ged', 'to_down'));
else
$this->t->set_var('imgdot',
$GLOBALS['phpgw']->common->image('ged', 'right_in_to_down'));
$this->t->set_var('imgback',
$GLOBALS['phpgw']->common->image('ged', 'down'));
- $link_data['menuaction']= 'ged.ged_ui.browse';
- $link_data['focused_id']= $element_info['element_id'];
+ $link_data['menuaction']='ged.ged_ui.browse';
+ $link_data['focused_id']=$element_info['element_id'];
$this->t->set_var('link',
$GLOBALS['phpgw']->link('/index.php', $link_data));
$this->t->set_var('imgtype',
$GLOBALS['phpgw']->common->image('ged', 'folder_opened'));
- if ($element_info['element_id'] == $focused_id)
+ if ($element_info['element_id']==$focused_id)
$this->t->set_var('label',
"<b>".$this->truncate($element_info['name'])."</b>");
else
$this->t->set_var('label',
$this->truncate($element_info['name']));
@@ -477,7 +477,7 @@
}
- $out= $this->t->parse('zetree'.$parent_id, 'zetree'.$parent_id);
+ $out=$this->t->parse('zetree'.$parent_id, 'zetree'.$parent_id);
return $out;
@@ -485,19 +485,19 @@
function draw_file_panel($element_id)
{
- $this->t->set_file(array('file_tpl' => 'file.tpl'));
+ $this->t->set_file(array('file_tpl'=>'file.tpl'));
- $element_info= $this->ged_dm->get_element_info($element_id);
+ $element_info=$this->ged_dm->get_element_info($element_id);
- $current_version=
$this->ged_dm->get_current_version($element_id);
+
$current_version=$this->ged_dm->get_current_version($element_id);
- $list_versions= $this->ged_dm->list_versions($element_id);
+ $list_versions=$this->ged_dm->list_versions($element_id);
$this->t->set_block('file_tpl', 'versions_list',
'versions_list_handle');
- $versions_numcol= 2;
+ $versions_numcol=2;
- if ($list_versions != "")
+ if ($list_versions !="")
foreach ($list_versions as $version_info)
{
$this->t->set_var('version',
$version_info['major'].".".$version_info['minor']);
@@ -508,27 +508,27 @@
$this->t->set_var('ged_version_class',$version_info['status']);
- $mime_type= $version_info['mime_type'];
+ $mime_type=$version_info['mime_type'];
- $extension= $version_info['file_extension'];
+ $extension=$version_info['file_extension'];
- if ( $this->icons[$extension] == '')
- $extension = 'default';
+ if ( $this->icons[$extension]=='')
+ $extension='default';
$this->t->set_var('version_img_mimetype',
$GLOBALS['phpgw']->common->image('ged', $this->icons[$extension]));
- $link_data['menuaction']= 'ged.ged_ui.download';
- $link_data['version_id']= $version_info['version_id'];
+ $link_data['menuaction']='ged.ged_ui.download';
+ $link_data['version_id']=$version_info['version_id'];
$this->t->set_var('download_file_link',
$GLOBALS['phpgw']->link('/index.php', $link_data));
$this->t->set_var('download_file_target', '');
- $link_data['menuaction']= 'ged.ged_ui.view';
- $link_data['version_id']= $version_info['version_id'];
+ $link_data['menuaction']='ged.ged_ui.view';
+ $link_data['version_id']=$version_info['version_id'];
$this->t->set_var('view_file_link',
$GLOBALS['phpgw']->link('/index.php', $link_data));
- $link_data['menuaction']= 'ged.ged_ui.edit_version';
- $link_data['element_id']= $version_info['element_id'];
- $link_data['version_id']= $version_info['version_id'];
+ $link_data['menuaction']='ged.ged_ui.edit_version';
+ $link_data['element_id']=$version_info['element_id'];
+ $link_data['version_id']=$version_info['version_id'];
$this->t->set_var('edit_version_link',
$GLOBALS['phpgw']->link('/index.php', $link_data));
if ($this->browser->is_ie())
@@ -545,9 +545,9 @@
$versions_numcol ++;
}
- $extension= $current_version['file_extension'];
- if ( $this->icons[$extension] == '')
- $extension = 'default';
+ $extension=$current_version['file_extension'];
+ if ( $this->icons[$extension]=='')
+ $extension='default';
if ( $element_info['validity_period'] > 0)
{
@@ -564,11 +564,11 @@
}
- $file_array_vars= Array('versions_numcol' => $versions_numcol,
'owner' =>
$GLOBALS['phpgw']->common->grab_owner_name($element_info['owner_id']),
'description' => $element_info['description'], 'reference' =>
$element_info['reference'], 'name' => $element_info['name'], 'creation_date' =>
$GLOBALS['phpgw']->common->show_date($element_info['creation_date']),
'current_version_date' =>
$GLOBALS['phpgw']->common->show_date($current_version['creation_date']),
'current_version' => $current_version['major'].".".$current_version['minor'],
'current_version_description' => $current_version['description'],
'current_version_creator' =>
$GLOBALS['phpgw']->common->grab_owner_name($current_version['creator_id']),
'current_version_file_size' => $current_version['size'],
'current_version_img_mime_type' => $GLOBALS['phpgw']->common->image('ged',
$this->icons[$extension]), 'current_version_expiration_date' =>
$expiration_date, 'current_version_mime_type' => $current_version['mime_type']);
+ $file_array_vars=Array('versions_numcol'=>$versions_numcol,
'owner'=>$GLOBALS['phpgw']->common->grab_owner_name($element_info['owner_id']),
'description'=>$element_info['description'],
'reference'=>$element_info['reference'], 'name'=>$element_info['name'],
'creation_date'=>$GLOBALS['phpgw']->common->show_date($element_info['creation_date']),
'current_version_date'=>$GLOBALS['phpgw']->common->show_date($current_version['creation_date']),
'current_version'=>$current_version['major'].".".$current_version['minor'],
'current_version_description'=>$current_version['description'],
'current_version_creator'=>$GLOBALS['phpgw']->common->grab_owner_name($current_version['creator_id']),
'current_version_file_size'=>$current_version['size'],
'current_version_img_mime_type'=>$GLOBALS['phpgw']->common->image('ged',
$this->icons[$extension]), 'current_version_expiration_date'=>$expiration_date,
'current_version_mime_type'=>$current_version['mime_type']);
$this->t->set_var($file_array_vars);
- $out= $this->t->parse('file_tpl', 'file_tpl');
+ $out=$this->t->parse('file_tpl', 'file_tpl');
return $out;
@@ -576,16 +576,16 @@
function draw_folder_panel($element_id)
{
- $this->t->set_file(array('folder_tpl' => 'folder.tpl'));
+ $this->t->set_file(array('folder_tpl'=>'folder.tpl'));
- if ($element_id == 0)
+ if ($element_id==0)
{
- $element_info['reference']= lang('Root folder');
- $element_info['name']= lang('Root folder');
- $element_info['description']= lang('Root folder');
+ $element_info['reference']=lang('Root folder');
+ $element_info['name']=lang('Root folder');
+ $element_info['description']=lang('Root folder');
}
else
- $element_info=
$this->ged_dm->get_element_info($element_id);
+
$element_info=$this->ged_dm->get_element_info($element_id);
$this->t->set_var('owner',
$GLOBALS['phpgw']->common->grab_owner_name($element_info['owner_id']));
$this->t->set_var('description',
$this->truncate($element_info['description'],30));
@@ -593,14 +593,14 @@
$this->t->set_var('name',
$this->truncate($element_info['name']));
$this->t->set_var('creation_date',
$GLOBALS['phpgw']->common->show_date($element_info['creation_date']));
- $sub_folders= $this->ged_dm->list_elements($element_id,
'folder');
+ $sub_folders=$this->ged_dm->list_elements($element_id,
'folder');
if ($sub_folders)
{
$this->t->set_block('folder_tpl', 'subfolders_list',
'subfolders_list_handle');
foreach ($sub_folders as $subfolder)
{
- if ( $tr_class == 'row_off' )
+ if ( $tr_class=='row_off' )
$tr_class='row_on';
else
$tr_class='row_off';
@@ -612,22 +612,22 @@
$this->t->set_var('folder_description',
$subfolder['description']);
$this->t->set_var('folder_owner',
$GLOBALS['phpgw']->common->grab_owner_name($subfolder['owner_id']));
- $link_data['menuaction']= 'ged.ged_ui.browse';
- $link_data['focused_id']=
$subfolder['element_id'];
+ $link_data['menuaction']='ged.ged_ui.browse';
+
$link_data['focused_id']=$subfolder['element_id'];
$this->t->set_var('folder_link',
$GLOBALS['phpgw']->link('/index.php', $link_data));
$this->t->fp('subfolders_list_handle',
'subfolders_list', True);
}
}
- $files= $this->ged_dm->list_elements($element_id, 'file');
+ $files=$this->ged_dm->list_elements($element_id, 'file');
if ($files)
{
$this->t->set_block('folder_tpl', 'files_list',
'files_list_handle');
foreach ($files as $file)
{
- if ( $tr_class == 'row_off' )
+ if ( $tr_class=='row_off' )
$tr_class='row_on';
else
$tr_class='row_off';
@@ -639,15 +639,15 @@
$this->t->set_var('file_description',
$file['description']);
$this->t->set_var('file_owner',
$GLOBALS['phpgw']->common->grab_owner_name($file['owner_id']));
- $link_data['menuaction']= 'ged.ged_ui.browse';
- $link_data['focused_id']= $file['element_id'];
+ $link_data['menuaction']='ged.ged_ui.browse';
+ $link_data['focused_id']=$file['element_id'];
$this->t->set_var('file_link',
$GLOBALS['phpgw']->link('/index.php', $link_data));
$this->t->fp('files_list_handle', 'files_list',
True);
}
}
- $out= $this->t->parse('folder_tpl', 'folder_tpl');
+ $out=$this->t->parse('folder_tpl', 'folder_tpl');
return $out;
}
@@ -659,32 +659,32 @@
function browse()
{
- $focused_id = get_var('focused_id',array('GET','POST'));
+ $focused_id=get_var('focused_id',array('GET','POST'));
- if ($focused_id == "" || ! $this->ged_dm->can_read($focused_id))
- $focused_id= 0;
+ if ($focused_id=="" || ! $this->ged_dm->can_read($focused_id))
+ $focused_id=0;
$this->set_template_defaults();
$this->display_app_header();
- $this->t->set_file(array('browse_file_tpl' => 'browse.tpl'));
+ $this->t->set_file(array('browse_file_tpl'=>'browse.tpl'));
$this->t->set_var('tree', $this->draw_tree($focused_id));
- $focused_element= $this->ged_dm->get_element_info($focused_id);
+ $focused_element=$this->ged_dm->get_element_info($focused_id);
// MEMO Link to go up
- $link_data['menuaction']= 'ged.ged_ui.browse';
- $link_data['focused_id']= $focused_element['parent_id'];
+ $link_data['menuaction']='ged.ged_ui.browse';
+ $link_data['focused_id']=$focused_element['parent_id'];
$up_url=$GLOBALS['phpgw']->link('/index.php', $link_data);
$this->t->set_var('up_link', "<a
href=\"".$up_url."\">".lang('Up')."</a>" );
- if ($focused_id == 0)
+ if ($focused_id==0)
{
- $focused_element['type']= 'folder';
+ $focused_element['type']='folder';
}
switch ($focused_element['type'])
@@ -700,8 +700,8 @@
if ( $this->ged_dm->can_write($focused_id) )
{
$link_data=null;
- $link_data['menuaction']=
'ged.ged_ui.update_file';
- $link_data['element_id']= $focused_id;
+
$link_data['menuaction']='ged.ged_ui.update_file';
+ $link_data['element_id']=$focused_id;
$update_file_url=$GLOBALS['phpgw']->link('/index.php', $link_data);
$this->t->set_var('update_file', "<a
href=\"".$update_file_url."\">".lang('Update file')."</a>");
}
@@ -709,8 +709,8 @@
if ( $this->ged_dm->can_change_acl($focused_id)
)
{
$link_data=null;
- $link_data['menuaction']=
'ged.ged_ui.change_acl';
- $link_data['element_id']= $focused_id;
+
$link_data['menuaction']='ged.ged_ui.change_acl';
+ $link_data['element_id']=$focused_id;
$update_file_url=$GLOBALS['phpgw']->link('/index.php', $link_data);
$this->t->set_var('change_acl', "<a
href=\"".$update_file_url."\">".lang('Change ACL')."</a>");
}
@@ -719,8 +719,8 @@
if ( $this->ged_dm->can_change_acl($focused_id)
)
{
$link_data=null;
- $link_data['menuaction']=
'ged.ged_ui.approve_file';
- $link_data['element_id']= $focused_id;
+
$link_data['menuaction']='ged.ged_ui.approve_file';
+ $link_data['element_id']=$focused_id;
$approve_file_url=$GLOBALS['phpgw']->link('/index.php', $link_data);
$this->t->set_var('approve_file', "<a
href=\"".$approve_file_url."\">".lang('Approve file')."</a>");
}
@@ -729,8 +729,8 @@
if ( $this->ged_dm->admin )
{
$link_data=null;
- $link_data['menuaction']=
'ged.ged_ui.delete_file';
- $link_data['element_id']= $focused_id;
+
$link_data['menuaction']='ged.ged_ui.delete_file';
+ $link_data['element_id']=$focused_id;
$delete_file_url=$GLOBALS['phpgw']->link('/index.php', $link_data);
$this->t->set_var('delete_file', "<a
href=\"".$delete_file_url."\">".lang('Delete file')."</a>");
}
@@ -746,20 +746,20 @@
if ( $this->ged_dm->can_write($focused_id) )
{
$link_data=null;
- $link_data['menuaction']=
'ged.ged_ui.add_file';
- $link_data['parent_id']= $focused_id;
+
$link_data['menuaction']='ged.ged_ui.add_file';
+ $link_data['parent_id']=$focused_id;
$add_file_link=$GLOBALS['phpgw']->link('/index.php', $link_data);
$this->t->set_var('add_file', "<a
href=\"".$add_file_link."\">".lang('Add file')."</a>");
$link_data=null;
- $link_data['menuaction']=
'ged.ged_ui.add_folder';
- $link_data['parent_id']= $focused_id;
+
$link_data['menuaction']='ged.ged_ui.add_folder';
+ $link_data['parent_id']=$focused_id;
$add_folder_link=$GLOBALS['phpgw']->link('/index.php', $link_data);
$this->t->set_var('add_folder', "<a
href=\"".$add_folder_link."\">".lang('Add folder')."</a>" );
$link_data=null;
- $link_data['menuaction']=
'ged.ged_ui.update_folder';
- $link_data['element_id']= $focused_id;
+
$link_data['menuaction']='ged.ged_ui.update_folder';
+ $link_data['element_id']=$focused_id;
$add_folder_link=$GLOBALS['phpgw']->link('/index.php', $link_data);
$this->t->set_var('update_folder', "<a
href=\"".$add_folder_link."\">".lang('Update folder')."</a>" );
@@ -769,18 +769,18 @@
if ( $this->ged_dm->can_change_acl($focused_id)
)
{
$link_data=null;
- $link_data['menuaction']=
'ged.ged_ui.change_acl';
- $link_data['element_id']= $focused_id;
+
$link_data['menuaction']='ged.ged_ui.change_acl';
+ $link_data['element_id']=$focused_id;
$update_file_url=$GLOBALS['phpgw']->link('/index.php', $link_data);
$this->t->set_var('approve_file', "<a
href=\"".$update_file_url."\">".lang('Change ACL')."</a>");
}
// TODO : droit specifique de delete ?
- if ( $this->ged_dm->admin && $focused_id != 0 )
+ if ( $this->ged_dm->admin && $focused_id !=0 )
{
$link_data=null;
- $link_data['menuaction']=
'ged.ged_ui.delete_folder';
- $link_data['element_id']= $focused_id;
+
$link_data['menuaction']='ged.ged_ui.delete_folder';
+ $link_data['element_id']=$focused_id;
$delete_folder_url=$GLOBALS['phpgw']->link('/index.php', $link_data);
$this->t->set_var('delete_folder', "<a
href=\"".$delete_folder_url."\">".lang('Delete folder')."</a>");
}
@@ -798,61 +798,61 @@
function add_file()
{
- $parent_id = get_var('parent_id',array('GET','POST'));
+ $parent_id=get_var('parent_id',array('GET','POST'));
$link_data=null;
- $link_data['menuaction']= 'ged.ged_ui.browse';
- $link_data['focused_id']= $parent_id;
+ $link_data['menuaction']='ged.ged_ui.browse';
+ $link_data['focused_id']=$parent_id;
if ( ! $this->ged_dm->can_write($parent_id) )
{
header('Location:
'.$GLOBALS['phpgw']->link('/index.php', $link_data));
}
- $add_file = get_var('add_file',array('GET','POST'));
- $name = get_var('name',array('GET','POST'));
- $referenceq = get_var('referenceq',array('GET','POST'));
- $description = get_var('description', array('GET', 'POST'));
- $validity_period = get_var('validity_period', array('GET',
'POST'));
+ $add_file=get_var('add_file',array('GET','POST'));
+ $name=get_var('name',array('GET','POST'));
+ $referenceq=get_var('referenceq',array('GET','POST'));
+ $description=get_var('description', array('GET', 'POST'));
+ $validity_period=get_var('validity_period', array('GET',
'POST'));
$this->set_template_defaults();
- if ($parent_id == "")
- $parent_id= 0;
+ if ($parent_id=="")
+ $parent_id=0;
- if ($add_file == lang('Add file'))
+ if ($add_file==lang('Add file'))
{
- $new_file['file_name']= $_FILES['file']['name'];
- $new_file['file_size']= $_FILES['file']['size'];
- $new_file['file_tmp_name']= $_FILES['file']['tmp_name'];
- $new_file['file_mime_type']= $_FILES['file']['type'];
- $new_file['parent_id']= $parent_id;
- $new_file['name']= $name;
- $new_file['reference']= $referenceq;
- $new_file['description']= $description;
- $new_file['validity_period']= $validity_period;
+ $new_file['file_name']=$_FILES['file']['name'];
+ $new_file['file_size']=$_FILES['file']['size'];
+ $new_file['file_tmp_name']=$_FILES['file']['tmp_name'];
+ $new_file['file_mime_type']=$_FILES['file']['type'];
+ $new_file['parent_id']=$parent_id;
+ $new_file['name']=$name;
+ $new_file['reference']=$referenceq;
+ $new_file['description']=$description;
+ $new_file['validity_period']=$validity_period;
$this->ged_dm->add_file($new_file);
- $file_added= 'done';
+ $file_added='done';
- if ($file_added == 'done')
+ if ($file_added=='done')
{
header('Location:
'.$GLOBALS['phpgw']->link('/index.php', $link_data));
}
}
- $this->t->set_file(array('add_file_tpl' => 'add_file.tpl'));
+ $this->t->set_file(array('add_file_tpl'=>'add_file.tpl'));
$this->set_template_defaults();
- $parent_element= $this->ged_dm->get_element_info($parent_id);
+ $parent_element=$this->ged_dm->get_element_info($parent_id);
// TODO precalcul de la reference
// TODO attention : forcer si répertoire chrono
// TODO reprendre ce qui a été fait pour le wizard
- if ($reference != "")
+ if ($reference !="")
$this->t->set_var('new_reference', $reference);
else
$this->t->set_var('new_reference',
$parent_element['reference']."/");
@@ -863,21 +863,21 @@
$this->t->set_var('action_add',
$GLOBALS['phpgw']->link('/index.php', 'menuaction=ged.ged_ui.add_file'));
- $select_periods = $this->ged_dm->select_periods ();
+ $select_periods=$this->ged_dm->select_periods ();
- $select_period_html = '<select name="validity_period">\n';
+ $select_period_html='<select name="validity_period">\n';
foreach ($select_periods as $select_period)
{
- if ($select_period['period'] == $validity_period )
+ if ($select_period['period']==$validity_period )
{
- $select_period_html.= "<option
value=\"".$select_period['period']."\"
selected>".lang($select_period['description'])."</option>\n";
+ $select_period_html.="<option
value=\"".$select_period['period']."\"
selected>".lang($select_period['description'])."</option>\n";
}
else
{
- $select_period_html.= "<option
value=\"".$select_period['period']."\">".lang($select_period['description'])."</option>\n";
+ $select_period_html.="<option
value=\"".$select_period['period']."\">".lang($select_period['description'])."</option>\n";
}
}
- $select_period_html.= "</select>\n";
+ $select_period_html.="</select>\n";
$this->t->set_var('select_period', $select_period_html);
@@ -888,7 +888,7 @@
}
- // nouvelle version : etat = working
+ // nouvelle version : etat=working
// à condition que la dernière version ne soit pas déjà working
// modifiable : le type de version majeur / mineur
// la description
@@ -901,10 +901,10 @@
// TODO acl here DONE
function update_file()
{
- $element_id = get_var('element_id', array('GET', 'POST'));
+ $element_id=get_var('element_id', array('GET', 'POST'));
- $link_data['menuaction']= 'ged.ged_ui.browse';
- $link_data['focused_id']= $element_id;
+ $link_data['menuaction']='ged.ged_ui.browse';
+ $link_data['focused_id']=$element_id;
if ( ! $this->ged_dm->can_write($element_id) )
{
@@ -912,16 +912,16 @@
}
- $update_file = get_var('update_file', array('GET', 'POST'));
- $file_name = get_var('file_name', array('GET', 'POST'));
- $file_description = get_var('file_description', array('GET',
'POST'));
-
- $update_version = get_var('update_version', array('GET',
'POST'));
- $version_description = get_var('version_description',
array('GET', 'POST'));
- $version_type = get_var('version_type', array('GET', 'POST'));
- $version_status = get_var('version_status', array('GET',
'POST'));
- $version_id = get_var('version_id', array('GET', 'POST'));
- $validity_period = get_var('validity_period', array('GET',
'POST'));
+ $update_file=get_var('update_file', array('GET', 'POST'));
+ $file_name=get_var('file_name', array('GET', 'POST'));
+ $file_description=get_var('file_description', array('GET',
'POST'));
+
+ $update_version=get_var('update_version', array('GET', 'POST'));
+ $version_description=get_var('version_description',
array('GET', 'POST'));
+ $version_type=get_var('version_type', array('GET', 'POST'));
+ $version_status=get_var('version_status', array('GET', 'POST'));
+ $version_id=get_var('version_id', array('GET', 'POST'));
+ $validity_period=get_var('validity_period', array('GET',
'POST'));
$this->set_template_defaults();
@@ -945,46 +945,46 @@
$this->t->set_var('version_status_field', 'version_status');
- if ($update_file == lang('Update'))
+ if ($update_file==lang('Update'))
{
- $new_file['element_id']= $element_id;
+ $new_file['element_id']=$element_id;
- $new_file['name']= $file_name;
- $new_file['description']= $file_description;
- $new_file['validity_period']= $validity_period;
+ $new_file['name']=$file_name;
+ $new_file['description']=$file_description;
+ $new_file['validity_period']=$validity_period;
$this->ged_dm->update_file($new_file);
- $file_updated= 'done';
+ $file_updated='done';
- if ($file_updated == 'done')
+ if ($file_updated=='done')
{
- $link_data['menuaction']= 'ged.ged_ui.browse';
- $link_data['focused_id']= $element_id;
+ $link_data['menuaction']='ged.ged_ui.browse';
+ $link_data['focused_id']=$element_id;
header('Location:
'.$GLOBALS['phpgw']->link('/index.php', $link_data));
}
}
- elseif ( $update_version == lang('New') )
+ elseif ( $update_version==lang('New') )
{
- $new_version['element_id']= $element_id;
- $new_version['file_name']= $_FILES['version_file']['name'];
- $new_version['file_size']= $_FILES['version_file']['size'];
- $new_version['file_tmp_name']= $_FILES['version_file']['tmp_name'];
- $new_version['file_mime_type']= $_FILES['version_file']['type'];
- $new_version['type']= $version_type;
- $new_version['status']= $version_status;
- $new_version['description']= $version_description;
+ $new_version['element_id']=$element_id;
+ $new_version['file_name']=$_FILES['version_file']['name'];
+ $new_version['file_size']=$_FILES['version_file']['size'];
+ $new_version['file_tmp_name']=$_FILES['version_file']['tmp_name'];
+ $new_version['file_mime_type']=$_FILES['version_file']['type'];
+ $new_version['type']=$version_type;
+ $new_version['status']=$version_status;
+ $new_version['description']=$version_description;
- $version_added= $this->ged_dm->add_version($new_version);
+ $version_added=$this->ged_dm->add_version($new_version);
- if ($version_added == 'OK')
+ if ($version_added=='OK')
{
- $link_data['menuaction']= 'ged.ged_ui.browse';
- $link_data['focused_id']= $element_id;
+ $link_data['menuaction']='ged.ged_ui.browse';
+ $link_data['focused_id']=$element_id;
header('Location: '.$GLOBALS['phpgw']->link('/index.php', $link_data));
}
@@ -993,25 +993,25 @@
}
- elseif ($update_version == lang('Update') )
+ elseif ($update_version==lang('Update') )
{
- $amended_version['element_id']= $element_id;
- $amended_version['file_name']= $_FILES['version_file']['name'];
- $amended_version['file_size']= $_FILES['version_file']['size'];
- $amended_version['file_tmp_name']= $_FILES['version_file']['tmp_name'];
- $amended_version['file_mime_type']= $_FILES['version_file']['type'];
- $amended_version['type']= $version_type;
- $amended_version['status']= $version_status;
- $amended_version['description']= $version_description;
- $amended_version['version_id']= $version_id;
+ $amended_version['element_id']=$element_id;
+ $amended_version['file_name']=$_FILES['version_file']['name'];
+ $amended_version['file_size']=$_FILES['version_file']['size'];
+ $amended_version['file_tmp_name']=$_FILES['version_file']['tmp_name'];
+ $amended_version['file_mime_type']=$_FILES['version_file']['type'];
+ $amended_version['type']=$version_type;
+ $amended_version['status']=$version_status;
+ $amended_version['description']=$version_description;
+ $amended_version['version_id']=$version_id;
$version_updated=$this->ged_dm->update_version($amended_version);
- if ($version_updated == 'OK')
+ if ($version_updated=='OK')
{
- $link_data['menuaction']= 'ged.ged_ui.browse';
- $link_data['focused_id']= $element_id;
+ $link_data['menuaction']='ged.ged_ui.browse';
+ $link_data['focused_id']=$element_id;
header('Location:
'.$GLOBALS['phpgw']->link('/index.php', $link_data));
}
@@ -1022,10 +1022,10 @@
}
else
{
- $focused_element=
$this->ged_dm->get_element_info($element_id);
- $file_name= $focused_element['name'];
- $file_description= $focused_element['description'];
- $validity_period= $focused_element['validity_period'];
+
$focused_element=$this->ged_dm->get_element_info($element_id);
+ $file_name=$focused_element['name'];
+ $file_description=$focused_element['description'];
+ $validity_period=$focused_element['validity_period'];
$last_version=$this->ged_dm->get_last_version($element_id);
@@ -1037,15 +1037,15 @@
$version_description=$last_version['description'];
$version_id=$last_version['version_id'];
- $current_version= $this->ged_dm->get_current_version($element_id);
+ $current_version=$this->ged_dm->get_current_version($element_id);
$version_major=$current_version['major']-$last_version['major'];
$version_minor=$current_version['minor']-$last_version['minor'];
- if ( $version_major != 0 )
+ if ( $version_major !=0 )
$version_type='major';
- elseif ( $version_minor != 0 )
+ elseif ( $version_minor !=0 )
$version_type='minor';
$this->t->set_var('update_version_action', lang('Update'));
@@ -1059,7 +1059,7 @@
}
- $this->t->set_file(array('update_file_tpl' =>
'update_file.tpl'));
+ $this->t->set_file(array('update_file_tpl'=>'update_file.tpl'));
$this->t->set_var('element_id_value', $element_id);
@@ -1069,21 +1069,21 @@
- $select_periods = $this->ged_dm->select_periods ();
+ $select_periods=$this->ged_dm->select_periods ();
- $select_period_html = '<select name="validity_period">\n';
+ $select_period_html='<select name="validity_period">\n';
foreach ($select_periods as $select_period)
{
- if ($select_period['period'] == $validity_period )
+ if ($select_period['period']==$validity_period )
{
- $select_period_html.= "<option
value=\"".$select_period['period']."\"
selected>".lang($select_period['description'])."</option>\n";
+ $select_period_html.="<option
value=\"".$select_period['period']."\"
selected>".lang($select_period['description'])."</option>\n";
}
else
{
- $select_period_html.= "<option
value=\"".$select_period['period']."\">".lang($select_period['description'])."</option>\n";
+ $select_period_html.="<option
value=\"".$select_period['period']."\">".lang($select_period['description'])."</option>\n";
}
}
- $select_period_html.= "</select>\n";
+ $select_period_html.="</select>\n";
$this->t->set_var('select_period', $select_period_html);
@@ -1101,7 +1101,7 @@
$this->t->set_var('version_type_label', lang($temp_type));
$this->t->set_var('version_type_value',$temp_type);
- if ( $version_type == $temp_type )
+ if ( $version_type==$temp_type )
$this->t->set_var('version_type_checked', 'checked');
else
$this->t->set_var('version_type_checked', '');
@@ -1117,7 +1117,7 @@
$this->t->set_var('version_status_label', lang($temp_status));
$this->t->set_var('version_status_value',$temp_status);
- if ( $version_status == $temp_status )
+ if ( $version_status==$temp_status )
$this->t->set_var('version_status_checked', 'checked');
else
$this->t->set_var('version_status_checked', '');
@@ -1138,34 +1138,34 @@
{
$element_id=get_var('element_id', array('GET', 'POST'));
- $delete_file = get_var('delete_file', array('GET', 'POST'));
+ $delete_file=get_var('delete_file', array('GET', 'POST'));
// Contrôle des droits
- if ( ! $this->ged_dm->can_write($element_id) || $element_id ==
0 )
+ if ( ! $this->ged_dm->can_write($element_id) || $element_id==0 )
{
- $link_data['menuaction']= 'ged.ged_ui.browse';
- $link_data['focused_id']= $element_id;
+ $link_data['menuaction']='ged.ged_ui.browse';
+ $link_data['focused_id']=$element_id;
header('Location:
'.$GLOBALS['phpgw']->link('/index.php', $link_data));
}
// Confirmation faite
- if ($delete_file == lang('Confirm deletion') )
+ if ($delete_file==lang('Confirm deletion') )
{
$parent_id=$this->ged_dm->delete_element($element_id);
- $link_data['menuaction']= 'ged.ged_ui.browse';
- $link_data['focused_id']= $parent_id;
+ $link_data['menuaction']='ged.ged_ui.browse';
+ $link_data['focused_id']=$parent_id;
header('Location:
'.$GLOBALS['phpgw']->link('/index.php', $link_data));
}
//Affichage du formulaire de confirmation
- $element_info= $this->ged_dm->get_element_info($element_id);
+ $element_info=$this->ged_dm->get_element_info($element_id);
$this->set_template_defaults();
$this->display_app_header();
- $this->t->set_file(array('delete_element_tpl' =>
'delete_element.tpl'));
+
$this->t->set_file(array('delete_element_tpl'=>'delete_element.tpl'));
$this->t->set_var('element_name', $element_info['name']);
$this->t->set_var('element_type', lang($element_info['type']));
@@ -1179,54 +1179,54 @@
function add_folder()
{
- $parent_id = get_var('parent_id', array('GET', 'POST'));
+ $parent_id=get_var('parent_id', array('GET', 'POST'));
- $link_data['menuaction']= 'ged.ged_ui.browse';
- $link_data['focused_id']= $parent_id;
+ $link_data['menuaction']='ged.ged_ui.browse';
+ $link_data['focused_id']=$parent_id;
if ( ! $this->ged_dm->can_write($parent_id) )
{
header('Location:
'.$GLOBALS['phpgw']->link('/index.php', $link_data));
}
- $add_folder = get_var('add_folder', array('GET', 'POST'));
- $name = get_var('name', array('GET', 'POST'));
- $description = get_var('description', array('GET', 'POST'));
- $referenceq = get_var('referenceq', array('GET', 'POST'));
+ $add_folder=get_var('add_folder', array('GET', 'POST'));
+ $name=get_var('name', array('GET', 'POST'));
+ $description=get_var('description', array('GET', 'POST'));
+ $referenceq=get_var('referenceq', array('GET', 'POST'));
$this->set_template_defaults();
- if ($parent_id == "")
- $parent_id= 0;
+ if ($parent_id=="")
+ $parent_id=0;
- if ($add_folder == lang('Add folder'))
+ if ($add_folder==lang('Add folder'))
{
- $new_folder['parent_id']= $parent_id;
- $new_folder['name']= $name;
- $new_folder['referenceq']= $referenceq;
- $new_folder['description']= $description;
+ $new_folder['parent_id']=$parent_id;
+ $new_folder['name']=$name;
+ $new_folder['referenceq']=$referenceq;
+ $new_folder['description']=$description;
$this->ged_dm->add_folder($new_folder);
- $folder_added= 'done';
+ $folder_added='done';
- if ($folder_added == 'done')
+ if ($folder_added=='done')
{
header('Location:
'.$GLOBALS['phpgw']->link('/index.php', $link_data));
}
}
- $this->t->set_file(array('add_folder_tpl' => 'add_folder.tpl'));
+ $this->t->set_file(array('add_folder_tpl'=>'add_folder.tpl'));
$this->set_template_defaults();
- $parent_element= $this->ged_dm->get_element_info($parent_id);
+ $parent_element=$this->ged_dm->get_element_info($parent_id);
// TODO precalcul de la reference
// TODO attention : forcer si répertoire chrono
- if ($reference != "")
+ if ($reference !="")
$this->t->set_var('new_reference', $reference);
else
$this->t->set_var('new_reference',
$parent_element['reference']."/");
@@ -1247,10 +1247,10 @@
function update_folder()
{
- $element_id = get_var('element_id', array('GET', 'POST'));
+ $element_id=get_var('element_id', array('GET', 'POST'));
- $link_data['menuaction']= 'ged.ged_ui.browse';
- $link_data['focused_id']= $element_id;
+ $link_data['menuaction']='ged.ged_ui.browse';
+ $link_data['focused_id']=$element_id;
if ( ! $this->ged_dm->can_write($element_id) )
{
@@ -1258,11 +1258,11 @@
}
- $update_folder = get_var('update_folder', array('GET', 'POST'));
+ $update_folder=get_var('update_folder', array('GET', 'POST'));
- $folder_name = get_var('folder_name', array('GET', 'POST'));
- $folder_description = get_var('folder_description',
array('GET', 'POST'));
- $folder_reference = get_var('folder_reference', array('GET',
'POST'));
+ $folder_name=get_var('folder_name', array('GET', 'POST'));
+ $folder_description=get_var('folder_description', array('GET',
'POST'));
+ $folder_reference=get_var('folder_reference', array('GET',
'POST'));
$this->set_template_defaults();
@@ -1279,22 +1279,22 @@
$this->t->set_var('folder_reference_field', 'folder_reference');
$this->t->set_var('folder_description_field',
'folder_description');
- if ($update_folder == lang('Update'))
+ if ($update_folder==lang('Update'))
{
- $new_folder['element_id']= $element_id;
+ $new_folder['element_id']=$element_id;
- $new_folder['name']= $folder_name;
- $new_folder['description']= $folder_description;
- $new_folder['reference']= $folder_reference;
+ $new_folder['name']=$folder_name;
+ $new_folder['description']=$folder_description;
+ $new_folder['reference']=$folder_reference;
$this->ged_dm->update_file($new_folder);
- $folder_updated= 'done';
+ $folder_updated='done';
- if ($folder_updated == 'done')
+ if ($folder_updated=='done')
{
- $link_data['menuaction']= 'ged.ged_ui.browse';
- $link_data['focused_id']= $element_id;
+ $link_data['menuaction']='ged.ged_ui.browse';
+ $link_data['focused_id']=$element_id;
header('Location:
'.$GLOBALS['phpgw']->link('/index.php', $link_data));
}
@@ -1302,14 +1302,14 @@
}
else
{
- $focused_element=
$this->ged_dm->get_element_info($element_id);
- $folder_name= $focused_element['name'];
- $folder_description= $focused_element['description'];
- $folder_reference= $focused_element['reference'];
+
$focused_element=$this->ged_dm->get_element_info($element_id);
+ $folder_name=$focused_element['name'];
+ $folder_description=$focused_element['description'];
+ $folder_reference=$focused_element['reference'];
}
- $this->t->set_file(array('update_folder_tpl' =>
'update_folder.tpl'));
+
$this->t->set_file(array('update_folder_tpl'=>'update_folder.tpl'));
$this->t->set_var('element_id_value', $element_id);
@@ -1329,35 +1329,35 @@
function delete_folder()
{
$element_id=get_var('element_id', array('GET', 'POST'));
- $delete_folder = get_var('delete_folder', array('GET', 'POST'));
+ $delete_folder=get_var('delete_folder', array('GET', 'POST'));
// Contrôle des droits
- if ( ! $this->ged_dm->can_write($element_id) || $element_id ==
0 )
+ if ( ! $this->ged_dm->can_write($element_id) || $element_id==0 )
{
- $link_data['menuaction']= 'ged.ged_ui.browse';
- $link_data['focused_id']= $element_id;
+ $link_data['menuaction']='ged.ged_ui.browse';
+ $link_data['focused_id']=$element_id;
header('Location:
'.$GLOBALS['phpgw']->link('/index.php', $link_data));
}
// Confirmation faite
- if ($delete_folder == lang('Confirm deletion') )
+ if ($delete_folder==lang('Confirm deletion') )
{
$parent_id=$this->ged_dm->delete_element($element_id);
- $link_data['menuaction']= 'ged.ged_ui.browse';
- $link_data['focused_id']= $parent_id;
+ $link_data['menuaction']='ged.ged_ui.browse';
+ $link_data['focused_id']=$parent_id;
header('Location:
'.$GLOBALS['phpgw']->link('/index.php', $link_data));
}
//Affichage du formulaire de confirmation
- $element_info= $this->ged_dm->get_element_info($element_id);
+ $element_info=$this->ged_dm->get_element_info($element_id);
$this->set_template_defaults();
$this->display_app_header();
- $this->t->set_file(array('delete_element_tpl' =>
'delete_element.tpl'));
+
$this->t->set_file(array('delete_element_tpl'=>'delete_element.tpl'));
$this->t->set_var('element_name', $element_info['name']);
$this->t->set_var('element_type', lang($element_info['type']));
@@ -1371,40 +1371,40 @@
function change_acl ()
{
- $element_id = get_var('element_id', array('GET', 'POST'));
- $update_acl = get_var('update_acl', array('POST'));
+ $element_id=get_var('element_id', array('GET', 'POST'));
+ $update_acl=get_var('update_acl', array('POST'));
$this->set_template_defaults();
$this->display_app_header();
- $this->t->set_file(array('change_acl_tpl' => 'change_acl.tpl'));
+ $this->t->set_file(array('change_acl_tpl'=>'change_acl.tpl'));
//Update if necessary toussa
- if ( $update_acl == lang ( "Update AC" ))
+ if ( $update_acl==lang ( "Update AC" ))
{
//_debug_array( $_POST );
$newacl=null;
$newacl=get_var('newacl', array('POST'));
- if ( $newacl['account_id'] != "" && ( $newacl['read']
== 'on' || $newacl['write'] == 'on' || $newacl['changeacl'] == 'on') )
+ if ( $newacl['account_id'] !="" && (
$newacl['read']=='on' || $newacl['write']=='on' || $newacl['changeacl']=='on') )
{
$read=null;
$write=null;
$changeacl=null;
$recursive=false;
- if ( $newacl['read'] == 'on' )
+ if ( $newacl['read']=='on' )
$read=1;
- if ( $newacl['write'] == 'on' )
+ if ( $newacl['write']=='on' )
$write=1;
- if ( $newacl['changeacl'] == 'on' )
+ if ( $newacl['changeacl']=='on' )
$changeacl=1;
- if ( $newacl['recursive'] == 'on' )
+ if ( $newacl['recursive']=='on' )
$recursive=true;
$this->ged_dm->new_acl($element_id,
$newacl['account_id'], $read, $write, $changeacl, $recursive);
@@ -1417,34 +1417,34 @@
$acl=get_var('acl', array('POST'));
if ( ! empty ( $acl ) )
- foreach ( $acl as $acl_id => $ac )
+ foreach ( $acl as $acl_id=>$ac )
{
$recursive=false;
- if ( $ac['read'] == 'on' ||
$ac['write'] == 'on' || $ac['changeacl'] == 'on' )
+ if ( $ac['read']=='on' ||
$ac['write']=='on' || $ac['changeacl']=='on' )
{
$read=null;
$write=null;
$changeacl=null;
- if ( $ac['read'] == 'on' )
+ if ( $ac['read']=='on' )
$read=1;
- if ( $ac['write'] == 'on' )
+ if ( $ac['write']=='on' )
$write=1;
- if ( $ac['changeacl'] == 'on' )
+ if ( $ac['changeacl']=='on' )
$changeacl=1;
- if ( $ac['recursive'] == 'on' )
+ if ( $ac['recursive']=='on' )
$recursive=true;
$this->ged_dm->set_acl($acl_id,
$read, $write, $changeacl,$recursive);
}
else
{
- if ( $ac['recursive'] == 'on' )
+ if ( $ac['recursive']=='on' )
$recursive=true;
$this->ged_dm->set_acl($acl_id,
'null', 'null', 'null', $recursive);
@@ -1461,9 +1461,9 @@
$element_info=$this->ged_dm->get_element_info($element_id);
- if ( $element_info['type'] == 'folder' )
+ if ( $element_info['type']=='folder' )
$element_name=lang("folder")." ".$element_info['name'];
- elseif ($element_info['type'] == 'file' )
+ elseif ($element_info['type']=='file' )
$element_name=lang("file")." ".$element_info['name'];
$this->t->set_var ( 'element_name', $element_name);
@@ -1475,21 +1475,21 @@
$this->t->set_var ( 'acl_id', $ac['acl_id']);
$this->t->set_var ( 'account',
$GLOBALS['phpgw']->common->grab_owner_name($ac['account_id']));
- if ( $ac['read'] == 1)
+ if ( $ac['read']==1)
$readflag="checked";
else
$readflag="";
$this->t->set_var ( 'readflag', $readflag);
- if ( $ac['write'] == 1)
+ if ( $ac['write']==1)
$writeflag="checked";
else
$writeflag="";
$this->t->set_var ( 'writeflag', $writeflag);
- if ( $ac['changeacl'] == 1)
+ if ( $ac['changeacl']==1)
$changeaclflag="checked";
else
$changeaclflag="";
@@ -1519,11 +1519,11 @@
}
}
- $link_data['menuaction']= 'ged.ged_ui.browse';
- $link_data['focused_id']= $element_id;
+ $link_data['menuaction']='ged.ged_ui.browse';
+ $link_data['focused_id']=$element_id;
$url_go_back=$GLOBALS['phpgw']->link('/index.php', $link_data);
- $js_go_back ="document.location='".$url_go_back."'";
+ $js_go_back="document.location='".$url_go_back."'";
$this->t->set_var ( 'js_action_go_back', $js_go_back );
$this->t->pfp('out', 'change_acl_tpl');
@@ -1532,12 +1532,12 @@
function approve_file()
{
- $element_id = get_var('element_id', array('GET', 'POST'));
+ $element_id=get_var('element_id', array('GET', 'POST'));
$this->ged_dm->approve_file ( $element_id );
- $link_data['menuaction']= 'ged.ged_ui.browse';
- $link_data['focused_id']= $element_id;
+ $link_data['menuaction']='ged.ged_ui.browse';
+ $link_data['focused_id']=$element_id;
header('Location: '.$GLOBALS['phpgw']->link('/index.php',
$link_data));
}
Index: inc/hook_settings.inc.php
===================================================================
RCS file: /sources/phpgroupware/ged/inc/hook_settings.inc.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- inc/hook_settings.inc.php 17 Jun 2006 18:06:33 -0000 1.2
+++ inc/hook_settings.inc.php 17 Jun 2006 18:19:26 -0000 1.3
@@ -15,9 +15,9 @@
* option) any later version.
*
\**************************************************************************/
- $yes_and_no = array(
- 'True' => 'Yes',
- 'False' => 'No'
+ $yes_and_no=array(
+ 'True'=>'Yes',
+ 'False'=>'No'
);
create_select_box('Show Ged applet on home
page','mainscreen_show_ged_news',$yes_and_no, 'Should Ged display the list of
new documents - approved since your last login - and warnings for documents
about to expire/needing approval');
Index: inc/class.ged_dm.inc.php
===================================================================
RCS file: /sources/phpgroupware/ged/inc/class.ged_dm.inc.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- inc/class.ged_dm.inc.php 17 Jun 2006 18:06:33 -0000 1.2
+++ inc/class.ged_dm.inc.php 17 Jun 2006 18:19:26 -0000 1.3
@@ -22,12 +22,12 @@
var $sqlaclchange_acl;
var $datadir;
- var $tables= Array('comments' => 'ged_comments', 'elements' =>
'ged_elements', 'history' => 'ged_history', 'mimetypes' => 'ged_mimes', 'acl'
=> 'ged_acl', 'versions' => 'ged_versions');
+ var $tables=Array('comments'=>'ged_comments',
'elements'=>'ged_elements', 'history'=>'ged_history', 'mimetypes'=>'ged_mimes',
'acl'=>'ged_acl', 'versions'=>'ged_versions');
function ged_dm()
{
// MEMO Le caractère "administrateur est plutôt lié à
l'activation du module Admin
- // MEMO => existence de
$GLOBALS['phpgw_info']['user']['apps']['admin']
+ // MEMO=>existence de
$GLOBALS['phpgw_info']['user']['apps']['admin']
$this->admin=isset($GLOBALS['phpgw_info']['user']['apps']['admin']);
// MEMO appartenance à des groupes
@@ -43,39 +43,39 @@
$or="OR ";
}
$sqlaclbase.=$or.$this->tables['acl'].".account_id=".$GLOBALS['phpgw_info']['user']['account_id']."
";
- $this->sqlaclread=$sqlaclbase.") AND (
".$this->tables['acl'].".aclread = 1 )";
- $this->sqlaclwrite=$sqlaclbase.") AND (
".$this->tables['acl'].".aclwrite = 1 )";
- $this->sqlaclchangeacl=$sqlaclbase.") AND (
".$this->tables['acl'].".aclchangeacl = 1 )";
+ $this->sqlaclread=$sqlaclbase.") AND (
".$this->tables['acl'].".aclread=1 )";
+ $this->sqlaclwrite=$sqlaclbase.") AND (
".$this->tables['acl'].".aclwrite=1 )";
+ $this->sqlaclchangeacl=$sqlaclbase.") AND (
".$this->tables['acl'].".aclchangeacl=1 )";
}
- //$this->ged_config= $GLOBALS['ged_config'];
- $config = CreateObject('phpgwapi.config','ged');
+ //$this->ged_config=$GLOBALS['ged_config'];
+ $config=CreateObject('phpgwapi.config','ged');
$config->read_repository();
- $this->ged_config = $config->config_data;
+ $this->ged_config=$config->config_data;
//_debug_array($this->ged_config);
unset($config);
// TODO a gérer via le (futur) hook d'admin
- $this->datadir =
$GLOBALS['phpgw_info']['server']['files_dir']."/ged-data";
+
$this->datadir=$GLOBALS['phpgw_info']['server']['files_dir']."/ged-data";
if ( ! is_dir ( $this->datadir ))
mkdir ( $this->datadir);
- $this->db= $GLOBALS['phpgw']->db;
- $this->owner=
intval($GLOBALS['phpgw_info']['user']['account_id']);
+ $this->db=$GLOBALS['phpgw']->db;
+
$this->owner=intval($GLOBALS['phpgw_info']['user']['account_id']);
- $this->db2= new db();
- $this->db2->Host= $this->db->Host;
- $this->db2->Type= $this->db->Type;
- $this->db2->Database= $this->db->Database;
- $this->db2->User= $this->db->User;
- $this->db2->Password= $this->db->Password;
+ $this->db2=new db();
+ $this->db2->Host=$this->db->Host;
+ $this->db2->Type=$this->db->Type;
+ $this->db2->Database=$this->db->Database;
+ $this->db2->User=$this->db->User;
+ $this->db2->Password=$this->db->Password;
}
function get_file_extention($filename)
{
- $ext= strtolower(substr(strrchr($filename, "."), 1));
+ $ext=strtolower(substr(strrchr($filename, "."), 1));
return $ext;
}
@@ -85,58 +85,58 @@
// MEMO gestion du stored_name pour éviter les écrasements.
- $basename= basename($new_file['file_name']);
- $candidate_name= $basename;
+ $basename=basename($new_file['file_name']);
+ $candidate_name=$basename;
- $extension= $this->get_file_extention($basename);
+ $extension=$this->get_file_extention($basename);
- $i= 0;
+ $i=0;
while (file_exists($this->datadir."/".$candidate_name))
{
$i ++;
- $candidate_name= "v".$i."_".$basename;
+ $candidate_name="v".$i."_".$basename;
}
- $new_name= $this->datadir."/".$candidate_name;
+ $new_name=$this->datadir."/".$candidate_name;
if (move_uploaded_file($new_file['file_tmp_name'], $new_name))
{
- $download_result= 'OK';
+ $download_result='OK';
}
else
{
- $download_result= 'NOK';
+ $download_result='NOK';
print ('NOOK FILE MOVE');
}
- if ($download_result == 'OK')
+ if ($download_result=='OK')
{
// TODO : ADD 'validity_period'
- $sql_model= "INSERT INTO %s ( type, parent_id, name,
reference, description, owner_id, creator_id, creation_date, doc_type,
validity_period ) VALUES ";
- $sql_model.= " ( '%s', %d, '%s', '%s', '%s', %d, %d,
%d, '%s', %d ) ";
+ $sql_model="INSERT INTO %s ( type, parent_id, name,
reference, description, owner_id, creator_id, creation_date, doc_type,
validity_period ) VALUES ";
+ $sql_model.=" ( '%s', %d, '%s', '%s', '%s', %d, %d, %d,
'%s', %d ) ";
- $sql= sprintf($sql_model, $this->tables['elements'],
'file', $new_file['parent_id'], $new_file['name'], $new_file['reference'],
$new_file['description'], $GLOBALS['phpgw_info']['user']['account_id'],
$GLOBALS['phpgw_info']['user']['account_id'], time(), $new_file['doc_type'],
$new_file['validity_period']);
+ $sql=sprintf($sql_model, $this->tables['elements'],
'file', $new_file['parent_id'], $new_file['name'], $new_file['reference'],
$new_file['description'], $GLOBALS['phpgw_info']['user']['account_id'],
$GLOBALS['phpgw_info']['user']['account_id'], time(), $new_file['doc_type'],
$new_file['validity_period']);
// TODO gestion des slashes !
//print ($sql);
$this->db->query($sql, __LINE__, __FILE__);
//récupérer l'id
- $new_element_id=
$this->db->get_last_insert_id($this->tables['elements'], 'element_id');
+
$new_element_id=$this->db->get_last_insert_id($this->tables['elements'],
'element_id');
$this->db->unlock();
// TODO gestion des slashes
- $sql_model1= "INSERT INTO %s ( size, file_name,
stored_name, file_extension, creator_id, creation_date, status, element_id,
description, major, minor ) VALUES ";
- $sql_model1.= " ( %d, '%s', '%s', '%s', %d, %d, '%s',
%d, '%s', %d, %d ) ";
+ $sql_model1="INSERT INTO %s ( size, file_name,
stored_name, file_extension, creator_id, creation_date, status, element_id,
description, major, minor ) VALUES ";
+ $sql_model1.=" ( %d, '%s', '%s', '%s', %d, %d, '%s',
%d, '%s', %d, %d ) ";
- $sql1= sprintf($sql_model1, $this->tables['versions'],
$new_file['file_size'], $new_file['file_name'], $candidate_name, $extension,
$GLOBALS['phpgw_info']['user']['account_id'], time(), 'current',
$new_element_id, lang("First version"), 1, 0);
+ $sql1=sprintf($sql_model1, $this->tables['versions'],
$new_file['file_size'], $new_file['file_name'], $candidate_name, $extension,
$GLOBALS['phpgw_info']['user']['account_id'], time(), 'current',
$new_element_id, lang("First version"), 1, 0);
//print ("<br/>".$sql1);
@@ -155,10 +155,10 @@
{
// TODO : ADD 'validity_period'
- $sql_model= "UPDATE %s set name='%s', description='%s',
reference='%s', validity_period=%s WHERE ";
- $sql_model.= " element_id=%d";
+ $sql_model="UPDATE %s set name='%s', description='%s',
reference='%s', validity_period=%s WHERE ";
+ $sql_model.=" element_id=%d";
- $sql= sprintf($sql_model, $this->tables['elements'],
$new_file['name'], $new_file['description'], $new_file['reference'],
$new_file['validity_period'], $new_file['element_id']);
+ $sql=sprintf($sql_model, $this->tables['elements'],
$new_file['name'], $new_file['description'], $new_file['reference'],
$new_file['validity_period'], $new_file['element_id']);
// TODO gestion des slashes !
//print ($sql);
@@ -170,13 +170,13 @@
function delete_element ( $element_id )
{
- $element_info= $this->get_element_info($element_id);
+ $element_info=$this->get_element_info($element_id);
switch ( $element_info['type'] )
{
case 'file':
//effacement des versions
- $versions = $this->list_versions($element_id);
+ $versions=$this->list_versions($element_id);
//_debug_array($versions);
@@ -190,7 +190,7 @@
}
// Effacement des versions
- $this->db->debug = true;
+ $this->db->debug=true;
$sqlv="DELETE FROM
`".$this->tables['versions']."` WHERE `element_id`=".$element_id;
$this->db->query($sqlv, __LINE__, __FILE__);
break;
@@ -216,7 +216,7 @@
// Effacement de l'element
$sqle="DELETE FROM `".$this->tables['elements']."` WHERE
`element_id`=".$element_id;
$this->db->query($sqle, __LINE__, __FILE__);
- $this->db->debug = false;
+ $this->db->debug=false;
return ($element_info['parent_id']);
@@ -227,40 +227,40 @@
// MEMO gestion des numeros de versions
- $cur_version=
$this->get_current_version($new_version['element_id']);
- $major= $cur_version['major'];
- $minor= $cur_version['minor'];
+
$cur_version=$this->get_current_version($new_version['element_id']);
+ $major=$cur_version['major'];
+ $minor=$cur_version['minor'];
- if ($new_version['type'] == 'major')
+ if ($new_version['type']=='major')
{
$major ++;
- $minor= 0;
+ $minor=0;
}
- elseif ($new_version['type'] == 'minor') $minor ++;
+ elseif ($new_version['type']=='minor') $minor ++;
else
return "PB Version";
// MEMO gestion du stored_name pour éviter les écrasements.
- $basename= basename($new_version['file_name']);
- $candidate_name= $basename;
+ $basename=basename($new_version['file_name']);
+ $candidate_name=$basename;
- $extension= $this->get_file_extention($basename);
+ $extension=$this->get_file_extention($basename);
- $i= 0;
+ $i=0;
while (file_exists($this->datadir."/".$candidate_name))
{
$i ++;
- $candidate_name= "v".$i."_".$basename;
+ $candidate_name="v".$i."_".$basename;
}
- $new_name= $this->datadir."/".$candidate_name;
+ $new_name=$this->datadir."/".$candidate_name;
if (move_uploaded_file($new_version['file_tmp_name'],
$new_name))
{
- $download_result= 'OK';
+ $download_result='OK';
}
else
@@ -268,13 +268,13 @@
// MEMO attention que if $new_version['status'] est current il
faut rendre obsolète la "vieille"
- if ($download_result == 'OK')
+ if ($download_result=='OK')
{
- $sql_model1= "INSERT INTO %s ( size, file_name,
stored_name, file_extension, creator_id, creation_date, status, element_id,
description, major, minor ) VALUES ";
- $sql_model1.= " ( %d, '%s', '%s', '%s', %d, %d, '%s',
%d, '%s', %d, %d ) ";
+ $sql_model1="INSERT INTO %s ( size, file_name,
stored_name, file_extension, creator_id, creation_date, status, element_id,
description, major, minor ) VALUES ";
+ $sql_model1.=" ( %d, '%s', '%s', '%s', %d, %d, '%s',
%d, '%s', %d, %d ) ";
- $sql1= sprintf($sql_model1, $this->tables['versions'],
$new_version['file_size'], $new_version['file_name'], $candidate_name,
$extension, $GLOBALS['phpgw_info']['user']['account_id'], time(),
$new_version['status'], $new_version['element_id'],
$new_version['description'], $major, $minor);
+ $sql1=sprintf($sql_model1, $this->tables['versions'],
$new_version['file_size'], $new_version['file_name'], $candidate_name,
$extension, $GLOBALS['phpgw_info']['user']['account_id'], time(),
$new_version['status'], $new_version['element_id'],
$new_version['description'], $major, $minor);
//print ("<br/>".$sql1);
@@ -283,10 +283,10 @@
}
- if ($new_version['status'] == "current")
+ if ($new_version['status']=="current")
{
- $sql_model2= "UPDATE %s set status='obsolete' WHERE version_id=%d";
- $sql2= sprintf($sql_model2, $this->tables['versions'],
$cur_version['version_id']);
+ $sql_model2="UPDATE %s set status='obsolete' WHERE version_id=%d";
+ $sql2=sprintf($sql_model2, $this->tables['versions'],
$cur_version['version_id']);
$this->db->query($sql2, __LINE__, __FILE__);
$this->db->unlock();
@@ -303,50 +303,50 @@
// MEMO gestion des numeros de versions
- $cur_version=
$this->get_current_version($amended_version['element_id']);
- $me_version=
$this->get_version_info($amended_version['version_id']);
+
$cur_version=$this->get_current_version($amended_version['element_id']);
+
$me_version=$this->get_version_info($amended_version['version_id']);
- $major= $cur_version['major'];
- $minor= $cur_version['minor'];
+ $major=$cur_version['major'];
+ $minor=$cur_version['minor'];
- if ($amended_version['type'] == 'major')
+ if ($amended_version['type']=='major')
{
$major ++;
- $minor= 0;
+ $minor=0;
}
- elseif ($amended_version['type'] == 'minor') $minor ++;
+ elseif ($amended_version['type']=='minor') $minor ++;
else
return "PB Version";
// MEMO gestion du stored_name pour éviter les écrasements.
- if ($amended_version['file_name'] != "")
+ if ($amended_version['file_name'] !="")
{
- $old_name=
$this->datadir."/".$me_version['stored_name'];
+ $old_name=$this->datadir."/".$me_version['stored_name'];
if (!unlink($old_name))
return ("cannot erase old file");
- $basename= basename($amended_version['file_name']);
- $candidate_name= $basename;
+ $basename=basename($amended_version['file_name']);
+ $candidate_name=$basename;
- $extension= $this->get_file_extention($basename);
+ $extension=$this->get_file_extention($basename);
- $i= 0;
+ $i=0;
while (file_exists($this->datadir."/".$candidate_name))
{
$i ++;
- $candidate_name= "v".$i."_".$basename;
+ $candidate_name="v".$i."_".$basename;
}
- $new_name= $this->datadir."/".$candidate_name;
+ $new_name=$this->datadir."/".$candidate_name;
if
(move_uploaded_file($amended_version['file_tmp_name'], $new_name))
{
- $download_result= 'OK';
+ $download_result='OK';
}
else
@@ -355,30 +355,30 @@
// MEMO attention que if $new_version['status'] est current il
faut rendre obsolète la "vieille"
- if ($download_result == 'OK')
+ if ($download_result=='OK')
{
- $sql_model1= "UPDATE %s set size=%d, file_name='%s',
stored_name='%s', file_extension='%s', ";
- $sql_model1.= "status='%s', description='%s', major=%d,
minor=%d ";
- $sql_model1.= "WHERE version_id=%d";
+ $sql_model1="UPDATE %s set size=%d, file_name='%s',
stored_name='%s', file_extension='%s', ";
+ $sql_model1.="status='%s', description='%s', major=%d,
minor=%d ";
+ $sql_model1.="WHERE version_id=%d";
- $sql1= sprintf($sql_model1, $this->tables['versions'],
$amended_version['file_size'], $amended_version['file_name'], $candidate_name,
$extension, $amended_version['status'], $amended_version['description'],
$major, $minor, $amended_version['version_id']);
+ $sql1=sprintf($sql_model1, $this->tables['versions'],
$amended_version['file_size'], $amended_version['file_name'], $candidate_name,
$extension, $amended_version['status'], $amended_version['description'],
$major, $minor, $amended_version['version_id']);
}
else
{
- $sql_model1= "UPDATE %s set ";
- $sql_model1.= "status='%s', description='%s', major=%d,
minor=%d ";
- $sql_model1.= "WHERE version_id=%d";
+ $sql_model1="UPDATE %s set ";
+ $sql_model1.="status='%s', description='%s', major=%d,
minor=%d ";
+ $sql_model1.="WHERE version_id=%d";
- $sql1= sprintf($sql_model1, $this->tables['versions'],
$amended_version['status'], $amended_version['description'], $major, $minor,
$amended_version['version_id']);
+ $sql1=sprintf($sql_model1, $this->tables['versions'],
$amended_version['status'], $amended_version['description'], $major, $minor,
$amended_version['version_id']);
}
$this->db->query($sql1, __LINE__, __FILE__);
$this->db->unlock();
- if ($amended_version['status'] == "current")
+ if ($amended_version['status']=="current")
{
- $sql_model2= "UPDATE %s set status='obsolete' WHERE
version_id=%d";
- $sql2= sprintf($sql_model2, $this->tables['versions'],
$cur_version['version_id']);
+ $sql_model2="UPDATE %s set status='obsolete' WHERE
version_id=%d";
+ $sql2=sprintf($sql_model2, $this->tables['versions'],
$cur_version['version_id']);
$this->db->query($sql2, __LINE__, __FILE__);
$this->db->unlock();
@@ -391,16 +391,16 @@
function add_folder($new_folder)
{
- $sql_model= "INSERT INTO %s ( type, parent_id, name, reference,
description, owner_id, creator_id, creation_date ) VALUES ";
- $sql_model.= " ( '%s', %d, '%s', '%s', '%s', %d, %d, %d) ";
+ $sql_model="INSERT INTO %s ( type, parent_id, name, reference,
description, owner_id, creator_id, creation_date ) VALUES ";
+ $sql_model.=" ( '%s', %d, '%s', '%s', '%s', %d, %d, %d) ";
- $sql= sprintf($sql_model, $this->tables['elements'], 'folder',
$new_folder['parent_id'], $new_folder['name'], $new_folder['steria_ref'],
$new_folder['description'], $GLOBALS['phpgw_info']['user']['account_id'],
$GLOBALS['phpgw_info']['user']['account_id'], time());
+ $sql=sprintf($sql_model, $this->tables['elements'], 'folder',
$new_folder['parent_id'], $new_folder['name'], $new_folder['steria_ref'],
$new_folder['description'], $GLOBALS['phpgw_info']['user']['account_id'],
$GLOBALS['phpgw_info']['user']['account_id'], time());
//print ($sql);
$this->db->query($sql, __LINE__, __FILE__);
- $new_element_id=
$this->db->get_last_insert_id($this->tables['elements'], 'element_id');
+
$new_element_id=$this->db->get_last_insert_id($this->tables['elements'],
'element_id');
$this->db->unlock();
@@ -418,30 +418,30 @@
if ( ! $this->can_read($element_id))
$element_id=0;
- $sql= "SELECT * FROM ".$this->tables['elements']." ";
- $sql.= "WHERE element_id=".$element_id."";
+ $sql="SELECT * FROM ".$this->tables['elements']." ";
+ $sql.="WHERE element_id=".$element_id."";
$this->db->query($sql, __LINE__, __FILE__);
if ($this->db->next_record())
{
- $out['element_id']= $this->db->f('element_id');
- $out['name']= $this->db->f('name');
- $out['parent_id']= $this->db->f('parent_id');
- $out['owner_id']= $this->db->f('owner_idR');
- $out['reference']= $this->db->f('reference');
- $out['type']= $this->db->f('type');
- $out['creator_id']= $this->db->f('creator_id');
- $out['owner_id']= $this->db->f('owner_id');
- $out['creation_date']= $this->db->f('creation_date');
- $out['lock_status']= $this->db->f('lock_status');
- $out['lock_user_id']= $this->db->f('lock_user_id');
- $out['description']= $this->db->f('description');
- $out['validity_period']=
$this->db->f('validity_period');
+ $out['element_id']=$this->db->f('element_id');
+ $out['name']=$this->db->f('name');
+ $out['parent_id']=$this->db->f('parent_id');
+ $out['owner_id']=$this->db->f('owner_idR');
+ $out['reference']=$this->db->f('reference');
+ $out['type']=$this->db->f('type');
+ $out['creator_id']=$this->db->f('creator_id');
+ $out['owner_id']=$this->db->f('owner_id');
+ $out['creation_date']=$this->db->f('creation_date');
+ $out['lock_status']=$this->db->f('lock_status');
+ $out['lock_user_id']=$this->db->f('lock_user_id');
+ $out['description']=$this->db->f('description');
+ $out['validity_period']=$this->db->f('validity_period');
// TODO : ADD 'validity_period' DONE
}
else
- $out= "";
+ $out="";
$this->db->unlock();
@@ -450,29 +450,29 @@
function get_version_info($version_id)
{
- $sql= "SELECT * FROM ".$this->tables['versions']." ";
- $sql.= "WHERE version_id=".$version_id." ";
+ $sql="SELECT * FROM ".$this->tables['versions']." ";
+ $sql.="WHERE version_id=".$version_id." ";
$this->db->query($sql, __LINE__, __FILE__);
if ($this->db->next_record());
{
- $version['url']= $this->db->f('url');
- $version['size']= $this->db->f('size');
- $version['status']= $this->db->f('status');
- $version['creator_id']= $this->db->f('creator_id');
- $version['creation_date']=
$this->db->f('creation_date');
- $version['minor']= $this->db->f('minor');
- $version['version_id']= $this->db->f('version_id');
- $version['element_id']= $this->db->f('element_id');
- $version['description']= $this->db->f('description');
- $version['file_extension']=
$this->db->f('file_extension');
- $version['file_name']= $this->db->f('file_name');
- $version['stored_name']= $this->db->f('stored_name');
- $version['major']= $this->db->f('major');
- $version['mime_type']=
$this->get_mime_type($version['file_extension']);
- $version['file_full_path']=
$this->datadir.'/'.$version['stored_name'];
+ $version['url']=$this->db->f('url');
+ $version['size']=$this->db->f('size');
+ $version['status']=$this->db->f('status');
+ $version['creator_id']=$this->db->f('creator_id');
+ $version['creation_date']=$this->db->f('creation_date');
+ $version['minor']=$this->db->f('minor');
+ $version['version_id']=$this->db->f('version_id');
+ $version['element_id']=$this->db->f('element_id');
+ $version['description']=$this->db->f('description');
+
$version['file_extension']=$this->db->f('file_extension');
+ $version['file_name']=$this->db->f('file_name');
+ $version['stored_name']=$this->db->f('stored_name');
+ $version['major']=$this->db->f('major');
+
$version['mime_type']=$this->get_mime_type($version['file_extension']);
+
$version['file_full_path']=$this->datadir.'/'.$version['stored_name'];
}
@@ -485,9 +485,9 @@
function get_last_version($element_id)
{
- $sql= "SELECT * FROM ".$this->tables['versions']." ";
- $sql.= "WHERE element_id=".$element_id." ";
- $sql.= "ORDER BY version_id DESC LIMIT 1";
+ $sql="SELECT * FROM ".$this->tables['versions']." ";
+ $sql.="WHERE element_id=".$element_id." ";
+ $sql.="ORDER BY version_id DESC LIMIT 1";
//print ( $sql );
@@ -496,22 +496,22 @@
if ($this->db->next_record());
{
- $version['url']= $this->db->f('url');
- $version['size']= $this->db->f('size');
- $version['status']= $this->db->f('status');
- $version['creator_id']= $this->db->f('creator_id');
- $version['creation_date']=
$this->db->f('creation_date');
- $version['minor']= $this->db->f('minor');
- $version['version_id']= $this->db->f('version_id');
- $version['element_id']= $this->db->f('element_id');
- $version['description']= $this->db->f('description');
- $version['file_extension']=
$this->db->f('file_extension');
- $version['file_name']= $this->db->f('file_name');
- $version['stored_name']= $this->db->f('stored_name');
- $version['major']= $this->db->f('major');
- $version['mime_type']=
$this->get_mime_type($version['file_extension']);
- $version['file_full_path']=
$this->datadir.'/'.$version['stored_name'];
- $version['validation_date'] =
$this->db->f('validation_date');
+ $version['url']=$this->db->f('url');
+ $version['size']=$this->db->f('size');
+ $version['status']=$this->db->f('status');
+ $version['creator_id']=$this->db->f('creator_id');
+ $version['creation_date']=$this->db->f('creation_date');
+ $version['minor']=$this->db->f('minor');
+ $version['version_id']=$this->db->f('version_id');
+ $version['element_id']=$this->db->f('element_id');
+ $version['description']=$this->db->f('description');
+
$version['file_extension']=$this->db->f('file_extension');
+ $version['file_name']=$this->db->f('file_name');
+ $version['stored_name']=$this->db->f('stored_name');
+ $version['major']=$this->db->f('major');
+
$version['mime_type']=$this->get_mime_type($version['file_extension']);
+
$version['file_full_path']=$this->datadir.'/'.$version['stored_name'];
+
$version['validation_date']=$this->db->f('validation_date');
}
$this->db->unlock();
@@ -522,12 +522,12 @@
function get_current_version($element_id)
{
- //$this->db->Debug = true;
+ //$this->db->Debug=true;
- $sql= "SELECT * FROM ".$this->tables['versions']." ";
- $sql.= "WHERE element_id=".$element_id." ";
- $sql.= "AND status='current' ";
- $sql.= "ORDER BY version_id DESC LIMIT 1";
+ $sql="SELECT * FROM ".$this->tables['versions']." ";
+ $sql.="WHERE element_id=".$element_id." ";
+ $sql.="AND status='current' ";
+ $sql.="ORDER BY version_id DESC LIMIT 1";
//print ("<pre>");
//print_r($this->db->metadata( $this->tables['versions'] ));
@@ -539,27 +539,27 @@
if ($this->db->next_record());
{
- $version['validation_date'] =
$this->db->f('validation_date');
- $version['url']= $this->db->f('url');
- $version['size']= $this->db->f('size');
- $version['status']= $this->db->f('status');
- $version['creator_id']= $this->db->f('creator_id');
- $version['creation_date']=
$this->db->f('creation_date');
- $version['minor']= $this->db->f('minor');
- $version['version_id']= $this->db->f('version_id');
- $version['element_id']= $this->db->f('element_id');
- $version['description']= $this->db->f('description');
- $version['file_extension']=
$this->db->f('file_extension');
- $version['file_name']= $this->db->f('file_name');
- $version['stored_name']= $this->db->f('stored_name');
- $version['major']= $this->db->f('major');
- $version['mime_type']=
$this->get_mime_type($version['file_extension']);
- $version['file_full_path']=
$this->datadir.'/'.$version['stored_name'];
+
$version['validation_date']=$this->db->f('validation_date');
+ $version['url']=$this->db->f('url');
+ $version['size']=$this->db->f('size');
+ $version['status']=$this->db->f('status');
+ $version['creator_id']=$this->db->f('creator_id');
+ $version['creation_date']=$this->db->f('creation_date');
+ $version['minor']=$this->db->f('minor');
+ $version['version_id']=$this->db->f('version_id');
+ $version['element_id']=$this->db->f('element_id');
+ $version['description']=$this->db->f('description');
+
$version['file_extension']=$this->db->f('file_extension');
+ $version['file_name']=$this->db->f('file_name');
+ $version['stored_name']=$this->db->f('stored_name');
+ $version['major']=$this->db->f('major');
+
$version['mime_type']=$this->get_mime_type($version['file_extension']);
+
$version['file_full_path']=$this->datadir.'/'.$version['stored_name'];
}
$this->db->unlock();
- //$this->db->Debug = false;
+ //$this->db->Debug=false;
return $version;
@@ -567,15 +567,15 @@
function get_parent_id($item_id)
{
- $sql= "SELECT parent_id FROM ".$this->tables['elements']." ";
- $sql.= "WHERE element_id=".$item_id."";
+ $sql="SELECT parent_id FROM ".$this->tables['elements']." ";
+ $sql.="WHERE element_id=".$item_id."";
$this->db->query($sql, __LINE__, __FILE__);
if ($this->db->next_record())
- $out= $this->db->f('parent_id');
+ $out=$this->db->f('parent_id');
else
- $out= 0;
+ $out=0;
$this->db->unlock();
@@ -584,13 +584,13 @@
function get_path($focused_id)
{
- $current_id= $focused_id;
- $path[]= $current_id;
+ $current_id=$focused_id;
+ $path[]=$current_id;
- while ($current_id != 0)
+ while ($current_id !=0)
{
- $current_id= $this->get_parent_id($current_id);
- $path[]= $current_id;
+ $current_id=$this->get_parent_id($current_id);
+ $path[]=$current_id;
}
return $path;
@@ -600,7 +600,7 @@
{
foreach ($path as $node_id)
{
- if ($element['element_id'] == $node_id)
+ if ($element['element_id']==$node_id)
return true;
}
return false;
@@ -623,7 +623,7 @@
$this->db->query($sql0, __LINE__, __FILE__);
- $result=($this->db->next_record() || $element_id== 0);
+ $result=($this->db->next_record() || $element_id==0);
$this->db->unlock();
}
@@ -694,17 +694,17 @@
}
// TODO acl management DONE
- function list_elements($parent_id= 0, $type= '', $order= 'name')
+ function list_elements($parent_id=0, $type='', $order='name')
{
if ( $this->admin )
{
- $sql= "SELECT * FROM ".$this->tables['elements']." ";
- $sql.= "WHERE parent_id=".$parent_id." ";
- $sql.= "AND element_id != parent_id ";
- if ($type != "" )
- $sql.= "AND type='".$type."'";
- $sql.= "ORDER by type desc, element_id asc";
+ $sql="SELECT * FROM ".$this->tables['elements']." ";
+ $sql.="WHERE parent_id=".$parent_id." ";
+ $sql.="AND element_id !=parent_id ";
+ if ($type !="" )
+ $sql.="AND type='".$type."'";
+ $sql.="ORDER by type desc, element_id asc";
$this->db->query($sql, __LINE__, __FILE__);
@@ -712,16 +712,16 @@
}
elseif ( $this->can_read($parent_id) )
{
- $sql= "SELECT DISTINCTROW
".$this->tables['elements'].".* ";
- $sql.= "FROM ".$this->tables['elements'].",
".$this->tables['acl']." ";
- $sql.= "WHERE
".$this->tables['elements'].".parent_id=".$parent_id." ";
- $sql.= "AND ".$this->tables['elements'].".element_id !=
".$this->tables['elements'].".parent_id ";
- if ($type != "" )
- $sql.= "AND
".$this->tables['elements'].".type='".$type."' ";
+ $sql="SELECT DISTINCTROW
".$this->tables['elements'].".* ";
+ $sql.="FROM ".$this->tables['elements'].",
".$this->tables['acl']." ";
+ $sql.="WHERE
".$this->tables['elements'].".parent_id=".$parent_id." ";
+ $sql.="AND ".$this->tables['elements'].".element_id
!=".$this->tables['elements'].".parent_id ";
+ if ($type !="" )
+ $sql.="AND
".$this->tables['elements'].".type='".$type."' ";
$sql.="AND
".$this->tables['elements'].".element_id=".$this->tables['acl'].".element_id ";
$sql.="AND (".$this->sqlaclread.") ";
- $sql.= "ORDER by type desc, element_id asc";
+ $sql.="ORDER by type desc, element_id asc";
$this->db->query($sql, __LINE__, __FILE__);
}
@@ -729,22 +729,22 @@
- $i= 0;
+ $i=0;
while ($this->db->next_record())
{
- $elements[$i]['element_id']= $this->db->f('element_id');
- $elements[$i]['name']= $this->db->f('name');
- $elements[$i]['parent_id']= $this->db->f('parent_id');
- $elements[$i]['reference']= $this->db->f('reference');
- $elements[$i]['type']= $this->db->f('type');
- $elements[$i]['creator_id']= $this->db->f('creator_id');
- $elements[$i]['owner_id']= $this->db->f('owner_id');
- $elements[$i]['creation_date']=
$this->db->f('creation_date');
- $elements[$i]['lock_status']=
$this->db->f('lock_status');
- $elements[$i]['lock_user_id']=
$this->db->f('lock_user_id');
- $elements[$i]['description']=
$this->db->f('description');
- $elements[$i]['validity_period']=
$this->db->f('validity_period');
+ $elements[$i]['element_id']=$this->db->f('element_id');
+ $elements[$i]['name']=$this->db->f('name');
+ $elements[$i]['parent_id']=$this->db->f('parent_id');
+ $elements[$i]['reference']=$this->db->f('reference');
+ $elements[$i]['type']=$this->db->f('type');
+ $elements[$i]['creator_id']=$this->db->f('creator_id');
+ $elements[$i]['owner_id']=$this->db->f('owner_id');
+
$elements[$i]['creation_date']=$this->db->f('creation_date');
+
$elements[$i]['lock_status']=$this->db->f('lock_status');
+
$elements[$i]['lock_user_id']=$this->db->f('lock_user_id');
+
$elements[$i]['description']=$this->db->f('description');
+
$elements[$i]['validity_period']=$this->db->f('validity_period');
$i ++;
}
@@ -760,40 +760,40 @@
if ( $this->admin || $this->can_write($element_id))
{
- $sql1= "SELECT ALL ";
- $sql1.= "version_id, element_id, description,
creation_date, ";
- $sql1.= "status, major, minor, size, ";
- $sql1.= "creator_id, validation_date, file_extension, ";
- $sql1.= "file_name, stored_name ";
-
- $sql1.= "FROM ".$this->tables['versions']." ";
- $sql1.= "WHERE element_id=".$element_id." ";
- $sql1.= "ORDER BY version_id ";
+ $sql1="SELECT ALL ";
+ $sql1.="version_id, element_id, description,
creation_date, ";
+ $sql1.="status, major, minor, size, ";
+ $sql1.="creator_id, validation_date, file_extension, ";
+ $sql1.="file_name, stored_name ";
+
+ $sql1.="FROM ".$this->tables['versions']." ";
+ $sql1.="WHERE element_id=".$element_id." ";
+ $sql1.="ORDER BY version_id ";
//print ($sql1);
$this->db2->query($sql1, __LINE__, __FILE__);
- $ii= 0;
+ $ii=0;
while ($this->db2->next_record())
{
- $versions[$ii]['version_id']=
$this->db2->f('version_id');
- $versions[$ii]['element_id']=
$this->db2->f('element_id');
- $versions[$ii]['description']=
$this->db2->f('description');
- $versions[$ii]['status']=
$this->db2->f('status');
- $versions[$ii]['major']= $this->db2->f('major');
- $versions[$ii]['minor']= $this->db2->f('minor');
- $versions[$ii]['creator_id']=
$this->db2->f('creator_id');
- $versions[$ii]['creation_date']=
$this->db2->f('creation_date');
- $versions[$ii]['size']= $this->db2->f('size');
- $versions[$ii]['file_extension']=
$this->db2->f('file_extension');
- $versions[$ii]['file_name']=
$this->db2->f('file_name');
- $versions[$ii]['stored_name']=
$this->db2->f('stored_name');
- $versions[$ii]['mime_type']=
$this->get_mime_type($versions[$ii]['file_extension']);
- $versions[$ii]['file_full_path']=
$this->datadir.'/'.$versions[$ii]['stored_name'];
- $versions[$ii]['validation_date'] =
$this->db2->f('validation_date');
+
$versions[$ii]['version_id']=$this->db2->f('version_id');
+
$versions[$ii]['element_id']=$this->db2->f('element_id');
+
$versions[$ii]['description']=$this->db2->f('description');
+
$versions[$ii]['status']=$this->db2->f('status');
+ $versions[$ii]['major']=$this->db2->f('major');
+ $versions[$ii]['minor']=$this->db2->f('minor');
+
$versions[$ii]['creator_id']=$this->db2->f('creator_id');
+
$versions[$ii]['creation_date']=$this->db2->f('creation_date');
+ $versions[$ii]['size']=$this->db2->f('size');
+
$versions[$ii]['file_extension']=$this->db2->f('file_extension');
+
$versions[$ii]['file_name']=$this->db2->f('file_name');
+
$versions[$ii]['stored_name']=$this->db2->f('stored_name');
+
$versions[$ii]['mime_type']=$this->get_mime_type($versions[$ii]['file_extension']);
+
$versions[$ii]['file_full_path']=$this->datadir.'/'.$versions[$ii]['stored_name'];
+
$versions[$ii]['validation_date']=$this->db2->f('validation_date');
$ii ++;
}
@@ -811,16 +811,16 @@
function get_mime_type($file_extension)
{
- $sql_model= "SELECT mime_type FROM %s WHERE file_extension='%s'
";
+ $sql_model="SELECT mime_type FROM %s WHERE file_extension='%s'
";
- $sql= sprintf($sql_model, $this->tables['mimetypes'],
$file_extension);
+ $sql=sprintf($sql_model, $this->tables['mimetypes'],
$file_extension);
$this->db->query($sql, __LINE__, __FILE__);
if ($this->db->next_record())
- $out= $this->db->f('mime_type');
+ $out=$this->db->f('mime_type');
else
- $out= "default";
+ $out="default";
return $out;
@@ -849,19 +849,19 @@
function list_elements_of_type ( $product_type )
{
//TODO : limiter en fonction des droits
- $sql="select * from ged_elements where doc_type =
'".$product_type."'";
+ $sql="select * from ged_elements where
doc_type='".$product_type."'";
$this->db->query($sql, __LINE__, __FILE__);
- $ii= 0;
+ $ii=0;
while ($this->db->next_record())
{
- $elements[$ii]['element_id']=
$this->db->f('element_id');
- $elements[$ii]['name']= $this->db->f('name');
- $elements[$ii]['reference']= $this->db->f('reference');
- $elements[$ii]['description']=
$this->db->f('description');
- $elements[$ii]['validity_period']=
$this->db->f('validity_period');
+ $elements[$ii]['element_id']=$this->db->f('element_id');
+ $elements[$ii]['name']=$this->db->f('name');
+ $elements[$ii]['reference']=$this->db->f('reference');
+
$elements[$ii]['description']=$this->db->f('description');
+
$elements[$ii]['validity_period']=$this->db->f('validity_period');
// TODO : ADD 'validity_period' DONE
$ii ++;
}
@@ -889,7 +889,7 @@
$acl=null;
//TODO : limiter en fonction des droits
- $sql="select * from ged_acl where element_id = ".$element_id;
+ $sql="select * from ged_acl where element_id=".$element_id;
$this->db->query($sql, __LINE__, __FILE__);
while ($this->db->next_record())
@@ -898,12 +898,12 @@
//print ( "acct: $account_id " );
- $acl[$account_id]['acl_id']= $this->db->f('acl_id');
- $acl[$account_id]['element_id']=
$this->db->f('element_id');
- $acl[$account_id]['account_id']= $account_id;
- $acl[$account_id]['read']= $this->db->f('aclread');
- $acl[$account_id]['write']= $this->db->f('aclwrite');
- $acl[$account_id]['changeacl']=
$this->db->f('aclchangeacl');
+ $acl[$account_id]['acl_id']=$this->db->f('acl_id');
+
$acl[$account_id]['element_id']=$this->db->f('element_id');
+ $acl[$account_id]['account_id']=$account_id;
+ $acl[$account_id]['read']=$this->db->f('aclread');
+ $acl[$account_id]['write']=$this->db->f('aclwrite');
+
$acl[$account_id]['changeacl']=$this->db->f('aclchangeacl');
}
@@ -923,12 +923,12 @@
if ($this->db->next_record())
{
- $acl_info['acl_id']= $this->db->f('acl_id');
- $acl_info['element_id']= $this->db->f('element_id');
- $acl_info['account_id']= $this->db->f('account_id');
- $acl_info['read']= $this->db->f('aclread');
- $acl_info['write']= $this->db->f('aclwrite');
- $acl_info['changeacl']= $this->db->f('aclchangeacl');
+ $acl_info['acl_id']=$this->db->f('acl_id');
+ $acl_info['element_id']=$this->db->f('element_id');
+ $acl_info['account_id']=$this->db->f('account_id');
+ $acl_info['read']=$this->db->f('aclread');
+ $acl_info['write']=$this->db->f('aclwrite');
+ $acl_info['changeacl']=$this->db->f('aclchangeacl');
}
$this->db->unlock();
@@ -940,16 +940,16 @@
function get_element_acl_candidates ( $element_id )
{
//TODO : limiter en fonction des droits
- $sql="SELECT phpgw_accounts.* FROM phpgw_accounts LEFT JOIN
ged_acl ON ( ged_acl.account_id = phpgw_accounts.account_id and
ged_acl.element_id = ".$element_id.") WHERE ged_acl.element_id is null;";
+ $sql="SELECT phpgw_accounts.* FROM phpgw_accounts LEFT JOIN
ged_acl ON ( ged_acl.account_id=phpgw_accounts.account_id and
ged_acl.element_id=".$element_id.") WHERE ged_acl.element_id is null;";
$this->db->query($sql, __LINE__, __FILE__);
- $ii= 0;
+ $ii=0;
while ($this->db->next_record())
{
- $acl[$ii]['account_id']= $this->db->f('account_id');
- $acl[$ii]['account_type']= $this->db->f('account_type');
+ $acl[$ii]['account_id']=$this->db->f('account_id');
+ $acl[$ii]['account_type']=$this->db->f('account_type');
$ii ++;
}
@@ -987,7 +987,7 @@
$this->new_acl($element_id, $account_id, 1,
'null', 'null', false, false);
}
- if ( $element_id != "0" )
+ if ( $element_id !="0" )
{
$parent_id=$this->get_parent_id($element_id);
$this->ensure_read_on_path($parent_id, $account_id );
@@ -1000,12 +1000,12 @@
//print ( "new_acl $element_id, $account_id, $aclread,
$aclwrite, $aclchangeacl" );
//print ( "<br/>");
- if ($aclread == "" || $aclread == "null" )
+ if ($aclread=="" || $aclread=="null" )
$aclread="null";
else
$aclread=1;
- if ($aclwrite == "" || $aclwrite == "null")
+ if ($aclwrite=="" || $aclwrite=="null")
$aclwrite="null";
else
{
@@ -1013,7 +1013,7 @@
$aclwrite=1;
}
- if ($aclchangeacl == "" || $aclchangeacl == "null")
+ if ($aclchangeacl=="" || $aclchangeacl=="null")
$aclchangeacl="null";
else
{
@@ -1043,7 +1043,7 @@
}
}
- if ( $aclread != 'null' )
+ if ( $aclread !='null' )
{
$sql="INSERT INTO ged_acl ( `element_id`, `account_id`,
`aclread`, `aclwrite`, `aclchangeacl` ) VALUES ( ".$element_id.",
".$account_id.", ".$aclread.", ".$aclwrite.", ".$aclchangeacl.")";
@@ -1055,7 +1055,7 @@
$this->db->unlock();
}
- if ( $check_read_on_path && $aclread != 'null' )
+ if ( $check_read_on_path && $aclread !='null' )
{
$parent_id=$this->get_parent_id($element_id);
$this->ensure_read_on_path($parent_id, $account_id);
@@ -1072,9 +1072,9 @@
// Héritage des droits du parent
function set_default_acl($element_id)
{
- $owner_id = $GLOBALS['phpgw_info']['user']['account_id'];
+ $owner_id=$GLOBALS['phpgw_info']['user']['account_id'];
$this->new_acl($element_id, $owner_id, 1, 1, 1);
- $admin_id = $GLOBALS['phpgw']->accounts->name2id('Admins');
+ $admin_id=$GLOBALS['phpgw']->accounts->name2id('Admins');
$this->new_acl($element_id, $admin_id, 1, 1, 1);
//héritage des droits du parent
@@ -1084,7 +1084,7 @@
if ( is_array($parent_acl))
foreach ( $parent_acl as $ac )
{
- if ( $ac['account_id'] != $owner_id &&
$ac['account_id'] != $admin_id )
+ if ( $ac['account_id'] !=$owner_id && $ac['account_id']
!=$admin_id )
$this->new_acl($element_id, $ac['account_id'],
$ac['read'],$ac['write'], $ac['change_acl']);
}
@@ -1103,12 +1103,12 @@
$element_id=$acl_info['element_id'];
$account_id=$acl_info['account_id'];
- if ($aclread == "" || $aclread == "null" )
+ if ($aclread=="" || $aclread=="null" )
$aclread="null";
else
$aclread=1;
- if ($aclwrite == "" || $aclwrite == "null")
+ if ($aclwrite=="" || $aclwrite=="null")
$aclwrite="null";
else
{
@@ -1116,7 +1116,7 @@
$aclwrite=1;
}
- if ($aclchangeacl == "" || $aclchangeacl == "null")
+ if ($aclchangeacl=="" || $aclchangeacl=="null")
$aclchangeacl="null";
else
{
@@ -1150,7 +1150,7 @@
}
}
- if ( $aclread == 'null' )
+ if ( $aclread=='null' )
$this->rm_acl($acl_id);
else
{
@@ -1161,7 +1161,7 @@
}
//Control remontant
- if ( $check_read_on_path && $aclread != 'null' )
+ if ( $check_read_on_path && $aclread !='null' )
{
$parent_id=$this->get_parent_id($element_id);
$this->ensure_read_on_path($parent_id,
$acl_info['account_id']);
@@ -1188,15 +1188,15 @@
function select_periods()
{
- $sql = "SELECT distinct * from ged_periods ORDER BY period";
+ $sql="SELECT distinct * from ged_periods ORDER BY period";
$this->db->query($sql);
- $i = 0;
+ $i=0;
while ($this->db->next_record())
{
- $periods[$i]['period'] = $this->db->f('period');
- $periods[$i]['description'] =
$this->db->f('description');
+ $periods[$i]['period']=$this->db->f('period');
+ $periods[$i]['description']=$this->db->f('description');
$i ++;
}
return $periods;
@@ -1220,24 +1220,24 @@
$session_id=$GLOBALS['phpgw_info']['user']['sessionid'];
$account_id=$GLOBALS['phpgw_info']['user']['account_id'];
- $sql0="select max(li) as llt from phpgw_access_log where
account_id=".$account_id." and sessionid != \"".$session_id."\"";
+ $sql0="select max(li) as llt from phpgw_access_log where
account_id=".$account_id." and sessionid !=\"".$session_id."\"";
$this->db->query($sql0);
if ( $this->db->next_record() )
- $then= 0 + $this->db->f('llt');
+ $then=0 + $this->db->f('llt');
$this->db->unlock();
// List new suff
$sql="SELECT * from ged_elements INNER JOIN ged_versions ON
ged_elements.element_id=ged_versions.element_id ";
- $sql.="WHERE ged_versions.status='current' AND (
ged_versions.validation_date >= $then ";
- $sql.="OR ( ( ged_elements.validity_period > 0 OR
ged_elements.validity_period IS NOT NULL) AND ged_versions.creation_date >=
$then ))";
+ $sql.="WHERE ged_versions.status='current' AND (
ged_versions.validation_date >=$then ";
+ $sql.="OR ( ( ged_elements.validity_period > 0 OR
ged_elements.validity_period IS NOT NULL) AND ged_versions.creation_date
>=$then ))";
$this->db->query($sql);
- $i = 0;
+ $i=0;
while ($this->db->next_record())
{
$element_id=$this->db->f('element_id');
@@ -1245,9 +1245,9 @@
if ( $this->can_read($element_id) )
{
$docs[$i]['element_id']=$element_id;
- $docs[$i]['name']= $this->db->f('name');
- $docs[$i]['reference']=
$this->db->f('reference');
- $docs[$i]['description']=
$this->db->f('description');
+ $docs[$i]['name']=$this->db->f('name');
+
$docs[$i]['reference']=$this->db->f('reference');
+
$docs[$i]['description']=$this->db->f('description');
$i ++;
}
}
@@ -1259,7 +1259,7 @@
function list_documents_to_expire ($period=0)
{
- if ( $period == 0 )
+ if ( $period==0 )
$period=$GLOBALS['phpgw_info']['user']['preferences']['ged']['warn_approval_within'];
$now=time();
@@ -1271,7 +1271,7 @@
$this->db->query($sql);
- $i = 0;
+ $i=0;
while ($this->db->next_record())
{
$element_id=$this->db->f('element_id');
@@ -1279,12 +1279,12 @@
if ( $this->can_read($element_id) )
{
$docs[$i]['element_id']=$element_id;
- $docs[$i]['name']= $this->db->f('name');
- $docs[$i]['reference']=
$this->db->f('reference');
- $docs[$i]['description']=
$this->db->f('description');
- $docs[$i]['validity_period']=
$this->db->f('validity_period');
- $docs[$i]['validation_date']=
$this->db->f('validation_date');
- $docs[$i]['expiration_date']=
$docs[$i]['validity_period']+$docs[$i]['validation_date'];
+ $docs[$i]['name']=$this->db->f('name');
+
$docs[$i]['reference']=$this->db->f('reference');
+
$docs[$i]['description']=$this->db->f('description');
+
$docs[$i]['validity_period']=$this->db->f('validity_period');
+
$docs[$i]['validation_date']=$this->db->f('validation_date');
+
$docs[$i]['expiration_date']=$docs[$i]['validity_period']+$docs[$i]['validation_date'];
$i ++;
}
}
Index: inc/hook_admin.inc.php
===================================================================
RCS file: /sources/phpgroupware/ged/inc/hook_admin.inc.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- inc/hook_admin.inc.php 17 Jun 2006 18:06:33 -0000 1.2
+++ inc/hook_admin.inc.php 17 Jun 2006 18:19:26 -0000 1.3
@@ -13,10 +13,10 @@
{
// Only Modify the $file and $title variables.....
- $file = Array
+ $file=Array
(
- 'Site Configuration' =>
$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiconfig.index&appname='
. $appname)
-// 'Accountancy' =>
$GLOBALS['phpgw']->link('/index.php','menuaction=projects.uiprojects.list_admins&action=pbo'),
+ 'Site
Configuration'=>$GLOBALS['phpgw']->link('/index.php','menuaction=admin.uiconfig.index&appname='
. $appname)
+//
'Accountancy'=>$GLOBALS['phpgw']->link('/index.php','menuaction=projects.uiprojects.list_admins&action=pbo'),
);
//Do not modify below this line
display_section($appname,$appname,$file);
Index: inc/hook_preferences.inc.php
===================================================================
RCS file: /sources/phpgroupware/ged/inc/hook_preferences.inc.php,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -b -r1.1.1.1 -r1.2
--- inc/hook_preferences.inc.php 30 Mar 2006 12:29:13 -0000 1.1.1.1
+++ inc/hook_preferences.inc.php 17 Jun 2006 18:19:26 -0000 1.2
@@ -12,10 +12,10 @@
{
// Only Modify the $file and $title variables.....
- $title = $appname;
- $file = Array
+ $title=$appname;
+ $file=Array
(
- 'Preferences' =>
$GLOBALS['phpgw']->link('/preferences/preferences.php','appname='.$appname),
+
'Preferences'=>$GLOBALS['phpgw']->link('/preferences/preferences.php','appname='.$appname),
);
//Do not modify below this line
Index: doc/TODO
===================================================================
RCS file: /sources/phpgroupware/ged/doc/TODO,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -b -r1.1 -r1.2
--- doc/TODO 17 Jun 2006 18:05:22 -0000 1.1
+++ doc/TODO 17 Jun 2006 18:19:26 -0000 1.2
@@ -9,9 +9,9 @@
DONE : $GLOBALS['phpgw']->common->phpgw_header(true);
DONE : should work in 16 fine like that too
-$object -> method() should be $object->method(), it is easier on the
-eyes and makes for smaller files. Smaller files compile faster and so
-the script runs faster :)
+DONE : $object -> method() should be $object->method(), it is easier on the
+DONE : eyes and makes for smaller files. Smaller files compile faster and so
+DONE : the script runs faster :)
The view/download methods should use the methods in the phpgwapi.browser
class.
@@ -19,9 +19,10 @@
Check with Benoit but readfile($version['file_full_path']); I think
should really use the vfs method for returning the contents of a file.
-$this->t = $GLOBALS['phpgw']->template should be a reference like so
-$this->t =& $GLOBALS['phpgw']->template. Reduces memory consumption in
-php4 and works properly in php5. Make sure you use a $this->t->set_root
+DONE : $this->t = $GLOBALS['phpgw']->template should be a reference like so
+DONE : $this->t =& $GLOBALS['phpgw']->template. Reduces memory consumption in
+DONE : php4 and works properly in php5.
+Make sure you use a $this->t->set_root
in the constructor too. Similar thing for the db class.
The icons, cache them in an array, but only when you need them. look at
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] ged index.php setup/tables_current.inc.php setu...,
Pascal Vilarem <=