From 519b3851865ec599017d6f735f4e9fae2c55bd04 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Mon, 24 Nov 2008 10:51:59 +0000 Subject: [PATCH 001/510] setting trunk version to 1.7.001 --- phpgwapi/setup/setup.inc.php | 2 +- phpgwapi/setup/tables_update.inc.php | 585 +--------------------- phpgwapi/setup/tables_update_1_4.inc.php | 604 +++++++++++++++++++++++ 3 files changed, 610 insertions(+), 581 deletions(-) create mode 100644 phpgwapi/setup/tables_update_1_4.inc.php diff --git a/phpgwapi/setup/setup.inc.php b/phpgwapi/setup/setup.inc.php index c5e55fdd3b..134b49d89d 100755 --- a/phpgwapi/setup/setup.inc.php +++ b/phpgwapi/setup/setup.inc.php @@ -12,7 +12,7 @@ /* Basic information about this app */ $setup_info['phpgwapi']['name'] = 'phpgwapi'; $setup_info['phpgwapi']['title'] = 'eGroupWare API'; -$setup_info['phpgwapi']['version'] = '1.5.017'; +$setup_info['phpgwapi']['version'] = '1.7.001'; $setup_info['phpgwapi']['versions']['current_header'] = '1.29'; $setup_info['phpgwapi']['enable'] = 3; $setup_info['phpgwapi']['app_order'] = 1; diff --git a/phpgwapi/setup/tables_update.inc.php b/phpgwapi/setup/tables_update.inc.php index 00a3937720..79776917c8 100644 --- a/phpgwapi/setup/tables_update.inc.php +++ b/phpgwapi/setup/tables_update.inc.php @@ -2,7 +2,7 @@ /** * eGroupWare - API Setup * - * Update scripts 1.4 --> 1.6 + * Update scripts 1.6 --> 1.8 * * @link http://www.egroupware.org * @package api @@ -18,587 +18,12 @@ include('tables_update_0_9_12.inc.php'); include('tables_update_0_9_14.inc.php'); include('tables_update_1_0.inc.php'); include('tables_update_1_2.inc.php'); - -// updates from the stable 1.4 branch -$test[] = '1.4.001'; -function phpgwapi_upgrade1_4_001() -{ - return $GLOBALS['setup_info']['phpgwapi']['currentver'] = '1.5.001'; -} - -$test[] = '1.4.002'; -function phpgwapi_upgrade1_4_002() -{ - return $GLOBALS['setup_info']['phpgwapi']['currentver'] = '1.5.001'; -} - -$test[] = '1.4.003'; -function phpgwapi_upgrade1_4_003() -{ - return $GLOBALS['setup_info']['phpgwapi']['currentver'] = '1.5.001'; -} - -$test[] = '1.4.004'; -function phpgwapi_upgrade1_4_004() -{ - return $GLOBALS['setup_info']['phpgwapi']['currentver'] = '1.5.001'; -} - -$test[] = '1.5.001'; -function phpgwapi_upgrade1_5_001() -{ - $GLOBALS['egw_setup']->oProc->AlterColumn('egw_addressbook','org_name',array( - 'type' => 'varchar', - 'precision' => '128', - 'nullable' => true - )); - $GLOBALS['egw_setup']->oProc->AlterColumn('egw_addressbook','contact_email',array( - 'type' => 'varchar', - 'precision' => '128', - 'nullable' => true - )); - $GLOBALS['egw_setup']->oProc->AlterColumn('egw_addressbook','contact_email_home',array( - 'type' => 'varchar', - 'precision' => '128', - 'nullable' => true - )); - - return $GLOBALS['setup_info']['phpgwapi']['currentver'] = '1.5.002'; -} - -$test[] = '1.5.002'; -function phpgwapi_upgrade1_5_002() -{ - $GLOBALS['egw_setup']->oProc->CreateTable('egw_sqlfs',array( - 'fd' => array( - 'fs_id' => array('type' => 'auto','nullable' => False), - 'fs_dir' => array('type' => 'int','precision' => '4','nullable' => False), - 'fs_name' => array('type' => 'varchar','precision' => '200','nullable' => False), - 'fs_mode' => array('type' => 'int','precision' => '2','nullable' => False), - 'fs_uid' => array('type' => 'int','precision' => '4','nullable' => False,'default' => '0'), - 'fs_gid' => array('type' => 'int','precision' => '4','nullable' => False,'default' => '0'), - 'fs_created' => array('type' => 'timestamp','precision' => '8','nullable' => False,'default' => 'current_timestamp'), - 'fs_modified' => array('type' => 'timestamp','precision' => '8','nullable' => False), - 'fs_mime' => array('type' => 'varchar','precision' => '64','nullable' => False), - 'fs_size' => array('type' => 'int','precision' => '8','nullable' => False), - 'fs_creator' => array('type' => 'int','precision' => '4','nullable' => False), - 'fs_modifier' => array('type' => 'int','precision' => '4'), - 'fs_active' => array('type' => 'bool','nullable' => False,'default' => 't'), - 'fs_comment' => array('type' => 'varchar','precision' => '255'), - 'fs_content' => array('type' => 'blob') - ), - 'pk' => array('fs_id'), - 'fk' => array(), - 'ix' => array(array('fs_dir','fs_active','fs_name')), - 'uc' => array() - )); - - return $GLOBALS['setup_info']['phpgwapi']['currentver'] = '1.5.003'; -} - -$test[] = '1.5.003'; -function phpgwapi_upgrade1_5_003() -{ - // import the current egw_vfs into egw_sqlfs - // ToDo: moving /infolog and /infolog/$app to /apps in the files dir!!! - $debug = $GLOBALS['DEBUG']; - - // delete the table in case this update runs multiple times - $GLOBALS['egw_setup']->db->query('DELETE FROM egw_sqlfs',__LINE__,__FILE__); - if ($GLOBALS['egw_setup']->db->Type == 'mysql') - { - $GLOBALS['egw_setup']->db->query('ALTER TABLE egw_sqlfs AUTO_INCREMENT=1',__LINE__,__FILE__); - } - // make sure the required dirs are there and have the following id's - $dirs = array( - '/' => 1, - '/home' => 2, - '/apps' => 3, - ); - foreach($dirs as $path => $id) - { - $nrow = array( - 'fs_id' => $id, - 'fs_dir' => $path == '/' ? 0 : $dirs['/'], - 'fs_name' => substr($path,1), - 'fs_mode' => 05, - 'fs_uid' => 0, - 'fs_gid' => 0, - 'fs_created' => time(), - 'fs_modified' => time(), - 'fs_mime' => 'httpd/unix-directory', - 'fs_size' => 0, - 'fs_creator' => 0, - 'fs_modifier' => 0, - 'fs_comment' => null, - 'fs_content' => null, - ); - $GLOBALS['egw_setup']->db->insert('egw_sqlfs',$nrow,false,__LINE__,__FILE__,'phpgwapi'); - } - $query = $GLOBALS['egw_setup']->db->select('egw_vfs','*',"vfs_mime_type != 'journal' AND vfs_mime_type != 'journal-deleted'",__LINE__,__FILE__,false,'ORDER BY length(vfs_directory) ASC','phpgwapi'); - if ($debug) echo "rows=
\n";
-
-	foreach($query as $row)
-	{
-		// rename the /infolog dir to /apps/infolog and /infolog/$app /apps/$app
-		if (substr($row['vfs_directory'],0,8) == '/infolog')
-		{
-			$parts = explode('/',$row['vfs_directory']);	// 0 = '', 1 = 'infolog', 2 = app or info_id
-			//$parts[1] = is_numeric($parts[2]) ? 'apps/infolog' : 'apps';
-			$parts[1] = $row['vfs_directory']=='/infolog' && is_numeric($row['vfs_name']) ||
-				$parts[1]=='infolog' && is_numeric($parts[2]) ? 'apps/infolog' : 'apps';
-			$row['vfs_directory'] = implode('/',$parts);
-		}
-		elseif ($row['vfs_directory'] == '/' && $row['vfs_name'] == 'infolog')
-		{
-			$row['vfs_directory'] = '/apps';
-		}
-		$nrow = array(
-			'fs_dir'  => $dirs[$row['vfs_directory']],
-			'fs_name' => $row['vfs_name'],
-			'fs_mode' => $row['vfs_owner_id'] > 0 ?
-				($row['vfs_mime_type'] == 'Directory' ? 0700 : 0600) :
-				($row['vfs_mime_type'] == 'Directory' ? 0070 : 0060),
-			'fs_uid' => $row['vfs_owner_id'] > 0 ? $row['vfs_owner_id'] : 0,
-			'fs_gid' => $row['vfs_owner_id'] < 0 ? -$row['vfs_owner_id'] : 0,
-			'fs_created' => $row['vfs_created'],
-			'fs_modified' => $row['vfs_modified'] ? $row['vfs_modified'] : $row['vfs_created'],
-			'fs_mime' => $row['vfs_mime_type'] == 'Directory' ? 'httpd/unix-directory' :
-				($row['vfs_mime_type'] ? $row['vfs_mime_type'] : 'application/octet-stream'),
-			'fs_size' => $row['vfs_size'],
-			'fs_creator' => $row['vfs_createdby_id'],
-			'fs_modifier' => $row['vfs_modifedby_id'],
-			'fs_comment' => $row['vfs_comment'] ? $row['vfs_comment'] : null,
-			'fs_content' => $row['vfs_content'],
-		);
-		if ($debug)
-		{
-			foreach($row as $key => $val)
-			{
-				if (is_numeric($key)) unset($row[$key]);
-			}
-			print_r($row);
-			print_r($nrow);
-		}
-		if ($row['vfs_mime_type'] == 'Directory')
-		{
-			$dir = ($row['vfs_directory'] == '/' ? '' : $row['vfs_directory']).'/'.$row['vfs_name'];
-
-			if (!isset($dirs[$dir]))	// ignoring doublicate dirs, my devel box has somehow many of them specially /home
-			{
-				$GLOBALS['egw_setup']->db->insert('egw_sqlfs',$nrow,false,__LINE__,__FILE__,'phpgwapi');
-				$dirs[$dir] = $GLOBALS['egw_setup']->db->get_last_insert_id('egw_sqlfs','fs_id');
-				if ($debug) echo "$dir = {$dirs[$dir]}\n";
-			}
-			elseif ($debug)
-			{
-				echo "ignoring doublicate directory '$dir'!\n";
-			}
-		}
-		else
-		{
-			$GLOBALS['egw_setup']->db->insert('egw_sqlfs',$nrow,false,__LINE__,__FILE__,'phpgwapi');
-		}
-
-	}
-	if ($debug)
-	{
-		echo "dirs=";
-		print_r($dirs);
-		echo "
\n"; - } - return $GLOBALS['setup_info']['phpgwapi']['currentver'] = '1.5.004'; -} - -$test[] = '1.5.004'; -function phpgwapi_upgrade1_5_004() -{ - // convert the filemanager group grants into extended ACL - - // delete all sqlfs entries from the ACL table, in case we run multiple times - $GLOBALS['egw_setup']->db->delete('egw_acl',array('acl_appname' => sqlfs_stream_wrapper::EACL_APPNAME),__LINE__,__FILE__); - - $GLOBALS['egw_setup']->setup_account_object(); - $accounts = $GLOBALS['egw_setup']->accounts; - $accounts = new accounts(); - - egw_vfs::$is_root = true; // we need root rights to set the extended acl, without being the owner - - foreach($GLOBALS['egw_setup']->db->select('egw_acl','*',array( - 'acl_appname' => 'filemanager', - "acl_location != 'run'", - ),__LINE__,__FILE__) as $row) - { - $rights = egw_vfs::READABLE | egw_vfs::EXECUTABLE; - if($row['acl_rights'] > 1) $rights |= egw_vfs::WRITABLE; - - if (($lid = $accounts->id2name($row['acl_account'])) && $accounts->exists($row['acl_location'])) - { - $ret = sqlfs_stream_wrapper::eacl('/home/'.$lid,$rights,(int)$row['acl_location']); - //echo "

sqlfs_stream_wrapper::eacl('/home/$lid',$rights,$row[acl_location])=$ret

\n"; - } - } - egw_vfs::$is_root = false; - - return $GLOBALS['setup_info']['phpgwapi']['currentver'] = '1.5.005'; -} - -$test[] = '1.5.005'; -function phpgwapi_upgrade1_5_005() -{ - // move /infolog/$app to /apps/$app and /infolog to /apps/infolog - - $files_dir = $GLOBALS['egw_setup']->db->select('egw_config','config_value',array( - 'config_name' => 'files_dir', - 'config_app' => 'phpgwapi', - ),__LINE__,__FILE__)->fetchSingle(); - - if ($files_dir && file_exists($files_dir) && file_exists($files_dir.'/infolog')) - { - mkdir($files_dir.'/apps',0700,true); - if (($dir = opendir($files_dir.'/infolog'))) - { - while(($app = readdir($dir))) - { - if (!is_numeric($app) && $app[0] != '.') // ingore infolog entries and . or .. - { - rename($files_dir.'/infolog/'.$app,$files_dir.'/apps/'.$app); - } - } - closedir($dir); - rename($files_dir.'/infolog',$files_dir.'/apps/infolog'); - } - } - - return $GLOBALS['setup_info']['phpgwapi']['currentver'] = '1.5.006'; -} - -$test[] = '1.5.006'; -function phpgwapi_upgrade1_5_006() -{ - // drop filescenter tables, if filecenter is not installed - static $filescenter_tables = array( - 'phpgw_vfs2_mimetypes', - 'phpgw_vfs2_files', - 'phpgw_vfs2_customfields', - 'phpgw_vfs2_quota', - 'phpgw_vfs2_shares', - 'phpgw_vfs2_versioning', - 'phpgw_vfs2_customfields_data', - 'phpgw_vfs2_prefixes', - ); - $filescenter_app = $GLOBALS['egw_setup']->db->select('egw_applications','*',array( - 'app_name' => 'filescenter', - ),__LINE__,__FILE__)->fetchSingle(); - - if (!$filescenter_app || !is_dir(EGW_INCLUDE_ROOT.'/filescenter')) - { - foreach($filescenter_tables as $table) - { - $GLOBALS['egw_setup']->oProc->DropTable($table); - } - if ($filescenter_app) // app installed, but no sources --> deinstall it - { - $GLOBALS['egw_setup']->db->delete('egw_applications',array( - 'app_name' => 'filescenter', - ),__LINE__,__FILE__); - } - } - else - { - // move tables to the filescenter app - $GLOBALS['egw_setup']->db->update('egw_applications',array( - 'app_tables' => implode(',',$filescenter_tables), - ),array( - 'app_name' => 'filescenter', - ),__LINE__,__FILE__); - } - - return $GLOBALS['setup_info']['phpgwapi']['currentver'] = '1.5.007'; -} - -$test[] = '1.5.007'; -function phpgwapi_upgrade1_5_007() -{ - // tables for the eGW-wide index - - foreach(array( - 'egw_index_keywords' => array( - 'fd' => array( - 'si_id' => array('type' => 'auto','nullable' => False), - 'si_keyword' => array('type' => 'varchar','precision' => '64','nullable' => False), - 'si_ignore' => array('type' => 'bool') - ), - 'pk' => array('si_id'), - 'fk' => array(), - 'ix' => array(), - 'uc' => array('si_keyword') - ), - 'egw_index' => array( - 'fd' => array( - 'si_app' => array('type' => 'varchar','precision' => '25','nullable' => False), - 'si_app_id' => array('type' => 'varchar','precision' => '50','nullable' => False), - 'si_id' => array('type' => 'int','precision' => '4','nullable' => False), - 'si_owner' => array('type' => 'int','precision' => '4','nullable' => False) - ), - 'pk' => array('si_app','si_app_id','si_id'), - 'fk' => array(), - 'ix' => array('si_id'), - 'uc' => array() - ), - 'egw_cat2entry' => array( - 'fd' => array( - 'ce_app' => array('type' => 'varchar','precision' => '25','nullable' => False), - 'ce_app_id' => array('type' => 'varchar','precision' => '50','nullable' => False), - 'cat_id' => array('type' => 'int','precision' => '4','nullable' => False), - 'ce_owner' => array('type' => 'int','precision' => '4','nullable' => False) - ), - 'pk' => array('ce_app','ce_app_id','cat_id'), - 'fk' => array(), - 'ix' => array('cat_id'), - 'uc' => array() - )) as $table => $definition) - { - $GLOBALS['egw_setup']->oProc->CreateTable($table,$definition); - } - - return $GLOBALS['setup_info']['phpgwapi']['currentver'] = '1.5.008'; -} - -$test[] = '1.5.008'; -function phpgwapi_upgrade1_5_008() -{ - // add UID and etag columns to addressbook, required eg. for CardDAV - $GLOBALS['egw_setup']->oProc->AddColumn('egw_addressbook','contact_etag',array( - 'type' => 'int', - 'precision' => '4', - 'default' => '0', - )); - - // add UID column to addressbook, required eg. for CardDAV - $GLOBALS['egw_setup']->oProc->AddColumn('egw_addressbook','contact_uid',array( - 'type' => 'varchar', - 'precision' => '255' - )); - - $GLOBALS['egw_setup']->db->query("SELECT config_value FROM egw_config WHERE config_app='phpgwapi' AND config_name='install_id'",__LINE__,__FILE__); - $install_id = $GLOBALS['egw_setup']->db->next_record() ? $GLOBALS['egw_setup']->db->f(0) : md5(time()); - $GLOBALS['egw_setup']->db->query('UPDATE egw_addressbook SET contact_uid='.$GLOBALS['egw_setup']->db->concat("'addressbook-'",'contact_id',"'-$install_id'"),__LINE__,__FILE__); - - $GLOBALS['egw_setup']->oProc->CreateIndex('egw_addressbook',array('contact_uid'),false); - - return $GLOBALS['setup_info']['phpgwapi']['currentver'] = '1.5.009'; -} - -$test[] = '1.5.009'; -function phpgwapi_upgrade1_5_009() -{ - $GLOBALS['egw_setup']->oProc->CreateTable('egw_locks',array( - 'fd' => array( - 'lock_token' => array('type' => 'varchar','precision' => '255','nullable' => False), - 'lock_path' => array('type' => 'varchar','precision' => '255','nullable' => False), - 'lock_expires' => array('type' => 'int','precision' => '8','nullable' => False), - 'lock_owner' => array('type' => 'varchar','precision' => '255'), - 'lock_recursive' => array('type' => 'bool','nullable' => False,'default' => '0'), - 'lock_write' => array('type' => 'bool','nullable' => False,'default' => '0'), - 'lock_exclusive' => array('type' => 'bool','nullable' => False,'default' => '0'), - 'lock_created' => array('type' => 'int','precision' => '8','default' => '0'), - 'lock_modified' => array('type' => 'int','precision' => '8','default' => '0') - ), - 'pk' => array('lock_token'), - 'fk' => array(), - 'ix' => array('lock_path','lock_expires'), - 'uc' => array() - )); - - return $GLOBALS['setup_info']['phpgwapi']['currentver'] = '1.5.010'; -} - -function phpgwapi_upgrade1_5_010() -{ - $GLOBALS['egw_setup']->oProc->AddColumn('egw_applications','app_icon',array( - 'type' => 'varchar', - 'precision' => '32' - )); - $GLOBALS['egw_setup']->oProc->AddColumn('egw_applications','app_icon_app',array( - 'type' => 'varchar', - 'precision' => '25' - )); - $GLOBALS['egw_setup']->oProc->AddColumn('egw_applications','app_index',array( - 'type' => 'varchar', - 'precision' => '64' - )); - - return $GLOBALS['setup_info']['phpgwapi']['currentver'] = '1.5.011'; -} +include('tables_update_1_4.inc.php'); /** - * Move sqlfs files from their path based location to the new (hashed) id base one and removed the not longer used dirs - * - * @return string + * Update from the stable 1.6 branch to the new devel branch 1.7.xxx */ -function phpgwapi_upgrade1_5_011() +function phpgwapi_upgrade1_6_001() { - if ($GLOBALS['DEBUG'] && isset($_SERVER['HTTP_HOST'])) echo "
\n";
-	egw_vfs::$is_root = true;
-	egw_vfs::load_wrapper('sqlfs');
-	egw_vfs::find('sqlfs://default/',array(
-		'url'  => true,
-		'depth' => true,
-	),create_function('$url,$stat','
-		$new_path = sqlfs_stream_wrapper::_fs_path($stat["ino"]);	// loads egw_info/server/files_dir (!)
-		if (file_exists($old_path = $GLOBALS["egw_info"]["server"]["files_dir"].($path=parse_url($url,PHP_URL_PATH))))
-		{
-			if (!is_dir($old_path))
-			{
-				if ($GLOBALS["DEBUG"]) echo "moving file $old_path --> $new_path\n";
-				if (!file_exists($parent = dirname($new_path))) mkdir($parent,0777,true);	// 777 because setup-cli might run eg. by root
-				rename($old_path,$new_path);
-			}
-			elseif($path != "/")
-			{
-				if ($GLOBALS["DEBUG"]) echo "removing directory $old_path\n";
-				rmdir($old_path);
-			}
-		}
-		elseif(!($stat["mode"] & sqlfs_stream_wrapper::MODE_DIR))
-		{
-			echo "phpgwapi_upgrade1_5_011() $url: $old_path not found!\n";
-		}
-	'));
-	if ($GLOBALS['DEBUG'] && isset($_SERVER['HTTP_HOST'])) echo "
\n"; - - return $GLOBALS['setup_info']['phpgwapi']['currentver'] = '1.5.012'; -} - -function phpgwapi_upgrade1_5_012() -{ - $GLOBALS['egw_setup']->oProc->CreateTable('egw_sqlfs_props',array( - 'fd' => array( - 'fs_id' => array('type' => 'int','precision' => '4','nullable' => False), - 'prop_namespace' => array('type' => 'varchar','precision' => '64','nullable' => False), - 'prop_name' => array('type' => 'varchar','precision' => '64','nullable' => False), - 'prop_value' => array('type' => 'text') - ), - 'pk' => array('fs_id','prop_namespace','prop_name'), - 'fk' => array(), - 'ix' => array(), - 'uc' => array() - )); - - return $GLOBALS['setup_info']['phpgwapi']['currentver'] = '1.5.013'; -} - -function phpgwapi_upgrade1_5_013() -{ - foreach($GLOBALS['egw_setup']->db->select('egw_sqlfs','fs_id,fs_comment',"fs_comment IS NOT NULL AND fs_comment != ''",__LINE__,__FILE__) as $row) - { - $GLOBALS['egw_setup']->db->insert('egw_sqlfs_props',array( - 'fs_id' => $row['fs_id'], - 'prop_namespace' => 'http://egroupware.org/', - 'prop_name' => 'comment', - 'prop_value' => $row['fs_comment'], - ),false,__LINE__,__FILE__); - } - $GLOBALS['egw_setup']->oProc->DropColumn('egw_sqlfs',array( - 'fd' => array( - 'fs_id' => array('type' => 'auto','nullable' => False), - 'fs_dir' => array('type' => 'int','precision' => '4','nullable' => False), - 'fs_name' => array('type' => 'varchar','precision' => '200','nullable' => False), - 'fs_mode' => array('type' => 'int','precision' => '2','nullable' => False), - 'fs_uid' => array('type' => 'int','precision' => '4','nullable' => False,'default' => '0'), - 'fs_gid' => array('type' => 'int','precision' => '4','nullable' => False,'default' => '0'), - 'fs_created' => array('type' => 'timestamp','precision' => '8','nullable' => False,'default' => 'current_timestamp'), - 'fs_modified' => array('type' => 'timestamp','precision' => '8','nullable' => False), - 'fs_mime' => array('type' => 'varchar','precision' => '64','nullable' => False), - 'fs_size' => array('type' => 'int','precision' => '8','nullable' => False), - 'fs_creator' => array('type' => 'int','precision' => '4','nullable' => False), - 'fs_modifier' => array('type' => 'int','precision' => '4'), - 'fs_active' => array('type' => 'bool','nullable' => False,'default' => 't'), - 'fs_content' => array('type' => 'blob') - ), - 'pk' => array('fs_id'), - 'fk' => array(), - 'ix' => array(array('fs_dir','fs_active','fs_name')), - 'uc' => array() - ),'fs_comment'); - - // no automatic timestamp for created field, as it would update on every update - $GLOBALS['egw_setup']->oProc->AlterColumn('egw_sqlfs','fs_created',array( - 'type' => 'timestamp', - 'precision' => '8', - 'nullable' => False - )); - - return $GLOBALS['setup_info']['phpgwapi']['currentver'] = '1.5.014'; -} - -function phpgwapi_upgrade1_5_014() -{ - $GLOBALS['egw_setup']->oProc->AlterColumn('egw_history_log','history_status',array( - 'type' => 'varchar', - 'precision' => '64', - 'nullable' => False - )); - - return $GLOBALS['setup_info']['phpgwapi']['currentver'] = '1.5.015'; -} - -/** - * Move files created directly in the root of sqlfs (fs_id < 100) into a /00 directory, - * as they would conflict with dirnames in that directory. - * - * This update does nothing, if the files are already in the correct directory - */ -function phpgwapi_upgrade1_5_015() -{ - sqlfs_stream_wrapper::_fs_path(1); // loads egw_info/server/files_dir (!) - $sqlfs_dir = $GLOBALS['egw_info']['server']['files_dir'].'/sqlfs'; - - if (file_exists($sqlfs_dir) && ($d = opendir($sqlfs_dir))) - { - while(($f = readdir($d))) - { - if (is_file($old_name = $sqlfs_dir.'/'.$f)) - { - if (!$zero_dir) - { - if ($GLOBALS['DEBUG'] && isset($_SERVER['HTTP_HOST'])) echo "
\n";
- 					mkdir($zero_dir = $sqlfs_dir.'/00',0777);
-					echo "created dir for files with fs_id < 100: $zero_dir\n";
-				}
-				$new_name = $zero_dir.'/'.$f;
-				if ($GLOBALS['DEBUG']) echo "moving file $old_name --> $new_name\n";
-				rename($old_name,$new_name);
-			}
-		}
-		closedir($d);
-		if ($GLOBALS['DEBUG'] && isset($_SERVER['HTTP_HOST']) && $zero_dir) echo "
\n"; - } - - return $GLOBALS['setup_info']['phpgwapi']['currentver'] = '1.5.016'; -} - -/** - * Drop no longer needed egw_api_content_history.sync_guid column - */ -function phpgwapi_upgrade1_5_016() -{ - $GLOBALS['egw_setup']->oProc->DropColumn('egw_api_content_history',array( - 'fd' => array( - 'sync_appname' => array('type' => 'varchar','precision' => '60','nullable' => False), - 'sync_contentid' => array('type' => 'varchar','precision' => '60','nullable' => False), - 'sync_added' => array('type' => 'timestamp'), - 'sync_modified' => array('type' => 'timestamp'), - 'sync_deleted' => array('type' => 'timestamp'), - 'sync_id' => array('type' => 'auto','nullable' => False), - 'sync_changedby' => array('type' => 'int','precision' => '4','nullable' => False) - ), - 'pk' => array('sync_id'), - 'fk' => array(), - 'ix' => array('sync_added','sync_modified','sync_deleted','sync_guid','sync_changedby',array('sync_appname','sync_contentid')), - 'uc' => array() - ),'sync_guid'); - - return $GLOBALS['setup_info']['phpgwapi']['currentver'] = '1.5.017'; + return $GLOBALS['setup_info']['phpgwapi']['currentver'] = '1.7.001'; } diff --git a/phpgwapi/setup/tables_update_1_4.inc.php b/phpgwapi/setup/tables_update_1_4.inc.php new file mode 100644 index 0000000000..5423cd1fad --- /dev/null +++ b/phpgwapi/setup/tables_update_1_4.inc.php @@ -0,0 +1,604 @@ + 1.6 + * + * @link http://www.egroupware.org + * @package api + * @subpackage setup + * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License + * @version $Id$ + */ + +// updates from the stable 1.4 branch +$test[] = '1.4.001'; +function phpgwapi_upgrade1_4_001() +{ + return $GLOBALS['setup_info']['phpgwapi']['currentver'] = '1.5.001'; +} + +$test[] = '1.4.002'; +function phpgwapi_upgrade1_4_002() +{ + return $GLOBALS['setup_info']['phpgwapi']['currentver'] = '1.5.001'; +} + +$test[] = '1.4.003'; +function phpgwapi_upgrade1_4_003() +{ + return $GLOBALS['setup_info']['phpgwapi']['currentver'] = '1.5.001'; +} + +$test[] = '1.4.004'; +function phpgwapi_upgrade1_4_004() +{ + return $GLOBALS['setup_info']['phpgwapi']['currentver'] = '1.5.001'; +} + +$test[] = '1.5.001'; +function phpgwapi_upgrade1_5_001() +{ + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_addressbook','org_name',array( + 'type' => 'varchar', + 'precision' => '128', + 'nullable' => true + )); + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_addressbook','contact_email',array( + 'type' => 'varchar', + 'precision' => '128', + 'nullable' => true + )); + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_addressbook','contact_email_home',array( + 'type' => 'varchar', + 'precision' => '128', + 'nullable' => true + )); + + return $GLOBALS['setup_info']['phpgwapi']['currentver'] = '1.5.002'; +} + +$test[] = '1.5.002'; +function phpgwapi_upgrade1_5_002() +{ + $GLOBALS['egw_setup']->oProc->CreateTable('egw_sqlfs',array( + 'fd' => array( + 'fs_id' => array('type' => 'auto','nullable' => False), + 'fs_dir' => array('type' => 'int','precision' => '4','nullable' => False), + 'fs_name' => array('type' => 'varchar','precision' => '200','nullable' => False), + 'fs_mode' => array('type' => 'int','precision' => '2','nullable' => False), + 'fs_uid' => array('type' => 'int','precision' => '4','nullable' => False,'default' => '0'), + 'fs_gid' => array('type' => 'int','precision' => '4','nullable' => False,'default' => '0'), + 'fs_created' => array('type' => 'timestamp','precision' => '8','nullable' => False,'default' => 'current_timestamp'), + 'fs_modified' => array('type' => 'timestamp','precision' => '8','nullable' => False), + 'fs_mime' => array('type' => 'varchar','precision' => '64','nullable' => False), + 'fs_size' => array('type' => 'int','precision' => '8','nullable' => False), + 'fs_creator' => array('type' => 'int','precision' => '4','nullable' => False), + 'fs_modifier' => array('type' => 'int','precision' => '4'), + 'fs_active' => array('type' => 'bool','nullable' => False,'default' => 't'), + 'fs_comment' => array('type' => 'varchar','precision' => '255'), + 'fs_content' => array('type' => 'blob') + ), + 'pk' => array('fs_id'), + 'fk' => array(), + 'ix' => array(array('fs_dir','fs_active','fs_name')), + 'uc' => array() + )); + + return $GLOBALS['setup_info']['phpgwapi']['currentver'] = '1.5.003'; +} + +$test[] = '1.5.003'; +function phpgwapi_upgrade1_5_003() +{ + // import the current egw_vfs into egw_sqlfs + // ToDo: moving /infolog and /infolog/$app to /apps in the files dir!!! + $debug = $GLOBALS['DEBUG']; + + // delete the table in case this update runs multiple times + $GLOBALS['egw_setup']->db->query('DELETE FROM egw_sqlfs',__LINE__,__FILE__); + if ($GLOBALS['egw_setup']->db->Type == 'mysql') + { + $GLOBALS['egw_setup']->db->query('ALTER TABLE egw_sqlfs AUTO_INCREMENT=1',__LINE__,__FILE__); + } + // make sure the required dirs are there and have the following id's + $dirs = array( + '/' => 1, + '/home' => 2, + '/apps' => 3, + ); + foreach($dirs as $path => $id) + { + $nrow = array( + 'fs_id' => $id, + 'fs_dir' => $path == '/' ? 0 : $dirs['/'], + 'fs_name' => substr($path,1), + 'fs_mode' => 05, + 'fs_uid' => 0, + 'fs_gid' => 0, + 'fs_created' => time(), + 'fs_modified' => time(), + 'fs_mime' => 'httpd/unix-directory', + 'fs_size' => 0, + 'fs_creator' => 0, + 'fs_modifier' => 0, + 'fs_comment' => null, + 'fs_content' => null, + ); + $GLOBALS['egw_setup']->db->insert('egw_sqlfs',$nrow,false,__LINE__,__FILE__,'phpgwapi'); + } + $query = $GLOBALS['egw_setup']->db->select('egw_vfs','*',"vfs_mime_type != 'journal' AND vfs_mime_type != 'journal-deleted'",__LINE__,__FILE__,false,'ORDER BY length(vfs_directory) ASC','phpgwapi'); + if ($debug) echo "rows=
\n";
+
+	foreach($query as $row)
+	{
+		// rename the /infolog dir to /apps/infolog and /infolog/$app /apps/$app
+		if (substr($row['vfs_directory'],0,8) == '/infolog')
+		{
+			$parts = explode('/',$row['vfs_directory']);	// 0 = '', 1 = 'infolog', 2 = app or info_id
+			//$parts[1] = is_numeric($parts[2]) ? 'apps/infolog' : 'apps';
+			$parts[1] = $row['vfs_directory']=='/infolog' && is_numeric($row['vfs_name']) ||
+				$parts[1]=='infolog' && is_numeric($parts[2]) ? 'apps/infolog' : 'apps';
+			$row['vfs_directory'] = implode('/',$parts);
+		}
+		elseif ($row['vfs_directory'] == '/' && $row['vfs_name'] == 'infolog')
+		{
+			$row['vfs_directory'] = '/apps';
+		}
+		$nrow = array(
+			'fs_dir'  => $dirs[$row['vfs_directory']],
+			'fs_name' => $row['vfs_name'],
+			'fs_mode' => $row['vfs_owner_id'] > 0 ?
+				($row['vfs_mime_type'] == 'Directory' ? 0700 : 0600) :
+				($row['vfs_mime_type'] == 'Directory' ? 0070 : 0060),
+			'fs_uid' => $row['vfs_owner_id'] > 0 ? $row['vfs_owner_id'] : 0,
+			'fs_gid' => $row['vfs_owner_id'] < 0 ? -$row['vfs_owner_id'] : 0,
+			'fs_created' => $row['vfs_created'],
+			'fs_modified' => $row['vfs_modified'] ? $row['vfs_modified'] : $row['vfs_created'],
+			'fs_mime' => $row['vfs_mime_type'] == 'Directory' ? 'httpd/unix-directory' :
+				($row['vfs_mime_type'] ? $row['vfs_mime_type'] : 'application/octet-stream'),
+			'fs_size' => $row['vfs_size'],
+			'fs_creator' => $row['vfs_createdby_id'],
+			'fs_modifier' => $row['vfs_modifedby_id'],
+			'fs_comment' => $row['vfs_comment'] ? $row['vfs_comment'] : null,
+			'fs_content' => $row['vfs_content'],
+		);
+		if ($debug)
+		{
+			foreach($row as $key => $val)
+			{
+				if (is_numeric($key)) unset($row[$key]);
+			}
+			print_r($row);
+			print_r($nrow);
+		}
+		if ($row['vfs_mime_type'] == 'Directory')
+		{
+			$dir = ($row['vfs_directory'] == '/' ? '' : $row['vfs_directory']).'/'.$row['vfs_name'];
+
+			if (!isset($dirs[$dir]))	// ignoring doublicate dirs, my devel box has somehow many of them specially /home
+			{
+				$GLOBALS['egw_setup']->db->insert('egw_sqlfs',$nrow,false,__LINE__,__FILE__,'phpgwapi');
+				$dirs[$dir] = $GLOBALS['egw_setup']->db->get_last_insert_id('egw_sqlfs','fs_id');
+				if ($debug) echo "$dir = {$dirs[$dir]}\n";
+			}
+			elseif ($debug)
+			{
+				echo "ignoring doublicate directory '$dir'!\n";
+			}
+		}
+		else
+		{
+			$GLOBALS['egw_setup']->db->insert('egw_sqlfs',$nrow,false,__LINE__,__FILE__,'phpgwapi');
+		}
+
+	}
+	if ($debug)
+	{
+		echo "dirs=";
+		print_r($dirs);
+		echo "
\n"; + } + return $GLOBALS['setup_info']['phpgwapi']['currentver'] = '1.5.004'; +} + +$test[] = '1.5.004'; +function phpgwapi_upgrade1_5_004() +{ + // convert the filemanager group grants into extended ACL + + // delete all sqlfs entries from the ACL table, in case we run multiple times + $GLOBALS['egw_setup']->db->delete('egw_acl',array('acl_appname' => sqlfs_stream_wrapper::EACL_APPNAME),__LINE__,__FILE__); + + $GLOBALS['egw_setup']->setup_account_object(); + $accounts = $GLOBALS['egw_setup']->accounts; + $accounts = new accounts(); + + egw_vfs::$is_root = true; // we need root rights to set the extended acl, without being the owner + + foreach($GLOBALS['egw_setup']->db->select('egw_acl','*',array( + 'acl_appname' => 'filemanager', + "acl_location != 'run'", + ),__LINE__,__FILE__) as $row) + { + $rights = egw_vfs::READABLE | egw_vfs::EXECUTABLE; + if($row['acl_rights'] > 1) $rights |= egw_vfs::WRITABLE; + + if (($lid = $accounts->id2name($row['acl_account'])) && $accounts->exists($row['acl_location'])) + { + $ret = sqlfs_stream_wrapper::eacl('/home/'.$lid,$rights,(int)$row['acl_location']); + //echo "

sqlfs_stream_wrapper::eacl('/home/$lid',$rights,$row[acl_location])=$ret

\n"; + } + } + egw_vfs::$is_root = false; + + return $GLOBALS['setup_info']['phpgwapi']['currentver'] = '1.5.005'; +} + +$test[] = '1.5.005'; +function phpgwapi_upgrade1_5_005() +{ + // move /infolog/$app to /apps/$app and /infolog to /apps/infolog + + $files_dir = $GLOBALS['egw_setup']->db->select('egw_config','config_value',array( + 'config_name' => 'files_dir', + 'config_app' => 'phpgwapi', + ),__LINE__,__FILE__)->fetchSingle(); + + if ($files_dir && file_exists($files_dir) && file_exists($files_dir.'/infolog')) + { + mkdir($files_dir.'/apps',0700,true); + if (($dir = opendir($files_dir.'/infolog'))) + { + while(($app = readdir($dir))) + { + if (!is_numeric($app) && $app[0] != '.') // ingore infolog entries and . or .. + { + rename($files_dir.'/infolog/'.$app,$files_dir.'/apps/'.$app); + } + } + closedir($dir); + rename($files_dir.'/infolog',$files_dir.'/apps/infolog'); + } + } + + return $GLOBALS['setup_info']['phpgwapi']['currentver'] = '1.5.006'; +} + +$test[] = '1.5.006'; +function phpgwapi_upgrade1_5_006() +{ + // drop filescenter tables, if filecenter is not installed + static $filescenter_tables = array( + 'phpgw_vfs2_mimetypes', + 'phpgw_vfs2_files', + 'phpgw_vfs2_customfields', + 'phpgw_vfs2_quota', + 'phpgw_vfs2_shares', + 'phpgw_vfs2_versioning', + 'phpgw_vfs2_customfields_data', + 'phpgw_vfs2_prefixes', + ); + $filescenter_app = $GLOBALS['egw_setup']->db->select('egw_applications','*',array( + 'app_name' => 'filescenter', + ),__LINE__,__FILE__)->fetchSingle(); + + if (!$filescenter_app || !is_dir(EGW_INCLUDE_ROOT.'/filescenter')) + { + foreach($filescenter_tables as $table) + { + $GLOBALS['egw_setup']->oProc->DropTable($table); + } + if ($filescenter_app) // app installed, but no sources --> deinstall it + { + $GLOBALS['egw_setup']->db->delete('egw_applications',array( + 'app_name' => 'filescenter', + ),__LINE__,__FILE__); + } + } + else + { + // move tables to the filescenter app + $GLOBALS['egw_setup']->db->update('egw_applications',array( + 'app_tables' => implode(',',$filescenter_tables), + ),array( + 'app_name' => 'filescenter', + ),__LINE__,__FILE__); + } + + return $GLOBALS['setup_info']['phpgwapi']['currentver'] = '1.5.007'; +} + +$test[] = '1.5.007'; +function phpgwapi_upgrade1_5_007() +{ + // tables for the eGW-wide index + + foreach(array( + 'egw_index_keywords' => array( + 'fd' => array( + 'si_id' => array('type' => 'auto','nullable' => False), + 'si_keyword' => array('type' => 'varchar','precision' => '64','nullable' => False), + 'si_ignore' => array('type' => 'bool') + ), + 'pk' => array('si_id'), + 'fk' => array(), + 'ix' => array(), + 'uc' => array('si_keyword') + ), + 'egw_index' => array( + 'fd' => array( + 'si_app' => array('type' => 'varchar','precision' => '25','nullable' => False), + 'si_app_id' => array('type' => 'varchar','precision' => '50','nullable' => False), + 'si_id' => array('type' => 'int','precision' => '4','nullable' => False), + 'si_owner' => array('type' => 'int','precision' => '4','nullable' => False) + ), + 'pk' => array('si_app','si_app_id','si_id'), + 'fk' => array(), + 'ix' => array('si_id'), + 'uc' => array() + ), + 'egw_cat2entry' => array( + 'fd' => array( + 'ce_app' => array('type' => 'varchar','precision' => '25','nullable' => False), + 'ce_app_id' => array('type' => 'varchar','precision' => '50','nullable' => False), + 'cat_id' => array('type' => 'int','precision' => '4','nullable' => False), + 'ce_owner' => array('type' => 'int','precision' => '4','nullable' => False) + ), + 'pk' => array('ce_app','ce_app_id','cat_id'), + 'fk' => array(), + 'ix' => array('cat_id'), + 'uc' => array() + )) as $table => $definition) + { + $GLOBALS['egw_setup']->oProc->CreateTable($table,$definition); + } + + return $GLOBALS['setup_info']['phpgwapi']['currentver'] = '1.5.008'; +} + +$test[] = '1.5.008'; +function phpgwapi_upgrade1_5_008() +{ + // add UID and etag columns to addressbook, required eg. for CardDAV + $GLOBALS['egw_setup']->oProc->AddColumn('egw_addressbook','contact_etag',array( + 'type' => 'int', + 'precision' => '4', + 'default' => '0', + )); + + // add UID column to addressbook, required eg. for CardDAV + $GLOBALS['egw_setup']->oProc->AddColumn('egw_addressbook','contact_uid',array( + 'type' => 'varchar', + 'precision' => '255' + )); + + $GLOBALS['egw_setup']->db->query("SELECT config_value FROM egw_config WHERE config_app='phpgwapi' AND config_name='install_id'",__LINE__,__FILE__); + $install_id = $GLOBALS['egw_setup']->db->next_record() ? $GLOBALS['egw_setup']->db->f(0) : md5(time()); + $GLOBALS['egw_setup']->db->query('UPDATE egw_addressbook SET contact_uid='.$GLOBALS['egw_setup']->db->concat("'addressbook-'",'contact_id',"'-$install_id'"),__LINE__,__FILE__); + + $GLOBALS['egw_setup']->oProc->CreateIndex('egw_addressbook',array('contact_uid'),false); + + return $GLOBALS['setup_info']['phpgwapi']['currentver'] = '1.5.009'; +} + +$test[] = '1.5.009'; +function phpgwapi_upgrade1_5_009() +{ + $GLOBALS['egw_setup']->oProc->CreateTable('egw_locks',array( + 'fd' => array( + 'lock_token' => array('type' => 'varchar','precision' => '255','nullable' => False), + 'lock_path' => array('type' => 'varchar','precision' => '255','nullable' => False), + 'lock_expires' => array('type' => 'int','precision' => '8','nullable' => False), + 'lock_owner' => array('type' => 'varchar','precision' => '255'), + 'lock_recursive' => array('type' => 'bool','nullable' => False,'default' => '0'), + 'lock_write' => array('type' => 'bool','nullable' => False,'default' => '0'), + 'lock_exclusive' => array('type' => 'bool','nullable' => False,'default' => '0'), + 'lock_created' => array('type' => 'int','precision' => '8','default' => '0'), + 'lock_modified' => array('type' => 'int','precision' => '8','default' => '0') + ), + 'pk' => array('lock_token'), + 'fk' => array(), + 'ix' => array('lock_path','lock_expires'), + 'uc' => array() + )); + + return $GLOBALS['setup_info']['phpgwapi']['currentver'] = '1.5.010'; +} + +function phpgwapi_upgrade1_5_010() +{ + $GLOBALS['egw_setup']->oProc->AddColumn('egw_applications','app_icon',array( + 'type' => 'varchar', + 'precision' => '32' + )); + $GLOBALS['egw_setup']->oProc->AddColumn('egw_applications','app_icon_app',array( + 'type' => 'varchar', + 'precision' => '25' + )); + $GLOBALS['egw_setup']->oProc->AddColumn('egw_applications','app_index',array( + 'type' => 'varchar', + 'precision' => '64' + )); + + return $GLOBALS['setup_info']['phpgwapi']['currentver'] = '1.5.011'; +} + +/** + * Move sqlfs files from their path based location to the new (hashed) id base one and removed the not longer used dirs + * + * @return string + */ +function phpgwapi_upgrade1_5_011() +{ + if ($GLOBALS['DEBUG'] && isset($_SERVER['HTTP_HOST'])) echo "
\n";
+	egw_vfs::$is_root = true;
+	egw_vfs::load_wrapper('sqlfs');
+	egw_vfs::find('sqlfs://default/',array(
+		'url'  => true,
+		'depth' => true,
+	),create_function('$url,$stat','
+		$new_path = sqlfs_stream_wrapper::_fs_path($stat["ino"]);	// loads egw_info/server/files_dir (!)
+		if (file_exists($old_path = $GLOBALS["egw_info"]["server"]["files_dir"].($path=parse_url($url,PHP_URL_PATH))))
+		{
+			if (!is_dir($old_path))
+			{
+				if ($GLOBALS["DEBUG"]) echo "moving file $old_path --> $new_path\n";
+				if (!file_exists($parent = dirname($new_path))) mkdir($parent,0777,true);	// 777 because setup-cli might run eg. by root
+				rename($old_path,$new_path);
+			}
+			elseif($path != "/")
+			{
+				if ($GLOBALS["DEBUG"]) echo "removing directory $old_path\n";
+				rmdir($old_path);
+			}
+		}
+		elseif(!($stat["mode"] & sqlfs_stream_wrapper::MODE_DIR))
+		{
+			echo "phpgwapi_upgrade1_5_011() $url: $old_path not found!\n";
+		}
+	'));
+	if ($GLOBALS['DEBUG'] && isset($_SERVER['HTTP_HOST'])) echo "
\n"; + + return $GLOBALS['setup_info']['phpgwapi']['currentver'] = '1.5.012'; +} + +function phpgwapi_upgrade1_5_012() +{ + $GLOBALS['egw_setup']->oProc->CreateTable('egw_sqlfs_props',array( + 'fd' => array( + 'fs_id' => array('type' => 'int','precision' => '4','nullable' => False), + 'prop_namespace' => array('type' => 'varchar','precision' => '64','nullable' => False), + 'prop_name' => array('type' => 'varchar','precision' => '64','nullable' => False), + 'prop_value' => array('type' => 'text') + ), + 'pk' => array('fs_id','prop_namespace','prop_name'), + 'fk' => array(), + 'ix' => array(), + 'uc' => array() + )); + + return $GLOBALS['setup_info']['phpgwapi']['currentver'] = '1.5.013'; +} + +function phpgwapi_upgrade1_5_013() +{ + foreach($GLOBALS['egw_setup']->db->select('egw_sqlfs','fs_id,fs_comment',"fs_comment IS NOT NULL AND fs_comment != ''",__LINE__,__FILE__) as $row) + { + $GLOBALS['egw_setup']->db->insert('egw_sqlfs_props',array( + 'fs_id' => $row['fs_id'], + 'prop_namespace' => 'http://egroupware.org/', + 'prop_name' => 'comment', + 'prop_value' => $row['fs_comment'], + ),false,__LINE__,__FILE__); + } + $GLOBALS['egw_setup']->oProc->DropColumn('egw_sqlfs',array( + 'fd' => array( + 'fs_id' => array('type' => 'auto','nullable' => False), + 'fs_dir' => array('type' => 'int','precision' => '4','nullable' => False), + 'fs_name' => array('type' => 'varchar','precision' => '200','nullable' => False), + 'fs_mode' => array('type' => 'int','precision' => '2','nullable' => False), + 'fs_uid' => array('type' => 'int','precision' => '4','nullable' => False,'default' => '0'), + 'fs_gid' => array('type' => 'int','precision' => '4','nullable' => False,'default' => '0'), + 'fs_created' => array('type' => 'timestamp','precision' => '8','nullable' => False,'default' => 'current_timestamp'), + 'fs_modified' => array('type' => 'timestamp','precision' => '8','nullable' => False), + 'fs_mime' => array('type' => 'varchar','precision' => '64','nullable' => False), + 'fs_size' => array('type' => 'int','precision' => '8','nullable' => False), + 'fs_creator' => array('type' => 'int','precision' => '4','nullable' => False), + 'fs_modifier' => array('type' => 'int','precision' => '4'), + 'fs_active' => array('type' => 'bool','nullable' => False,'default' => 't'), + 'fs_content' => array('type' => 'blob') + ), + 'pk' => array('fs_id'), + 'fk' => array(), + 'ix' => array(array('fs_dir','fs_active','fs_name')), + 'uc' => array() + ),'fs_comment'); + + // no automatic timestamp for created field, as it would update on every update + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_sqlfs','fs_created',array( + 'type' => 'timestamp', + 'precision' => '8', + 'nullable' => False + )); + + return $GLOBALS['setup_info']['phpgwapi']['currentver'] = '1.5.014'; +} + +function phpgwapi_upgrade1_5_014() +{ + $GLOBALS['egw_setup']->oProc->AlterColumn('egw_history_log','history_status',array( + 'type' => 'varchar', + 'precision' => '64', + 'nullable' => False + )); + + return $GLOBALS['setup_info']['phpgwapi']['currentver'] = '1.5.015'; +} + +/** + * Move files created directly in the root of sqlfs (fs_id < 100) into a /00 directory, + * as they would conflict with dirnames in that directory. + * + * This update does nothing, if the files are already in the correct directory + */ +function phpgwapi_upgrade1_5_015() +{ + sqlfs_stream_wrapper::_fs_path(1); // loads egw_info/server/files_dir (!) + $sqlfs_dir = $GLOBALS['egw_info']['server']['files_dir'].'/sqlfs'; + + if (file_exists($sqlfs_dir) && ($d = opendir($sqlfs_dir))) + { + while(($f = readdir($d))) + { + if (is_file($old_name = $sqlfs_dir.'/'.$f)) + { + if (!$zero_dir) + { + if ($GLOBALS['DEBUG'] && isset($_SERVER['HTTP_HOST'])) echo "
\n";
+ 					mkdir($zero_dir = $sqlfs_dir.'/00',0777);
+					echo "created dir for files with fs_id < 100: $zero_dir\n";
+				}
+				$new_name = $zero_dir.'/'.$f;
+				if ($GLOBALS['DEBUG']) echo "moving file $old_name --> $new_name\n";
+				rename($old_name,$new_name);
+			}
+		}
+		closedir($d);
+		if ($GLOBALS['DEBUG'] && isset($_SERVER['HTTP_HOST']) && $zero_dir) echo "
\n"; + } + + return $GLOBALS['setup_info']['phpgwapi']['currentver'] = '1.5.016'; +} + +/** + * Drop no longer needed egw_api_content_history.sync_guid column + */ +function phpgwapi_upgrade1_5_016() +{ + $GLOBALS['egw_setup']->oProc->DropColumn('egw_api_content_history',array( + 'fd' => array( + 'sync_appname' => array('type' => 'varchar','precision' => '60','nullable' => False), + 'sync_contentid' => array('type' => 'varchar','precision' => '60','nullable' => False), + 'sync_added' => array('type' => 'timestamp'), + 'sync_modified' => array('type' => 'timestamp'), + 'sync_deleted' => array('type' => 'timestamp'), + 'sync_id' => array('type' => 'auto','nullable' => False), + 'sync_changedby' => array('type' => 'int','precision' => '4','nullable' => False) + ), + 'pk' => array('sync_id'), + 'fk' => array(), + 'ix' => array('sync_added','sync_modified','sync_deleted','sync_guid','sync_changedby',array('sync_appname','sync_contentid')), + 'uc' => array() + ),'sync_guid'); + + return $GLOBALS['setup_info']['phpgwapi']['currentver'] = '1.5.017'; +} + +/** + * Final 1.6 release + */ +function phpgwapi_upgrade1_5_017() +{ + return $GLOBALS['setup_info']['phpgwapi']['currentver'] = '1.6.001'; +} From 1eb956fdf5b5be05347128284881b861395e75a6 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Tue, 25 Nov 2008 19:36:02 +0000 Subject: [PATCH 002/510] "- do not send session data for clients doing no sessions to memcached - use 10min session lifetime for GroupDAV as for anonymous sessions" --- phpgwapi/inc/class.egw_session_memcache.inc.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/phpgwapi/inc/class.egw_session_memcache.inc.php b/phpgwapi/inc/class.egw_session_memcache.inc.php index 4fac5a9a4a..51c7339e20 100644 --- a/phpgwapi/inc/class.egw_session_memcache.inc.php +++ b/phpgwapi/inc/class.egw_session_memcache.inc.php @@ -106,7 +106,7 @@ class egw_session_memcache * According to a commentary on php.net (session_set_save_handler) this function has to return * a string, if the session-id is NOT found, not false. Returning false terminates the script * with a fatal error! - * + * * @param string $id * @return string|boolean false on error, '' for not found session otherwise session data */ @@ -137,8 +137,13 @@ class egw_session_memcache { $lifetime = (int)ini_get('session.gc_maxlifetime'); + if ($id == 'no-session') + { + return true; // no need to save + } // give anon sessions only a lifetime of 10min - if (is_object($GLOBALS['egw']->session) && $GLOBALS['egw']->session->session_flags == 'A') + if (is_object($GLOBALS['egw']->session) && $GLOBALS['egw']->session->session_flags == 'A' || + $GLOBALS['egw_info']['flags']['currentapp'] == 'groupdav') { $lifetime = 600; } From 340e369e0478218d158872be28ea42c497eaa310 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 27 Nov 2008 10:31:19 +0000 Subject: [PATCH 003/510] "fixed changed constructor name" --- etemplate/inc/class.contact_widget.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etemplate/inc/class.contact_widget.inc.php b/etemplate/inc/class.contact_widget.inc.php index 84370f80c7..6281aeffa5 100644 --- a/etemplate/inc/class.contact_widget.inc.php +++ b/etemplate/inc/class.contact_widget.inc.php @@ -81,7 +81,7 @@ class contact_widget { case 'contact-fields': $GLOBALS['egw']->translation->add_app('addressbook'); - $this->contacts->contacts(); + $this->contacts->__construct(); $cell['sel_options'] = $this->contacts->contact_fields; foreach($this->contacts->customfields as $name => $data) { From 687f6b0a16ac4d985a71dc3aa7acd7a0dbe3d80f Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Fri, 28 Nov 2008 12:24:02 +0000 Subject: [PATCH 004/510] fixed bug with the multiple category adding (no category select dialog appeared) --- addressbook/inc/class.addressbook_ui.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addressbook/inc/class.addressbook_ui.inc.php b/addressbook/inc/class.addressbook_ui.inc.php index b8eac299a7..901b9e96e3 100644 --- a/addressbook/inc/class.addressbook_ui.inc.php +++ b/addressbook/inc/class.addressbook_ui.inc.php @@ -1964,7 +1964,7 @@ $readonlys['button[vcard]'] = true; if (selbox.value == "infolog_add" && (ids = get_selected(selbox.form,"[rows][checked][]")) && !document.getElementById("exec[use_all]").checked) { win=window.open("'.egw::link('/index.php','menuaction=infolog.infolog_ui.edit&type=task&action=addressbook&action_id=').'"+ids,"_blank","width=750,height=550,left=100,top=200"); win.focus(); - } else if (this.value == "cat_add") { + } else if (selbox.value == "cat_add") { win=window.open("'.egw::link('/etemplate/process_exec.php','menuaction=addressbook.addressbook_ui.cat_add').'","_blank","width=300,height=400,left=100,top=200"); win.focus(); } else { From e025a14a08363bfbfabfb0e22e7c32f502b3ed11 Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Fri, 5 Dec 2008 10:26:07 +0000 Subject: [PATCH 005/510] putting some debug into the send class to find problems more easily --- phpgwapi/inc/class.send.inc.php | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/phpgwapi/inc/class.send.inc.php b/phpgwapi/inc/class.send.inc.php index b06679ae0c..92407a18ef 100644 --- a/phpgwapi/inc/class.send.inc.php +++ b/phpgwapi/inc/class.send.inc.php @@ -31,7 +31,7 @@ { var $err = array(); var $to_res = array(); - + var $debug = false; /** * eGW specific initialisation of the PHPMailer: charset, language, smtp-host, ... * @@ -42,6 +42,7 @@ { if ($this->Subject || $this->Body || count($this->to)) { + if ($this->debug) error_log(__METHOD__." ".print_r($this->Subject,true)." to be send"); return PHPMailer::Send(); } $this->CharSet = $GLOBALS['egw']->translation->charset(); @@ -56,6 +57,7 @@ $bopreferences =& CreateObject('felamimail.bopreferences'); if ($bopreferences) { + if ($this->debug) error_log(__METHOD__." using felamimail preferences for mailing."); $preferences = $bopreferences->getPreferences(); if ($preferences) { $ogServer = $preferences->getOutgoingServer(0); @@ -69,9 +71,13 @@ $this->Username = $username; $this->Password = $ogServer->password; } + if ($this->debug) error_log(__METHOD__." using Host ".print_r($this->Host,true)." to be send"); + if ($this->debug) error_log(__METHOD__." using User ".print_r($this->Username,true)." to be send"); + if ($this->debug) error_log(__METHOD__." using Sender ".print_r($this->Sender,true)." to be send"); } } } else { + if ($this->debug) error_log(__METHOD__." using global config to send"); $this->Host = $GLOBALS['egw_info']['server']['smtp_server']?$GLOBALS['egw_info']['server']['smtp_server']:'localhost'; $this->Port = $GLOBALS['egw_info']['server']['smtp_port']?$GLOBALS['egw_info']['server']['smtp_port']:25; $this->SMTPAuth = !empty($GLOBALS['egw_info']['server']['smtp_auth_user']); @@ -79,6 +85,9 @@ if (isset($senderadress) && !empty($senderadress)) $this->Sender = $senderadress; $this->Username = $username; $this->Password = $GLOBALS['egw_info']['server']['smtp_auth_passwd']; + if ($this->debug) error_log(__METHOD__." using Host ".print_r($this->Host,true)." to be send"); + if ($this->debug) error_log(__METHOD__." using User ".print_r($this->Username,true)." to be send"); + if ($this->debug) error_log(__METHOD__." using Sender ".print_r($this->Sender,true)." to be send"); } $this->Hostname = $GLOBALS['egw_info']['server']['hostname']; } @@ -110,6 +119,7 @@ */ function msg($service, $to, $subject, $body, $msgtype='', $cc='', $bcc='', $from='', $sender='', $content_type='', $boundary='Message-Boundary') { + if ($this->debug) error_log(__METHOD__." to='$to',subject='$subject',,'$msgtype',cc='$cc',bcc='$bcc',from='$from',sender='$sender'"); //echo "

send::msg(,to='$to',subject='$subject',,'$msgtype',cc='$cc',bcc='$bcc',from='$from',sender='$sender','$content_type','$boundary')

$body
\n"; $this->ClearAll(); // reset everything to its default, we might be called more then once !!! From dd749ffa6eb7f4320f04dc25b8322399cf346550 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Fri, 5 Dec 2008 21:27:12 +0000 Subject: [PATCH 006/510] Add special handling for query values of 'false' (the string) to convert them to false (boolean) --- etemplate/inc/class.ajax_select_widget.inc.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/etemplate/inc/class.ajax_select_widget.inc.php b/etemplate/inc/class.ajax_select_widget.inc.php index 801616b42e..5e31f9fbf2 100644 --- a/etemplate/inc/class.ajax_select_widget.inc.php +++ b/etemplate/inc/class.ajax_select_widget.inc.php @@ -267,7 +267,7 @@ } // Expand lists - foreach($query as $key => $row) { + foreach($query as $key => &$row) { if(strpos($row, ',')) { $query[$key] = explode(',', $row); } @@ -275,6 +275,8 @@ // sometimes it sends 'null' (not null) if($row == 'null') { unset($query[$key]); + } elseif (strtolower($row) == 'false') { + $row = false; } } $query['search'] = $value; From f28eed197310e856411f9fe3aa1960145f393fb6 Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Tue, 9 Dec 2008 12:59:03 +0000 Subject: [PATCH 007/510] enabling debug in some cases, switched off, as default --- phpgwapi/inc/class.preferences.inc.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/phpgwapi/inc/class.preferences.inc.php b/phpgwapi/inc/class.preferences.inc.php index 30cee2fb4c..7dc03869ca 100644 --- a/phpgwapi/inc/class.preferences.inc.php +++ b/phpgwapi/inc/class.preferences.inc.php @@ -69,7 +69,7 @@ class preferences var $table = 'egw_preferences'; var $values,$vars; // standard notify substitues, will be set by standard_substitues() - + var $debug = false; /** * Standard constructor for setting $this->account_id */ @@ -110,6 +110,7 @@ class preferences } foreach($vals as $key => $val) { + if ($this->debug) error_log(__METHOD__." replacing \$\$$key\$\$ with $val "); $replace[] = '$$'.$key.'$$'; $with[] = $val; } @@ -147,6 +148,7 @@ class preferences */ function standard_substitutes() { + if ($this->debug) error_log(__METHOD__." is called "); if (!is_array(@$GLOBALS['egw_info']['user']['preferences'])) { $GLOBALS['egw_info']['user']['preferences'] = $this->data; // else no lang() From 91c5e6d23c373b625ed680b5c11cebb69940ac40 Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Tue, 9 Dec 2008 13:07:29 +0000 Subject: [PATCH 008/510] print out the standard substitutes, if debug is switched on --- phpgwapi/inc/class.preferences.inc.php | 1 + 1 file changed, 1 insertion(+) diff --git a/phpgwapi/inc/class.preferences.inc.php b/phpgwapi/inc/class.preferences.inc.php index 7dc03869ca..0bc9be9909 100644 --- a/phpgwapi/inc/class.preferences.inc.php +++ b/phpgwapi/inc/class.preferences.inc.php @@ -176,6 +176,7 @@ class preferences 'email' => lang('email-address of the user, eg. "%1"',$this->values['email']), 'date' => lang('todays date, eg. "%1"',$this->values['date']), ); + if ($this->debug) error_log(__METHOD__.print_r($this->vars,true)); // do the substituetion in the effective prefs (data) // foreach($this->data as $app => $data) From 96491ed272e55f9f9356ec51d78981d6f49bde2c Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Tue, 9 Dec 2008 14:02:10 +0000 Subject: [PATCH 009/510] more debug for calendar notification --- calendar/inc/class.calendar_boupdate.inc.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/calendar/inc/class.calendar_boupdate.inc.php b/calendar/inc/class.calendar_boupdate.inc.php index e7c77b31f1..2231733fdb 100644 --- a/calendar/inc/class.calendar_boupdate.inc.php +++ b/calendar/inc/class.calendar_boupdate.inc.php @@ -513,6 +513,7 @@ class calendar_boupdate extends calendar_bo } foreach($to_notify as $userid => $statusid) { + if ($this->debug > 0) error_log(__METHOD__." trying to notify $userid, with $statusid"); if (!is_numeric($userid)) { $res_info = $this->resource_info($userid); @@ -595,11 +596,11 @@ class calendar_boupdate extends calendar_bo $notification->send(); } catch (Exception $exception) { - error_log('error while notifying user '.$userid.':'.$exception->getMessage()); + error_log(__METHOD__.' error while notifying user '.$userid.':'.$exception->getMessage()); continue; } } else { - error_log('calendar: cannot send any notifications because notifications is not installed'); + error_log(__METHOD__.' cannot send any notifications because notifications is not installed'); } } } From 80c3da850d89ba85ad231eaa5b2de1ec1679f51b Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Tue, 9 Dec 2008 14:02:13 +0000 Subject: [PATCH 010/510] enable debug for send class to be passed to phpmailer/smtp --- phpgwapi/inc/class.send.inc.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/phpgwapi/inc/class.send.inc.php b/phpgwapi/inc/class.send.inc.php index 92407a18ef..3858fec1ff 100644 --- a/phpgwapi/inc/class.send.inc.php +++ b/phpgwapi/inc/class.send.inc.php @@ -31,7 +31,8 @@ { var $err = array(); var $to_res = array(); - var $debug = false; + // switching on debug with a numeric value other than 0, switches debug in PHPMailer/SMTP Class on + var $debug = false; // false; /** * eGW specific initialisation of the PHPMailer: charset, language, smtp-host, ... * @@ -45,6 +46,7 @@ if ($this->debug) error_log(__METHOD__." ".print_r($this->Subject,true)." to be send"); return PHPMailer::Send(); } + if ($this->debug && is_numeric($this->debug)) $this->SMTPDebug = $this->debug; $this->CharSet = $GLOBALS['egw']->translation->charset(); list($lang,$nation) = explode('-',$GLOBALS['egw_info']['user']['preferences']['common']['lang']); $lang_path = EGW_SERVER_ROOT.'/phpgwapi/setup/'; From a6d7f0caf36e1386e7edc4bcaaf2db0b4833a7ac Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Tue, 9 Dec 2008 14:02:15 +0000 Subject: [PATCH 011/510] more debug information for notification failure --- notifications/inc/class.notifications_email.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/notifications/inc/class.notifications_email.inc.php b/notifications/inc/class.notifications_email.inc.php index ce9de0dbba..f00e21218d 100644 --- a/notifications/inc/class.notifications_email.inc.php +++ b/notifications/inc/class.notifications_email.inc.php @@ -101,10 +101,10 @@ class notifications_email implements notifications_iface { if(is_array($_attachments) && count($_attachments) > 0) { foreach($_attachments as $attachment) { $this->mail->AddStringAttachment($attachment->string, $attachment->filename, $attachment->encoding, $attachment->type); - } + } } if(!$error=$this->mail->Send()) { - throw new Exception("Failed sending notification message via email.$error"); + throw new Exception("Failed sending notification message via email.$error".print_r($this->mail->ErrorInfo,true)); } } From 5cf2da77fae873c7c1f12553ceb9e48e298c4137 Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Tue, 9 Dec 2008 14:02:17 +0000 Subject: [PATCH 012/510] directing debug to error_log --- phpgwapi/inc/class.smtp.php | 126 ++++++++++++++++++------------------ 1 file changed, 63 insertions(+), 63 deletions(-) diff --git a/phpgwapi/inc/class.smtp.php b/phpgwapi/inc/class.smtp.php index e59efffce1..753e62d614 100644 --- a/phpgwapi/inc/class.smtp.php +++ b/phpgwapi/inc/class.smtp.php @@ -126,8 +126,8 @@ class SMTP { "errno" => $errno, "errstr" => $errstr); if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . - ": $errstr ($errno)" . $this->CRLF; + error_log(__METHOD__."->"."SMTP -> ERROR: " . $this->error["error"] . + ": $errstr ($errno)" . $this->CRLF); } return false; } @@ -147,7 +147,7 @@ class SMTP { // socket_set_timeout($this->smtp_conn, 0, 100000); if($this->do_debug >= 2) { - echo "SMTP -> FROM SERVER:" . $this->CRLF . $announce; + error_log(__METHOD__."->". "SMTP -> FROM SERVER:" . $this->CRLF . $announce); } return true; @@ -176,7 +176,7 @@ class SMTP { $code = substr($rply,0,3); if($this->do_debug >= 2) { - echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; + error_log(__METHOD__."->"."SMTP -> FROM SERVER:" . $this->CRLF . $rply); } if($code != 220) { @@ -185,7 +185,7 @@ class SMTP { "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF; + error_log(__METHOD__."->"."SMTP -> ERROR: " . $this->error["error"] . ": " . $rply . $this->CRLF); } return false; } @@ -220,8 +220,8 @@ class SMTP { "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . - ": " . $rply . $this->CRLF; + error_log(__METHOD__."->". "SMTP -> ERROR: " . $this->error["error"] . + ": " . $rply . $this->CRLF); } return false; } @@ -238,8 +238,8 @@ class SMTP { "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . - ": " . $rply . $this->CRLF; + error_log(__METHOD__."->". "SMTP -> ERROR: " . $this->error["error"] . + ": " . $rply . $this->CRLF); } return false; } @@ -256,8 +256,8 @@ class SMTP { "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . - ": " . $rply . $this->CRLF; + error_log(__METHOD__."->"."SMTP -> ERROR: " . $this->error["error"] . + ": " . $rply . $this->CRLF); } return false; } @@ -277,8 +277,8 @@ class SMTP { // hmm this is an odd situation... the socket is // valid but we are not connected anymore if($this->do_debug >= 1) { - echo "SMTP -> NOTICE:" . $this->CRLF . - "EOF caught while checking if connected"; + error_log(__METHOD__."->". "SMTP -> NOTICE:" . $this->CRLF . + "EOF caught while checking if connected"); } $this->Close(); return false; @@ -343,7 +343,7 @@ class SMTP { $code = substr($rply,0,3); if($this->do_debug >= 2) { - echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; + error_log(__METHOD__."->". "SMTP -> FROM SERVER:" . $this->CRLF . $rply); } if($code != 354) { @@ -352,8 +352,8 @@ class SMTP { "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . - ": " . $rply . $this->CRLF; + error_log(__METHOD__."->"."SMTP -> ERROR: " . $this->error["error"] . + ": " . $rply . $this->CRLF); } return false; } @@ -452,15 +452,15 @@ class SMTP { "smtp_msg" => "(nothing)"); if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . - ": " . $rply . $this->CRLF; + error_log(__METHOD__."->". "SMTP -> ERROR: " . $this->error["error"] . + ": " . $rply . $this->CRLF); } return false; } $code = substr($rply,0,3); if($this->do_debug >= 2) { - echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; + error_log(__METHOD__."->". "SMTP -> FROM SERVER:" . $this->CRLF . $rply); } if($code != 250) { @@ -469,8 +469,8 @@ class SMTP { "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . - ": " . $rply . $this->CRLF; + error_log(__METHOD__."->"."SMTP -> ERROR: " . $this->error["error"] . + ": " . $rply . $this->CRLF); } return false; } @@ -508,7 +508,7 @@ class SMTP { $code = substr($rply,0,3); if($this->do_debug >= 2) { - echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; + error_log(__METHOD__."->"."SMTP -> FROM SERVER:" . $this->CRLF . $rply); } if($code != 250) { @@ -517,8 +517,8 @@ class SMTP { "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . - ": " . $rply . $this->CRLF; + error_log(__METHOD__."->". "SMTP -> ERROR: " . $this->error["error"] . + ": " . $rply . $this->CRLF); } return false; } @@ -583,7 +583,7 @@ class SMTP { $code = substr($rply,0,3); if($this->do_debug >= 2) { - echo "SMTP -> FROM SERVER: " . $this->CRLF . $rply; + error_log(__METHOD__."->"."SMTP -> FROM SERVER: " . $this->CRLF . $rply); } if($code != 250) { @@ -592,8 +592,8 @@ class SMTP { "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . - ": " . $rply . $this->CRLF; + error_log(__METHOD__."->". "SMTP -> ERROR: " . $this->error["error"] . + ": " . $rply . $this->CRLF); } return false; } @@ -638,7 +638,7 @@ class SMTP { $code = substr($rply,0,3); if($this->do_debug >= 2) { - echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; + error_log(__METHOD__."->". "SMTP -> FROM SERVER:" . $this->CRLF . $rply); } if($code != 211 && $code != 214) { @@ -647,8 +647,8 @@ class SMTP { "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . - ": " . $rply . $this->CRLF; + error_log(__METHOD__."->"."SMTP -> ERROR: " . $this->error["error"] . + ": " . $rply . $this->CRLF); } return false; } @@ -686,7 +686,7 @@ class SMTP { $code = substr($rply,0,3); if($this->do_debug >= 2) { - echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; + error_log(__METHOD__."->". "SMTP -> FROM SERVER:" . $this->CRLF . $rply); } if($code != 250) { @@ -695,8 +695,8 @@ class SMTP { "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . - ": " . $rply . $this->CRLF; + error_log(__METHOD__."->"."SMTP -> ERROR: " . $this->error["error"] . + ": " . $rply . $this->CRLF); } return false; } @@ -728,7 +728,7 @@ class SMTP { $code = substr($rply,0,3); if($this->do_debug >= 2) { - echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; + error_log(__METHOD__."->"."SMTP -> FROM SERVER:" . $this->CRLF . $rply); } if($code != 250) { @@ -737,8 +737,8 @@ class SMTP { "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . - ": " . $rply . $this->CRLF; + error_log(__METHOD__."->". "SMTP -> ERROR: " . $this->error["error"] . + ": " . $rply . $this->CRLF); } return false; } @@ -772,7 +772,7 @@ class SMTP { $byemsg = $this->get_lines(); if($this->do_debug >= 2) { - echo "SMTP -> FROM SERVER:" . $this->CRLF . $byemsg; + error_log(__METHOD__."->"."SMTP -> FROM SERVER:" . $this->CRLF . $byemsg); } $rval = true; @@ -786,8 +786,8 @@ class SMTP { "smtp_rply" => substr($byemsg,4)); $rval = false; if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $e["error"] . ": " . - $byemsg . $this->CRLF; + error_log(__METHOD__."->"."SMTP -> ERROR: " . $e["error"] . ": " . + $byemsg . $this->CRLF); } } @@ -825,7 +825,7 @@ class SMTP { $code = substr($rply,0,3); if($this->do_debug >= 2) { - echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; + error_log(__METHOD__."->". "SMTP -> FROM SERVER:" . $this->CRLF . $rply); } if($code != 250 && $code != 251) { @@ -834,8 +834,8 @@ class SMTP { "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . - ": " . $rply . $this->CRLF; + error_log(__METHOD__."->"."SMTP -> ERROR: " . $this->error["error"] . + ": " . $rply . $this->CRLF); } return false; } @@ -869,7 +869,7 @@ class SMTP { $code = substr($rply,0,3); if($this->do_debug >= 2) { - echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; + error_log(__METHOD__."->"."SMTP -> FROM SERVER:" . $this->CRLF . $rply); } if($code != 250) { @@ -878,8 +878,8 @@ class SMTP { "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . - ": " . $rply . $this->CRLF; + error_log(__METHOD__."->"."SMTP -> ERROR: " . $this->error["error"] . + ": " . $rply . $this->CRLF); } return false; } @@ -918,7 +918,7 @@ class SMTP { $code = substr($rply,0,3); if($this->do_debug >= 2) { - echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; + error_log(__METHOD__."->"."SMTP -> FROM SERVER:" . $this->CRLF . $rply); } if($code != 250) { @@ -927,8 +927,8 @@ class SMTP { "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . - ": " . $rply . $this->CRLF; + error_log(__METHOD__."->"."SMTP -> ERROR: " . $this->error["error"] . + ": " . $rply . $this->CRLF); } return false; } @@ -966,7 +966,7 @@ class SMTP { $code = substr($rply,0,3); if($this->do_debug >= 2) { - echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; + error_log(__METHOD__."->"."SMTP -> FROM SERVER:" . $this->CRLF . $rply); } if($code != 250) { @@ -975,8 +975,8 @@ class SMTP { "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . - ": " . $rply . $this->CRLF; + error_log(__METHOD__."->". "SMTP -> ERROR: " . $this->error["error"] . + ": " . $rply . $this->CRLF); } return false; } @@ -1014,7 +1014,7 @@ class SMTP { $code = substr($rply,0,3); if($this->do_debug >= 2) { - echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; + error_log(__METHOD__."->"."SMTP -> FROM SERVER:" . $this->CRLF . $rply); } if($code != 250) { @@ -1023,8 +1023,8 @@ class SMTP { "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . - ": " . $rply . $this->CRLF; + error_log(__METHOD__."->". "SMTP -> ERROR: " . $this->error["error"] . + ": " . $rply . $this->CRLF); } return false; } @@ -1048,7 +1048,7 @@ class SMTP { $this->error = array("error" => "This method, TURN, of the SMTP ". "is not implemented"); if($this->do_debug >= 1) { - echo "SMTP -> NOTICE: " . $this->error["error"] . $this->CRLF; + error_log(__METHOD__."->"."SMTP -> NOTICE: " . $this->error["error"] . $this->CRLF); } return false; } @@ -1081,7 +1081,7 @@ class SMTP { $code = substr($rply,0,3); if($this->do_debug >= 2) { - echo "SMTP -> FROM SERVER:" . $this->CRLF . $rply; + error_log(__METHOD__."->"."SMTP -> FROM SERVER:" . $this->CRLF . $rply); } if($code != 250 && $code != 251) { @@ -1090,8 +1090,8 @@ class SMTP { "smtp_code" => $code, "smtp_msg" => substr($rply,4)); if($this->do_debug >= 1) { - echo "SMTP -> ERROR: " . $this->error["error"] . - ": " . $rply . $this->CRLF; + error_log(__METHOD__."->". "SMTP -> ERROR: " . $this->error["error"] . + ": " . $rply . $this->CRLF); } return false; } @@ -1115,14 +1115,14 @@ class SMTP { $data = ""; while($str = @fgets($this->smtp_conn,515)) { if($this->do_debug >= 4) { - echo "SMTP -> get_lines(): \$data was \"$data\"" . - $this->CRLF; - echo "SMTP -> get_lines(): \$str is \"$str\"" . - $this->CRLF; + error_log(__METHOD__."->"."SMTP -> get_lines(): \$data was \"$data\"" . + $this->CRLF); + error_log(__METHOD__."->"."SMTP -> get_lines(): \$str is \"$str\"" . + $this->CRLF); } $data .= $str; if($this->do_debug >= 4) { - echo "SMTP -> get_lines(): \$data is \"$data\"" . $this->CRLF; + error_log(__METHOD__."->". "SMTP -> get_lines(): \$data is \"$data\"" . $this->CRLF); } // if the 4th character is a space then we are done reading // so just break the loop From 0ec64072a296399e3a018e0eb29520632ec7ca24 Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Tue, 9 Dec 2008 14:02:22 +0000 Subject: [PATCH 013/510] enabling more info FOR THE ERROR_LOG --- phpgwapi/inc/class.egw_session.inc.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/phpgwapi/inc/class.egw_session.inc.php b/phpgwapi/inc/class.egw_session.inc.php index ad0593d4da..c32d05c175 100644 --- a/phpgwapi/inc/class.egw_session.inc.php +++ b/phpgwapi/inc/class.egw_session.inc.php @@ -739,7 +739,10 @@ class egw_session $this->sessionid = $sessionid; $this->kp3 = $kp3; - if (!$this->sessionid) return false; + if (!$this->sessionid) { + if (self::$errorlog_debug) error_log(__METHOD__."('$sessionid')_REQUEST[sessionid]='$_REQUEST[sessionid]' No session ID"); + return false; + } session_name(self::EGW_SESSION_NAME); session_id($this->sessionid); From 76faf17eb06a47117f2e749e5d3702919a7939e5 Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Tue, 9 Dec 2008 15:25:26 +0000 Subject: [PATCH 014/510] strange phenomenon with existing debug variable --- phpgwapi/inc/class.preferences.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpgwapi/inc/class.preferences.inc.php b/phpgwapi/inc/class.preferences.inc.php index 0bc9be9909..a4b5056d3c 100644 --- a/phpgwapi/inc/class.preferences.inc.php +++ b/phpgwapi/inc/class.preferences.inc.php @@ -69,7 +69,7 @@ class preferences var $table = 'egw_preferences'; var $values,$vars; // standard notify substitues, will be set by standard_substitues() - var $debug = false; + #var $debug = false; /** * Standard constructor for setting $this->account_id */ From 66bb41b0650f919ce7e1555e77b640f1be617c97 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Tue, 9 Dec 2008 16:02:01 +0000 Subject: [PATCH 015/510] Check to see if the value is a string before we try to lowercase it, strtolower() doesn't like arrays. --- etemplate/inc/class.ajax_select_widget.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etemplate/inc/class.ajax_select_widget.inc.php b/etemplate/inc/class.ajax_select_widget.inc.php index 5e31f9fbf2..9b6e1fb822 100644 --- a/etemplate/inc/class.ajax_select_widget.inc.php +++ b/etemplate/inc/class.ajax_select_widget.inc.php @@ -275,7 +275,7 @@ // sometimes it sends 'null' (not null) if($row == 'null') { unset($query[$key]); - } elseif (strtolower($row) == 'false') { + } elseif (is_string($row) && strtolower($row) == 'false') { $row = false; } } From fad2227b8cd1bc11171657b01f26d8e9feea8999 Mon Sep 17 00:00:00 2001 From: Christian Binder Date: Wed, 10 Dec 2008 19:47:22 +0000 Subject: [PATCH 016/510] Added new function set_skip_backends() to notifications class. The calling application now can set backends which must be skipped even if the user has set the backend to be executed in its prefs. This is useful for e.g. notifying about new mails in future (where a user pref "notify me by mail" does not make sense). --- notifications/inc/class.notifications.inc.php | 43 +++++++++++++++---- 1 file changed, 34 insertions(+), 9 deletions(-) diff --git a/notifications/inc/class.notifications.inc.php b/notifications/inc/class.notifications.inc.php index 050c7b90ca..4838d05d42 100644 --- a/notifications/inc/class.notifications.inc.php +++ b/notifications/inc/class.notifications.inc.php @@ -42,6 +42,13 @@ final class notifications { */ private $backends = array('popup', 'winpopup', 'email', 'sms'); + /** + * backends to skip even if the user has chosen it + * this could be set by the calling application + * @var array + */ + private $skip_backends = array(); + /** * pre-defined notificaton chains * @abstract @@ -316,6 +323,17 @@ final class notifications { return true; } + /** + * Sets backends that should be skipped even if the user + * defined them in its chain + * + * @param array $_skip_backends array with names of the backends to be skipped + * e.g. array('popup', 'winpopup') + */ + public function set_skip_backends(array $_skip_backends) { + $this->skip_backends = $_skip_backends; + } + /** * sends notifications */ @@ -373,9 +391,16 @@ final class notifications { continue; //user disabled notifications } - foreach($notification_chain as $notification_backend => $action) { + foreach($notification_chain as $backend => $action) { try { - $notification_backend = self::_appname.'_'.$notification_backend; + // check if backend should be skipped + if( in_array($backend, $this->skip_backends) ) { + // log as error just for the case too much skipping prevents user from being notified + $backend_errors[] = $backend.' will be skipped (as defined by calling application)'; + continue; + } + + $notification_backend = self::_appname.'_'.$backend; if(!file_exists(EGW_INCLUDE_ROOT. SEP. self::_appname. SEP. 'inc'. SEP. 'class.'. $notification_backend. '.inc.php')) { throw new Exception('file for '.$notification_backend. ' does not exist'); } @@ -393,19 +418,19 @@ final class notifications { if($action == 'fail' || $action == 'continue') { continue; } - // all backends failed - give error message - if(!$user_notified) { - error_log('Error: notification of receiver '.$receiver->handle.' failed for the following reasons:'); - foreach($backend_errors as $id=>$backend_error) { - error_log($backend_error); - } - } break; // stop running through chain } // backend sucseeded $user_notified = true; if($action == 'stop' || $action == 'fail') { break; } // stop running through chain } + // check if the user has been notified at all + if(!$user_notified) { + error_log('Error: notification of receiver '.$receiver->handle.' failed for the following reasons:'); + foreach($backend_errors as $id=>$backend_error) { + error_log($backend_error); + } + } } catch (Exception $exception_user) { error_log('Error: notification of receiver '.$receiver->handle.' failed: '.$exception_user->getMessage()); From 632003f9fed8aae28e3f1435ee66313b9c684848 Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Thu, 11 Dec 2008 13:44:47 +0000 Subject: [PATCH 017/510] buffer and provide debug on missing participants to an event --- calendar/inc/class.calendar_bo.inc.php | 41 +++++++++++++++----------- 1 file changed, 24 insertions(+), 17 deletions(-) diff --git a/calendar/inc/class.calendar_bo.inc.php b/calendar/inc/class.calendar_bo.inc.php index e319694242..165fc8de36 100644 --- a/calendar/inc/class.calendar_bo.inc.php +++ b/calendar/inc/class.calendar_bo.inc.php @@ -1002,27 +1002,34 @@ class calendar_bo // Check if the $user is one of the participants or has a read-grant from one of them // in that case he has an implicite READ grant for that event // - foreach($event['participants'] as $uid => $accept) + if ($event['participants'] && is_array($event['participants'])) { - if ($uid == $user || $uid < 0 && in_array($user,$GLOBALS['egw']->accounts->members($uid,true))) + foreach($event['participants'] as $uid => $accept) { - // if we are a participant, we have an implicite READ and PRIVAT grant - $grants |= EGW_ACL_READ | EGW_ACL_PRIVATE; - break; - } - elseif ($this->grants[$uid] & EGW_ACL_READ) - { - // if we have a READ grant from a participant, we dont give an implicit privat grant too - $grants |= EGW_ACL_READ; - // we cant break here, as we might be a participant too, and would miss the privat grant - } - elseif (!is_numeric($uid)) - { - // if we have a resource as participant - $resource = $this->resource_info($uid); - $grants |= $resource['rights']; + if ($uid == $user || $uid < 0 && in_array($user,$GLOBALS['egw']->accounts->members($uid,true))) + { + // if we are a participant, we have an implicite READ and PRIVAT grant + $grants |= EGW_ACL_READ | EGW_ACL_PRIVATE; + break; + } + elseif ($this->grants[$uid] & EGW_ACL_READ) + { + // if we have a READ grant from a participant, we dont give an implicit privat grant too + $grants |= EGW_ACL_READ; + // we cant break here, as we might be a participant too, and would miss the privat grant + } + elseif (!is_numeric($uid)) + { + // if we have a resource as participant + $resource = $this->resource_info($uid); + $grants |= $resource['rights']; + } } } + else + { + error_log(__METHOD__." no participants for event:".print_r($event,true)); + } } if ($GLOBALS['egw']->accounts->get_type($owner) == 'g' && $needed == EGW_ACL_ADD) From 42b2b639b3c2c66735e6799fb400a5bc1c22ce72 Mon Sep 17 00:00:00 2001 From: Klaus Leithoff Date: Fri, 12 Dec 2008 09:47:54 +0000 Subject: [PATCH 018/510] increasing the version number of infolog.edit.description and infolog.index.rows after a case-study regarding the enabling of HTML in Infolog description. The issue was soon dropped after experiencing massive problems with: sync, listview, performance, etc. If you are intrested in trying it, contact me for the source snippets. But I wont recommend that for anything near production --- infolog/setup/etemplates.inc.php | 60 +++++++++++++++++++++++++++++++- 1 file changed, 59 insertions(+), 1 deletion(-) diff --git a/infolog/setup/etemplates.inc.php b/infolog/setup/etemplates.inc.php index a47ac61364..f88506996c 100644 --- a/infolog/setup/etemplates.inc.php +++ b/infolog/setup/etemplates.inc.php @@ -2,7 +2,7 @@ /** * eGroupWare - eTemplates for Application infolog * http://www.egroupware.org - * generated by soetemplate::dump4setup() 2008-10-07 15:18 + * generated by soetemplate::dump4setup() 2008-12-12 10:43 * * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License * @package infolog @@ -12,12 +12,17 @@ $templ_version=1; +$templ_data[] = array('name' => 'infolog.customfields','template' => '','lang' => '','group' => '0','version' => '1.2.001','data' => 'a:1:{i:0;a:4:{s:4:"type";s:4:"grid";s:4:"data";a:7:{i:0;a:3:{s:1:"F";s:3:"80%";s:2:"c2";s:6:"header";s:2:"c4";s:6:"header";}i:1;a:6:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:3:"Typ";}s:1:"B";a:4:{s:4:"type";s:6:"select";s:4:"name";s:3:"typ";s:8:"onchange";s:1:"1";s:4:"help";s:52:"select a typ to edit it\'s status-values or delete it";}s:1:"C";a:4:{s:4:"type";s:6:"button";s:5:"label";s:6:"Delete";s:4:"name";s:14:"button[delete]";s:4:"help";s:24:"deletes the selected typ";}s:1:"D";a:5:{s:4:"type";s:4:"text";s:4:"size";s:5:"10,40";s:4:"name";s:8:"new_name";s:4:"help";s:26:"name of new type to create";s:4:"blur";s:8:"new name";}s:1:"E";a:4:{s:4:"type";s:6:"button";s:5:"label";s:6:"Create";s:4:"name";s:14:"button[create]";s:4:"help";s:37:"creates a new typ with the given name";}s:1:"F";a:5:{s:4:"type";s:5:"label";s:4:"span";s:10:",error_msg";s:7:"no_lang";s:1:"1";s:5:"align";s:6:"center";s:4:"name";s:9:"error_msg";}}i:2;a:6:{s:1:"A";a:4:{s:4:"type";s:5:"label";s:4:"span";s:3:"all";s:5:"label";s:21:"Custom status for typ";s:4:"name";s:3:"typ";}s:1:"B";a:1:{s:4:"type";s:5:"label";}s:1:"C";a:1:{s:4:"type";s:5:"label";}s:1:"D";a:1:{s:4:"type";s:5:"label";}s:1:"E";a:1:{s:4:"type";s:5:"label";}s:1:"F";a:1:{s:4:"type";s:5:"label";}}i:3;a:6:{s:1:"A";a:4:{s:4:"type";s:8:"template";s:4:"size";s:6:"status";s:4:"span";s:3:"all";s:4:"name";s:6:"status";}s:1:"B";a:1:{s:4:"type";s:5:"label";}s:1:"C";a:1:{s:4:"type";s:5:"label";}s:1:"D";a:1:{s:4:"type";s:5:"label";}s:1:"E";a:1:{s:4:"type";s:5:"label";}s:1:"F";a:1:{s:4:"type";s:5:"label";}}i:4;a:6:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:4:"span";s:3:"all";s:5:"label";s:13:"Custom fields";}s:1:"B";a:1:{s:4:"type";s:5:"label";}s:1:"C";a:1:{s:4:"type";s:5:"label";}s:1:"D";a:1:{s:4:"type";s:5:"label";}s:1:"E";a:1:{s:4:"type";s:5:"label";}s:1:"F";a:1:{s:4:"type";s:5:"label";}}i:5;a:6:{s:1:"A";a:4:{s:4:"type";s:8:"template";s:4:"size";s:6:"fields";s:4:"span";s:3:"all";s:4:"name";s:6:"fields";}s:1:"B";a:1:{s:4:"type";s:5:"label";}s:1:"C";a:1:{s:4:"type";s:5:"label";}s:1:"D";a:1:{s:4:"type";s:5:"label";}s:1:"E";a:1:{s:4:"type";s:5:"label";}s:1:"F";a:1:{s:4:"type";s:5:"label";}}i:6;a:6:{s:1:"A";a:6:{s:4:"type";s:4:"hbox";s:4:"size";s:1:"3";s:4:"span";s:3:"all";i:1;a:4:{s:4:"type";s:6:"button";s:5:"label";s:4:"Save";s:4:"name";s:12:"button[save]";s:4:"help";s:33:"saves the changes made and leaves";}i:2;a:4:{s:4:"type";s:6:"button";s:5:"label";s:5:"Apply";s:4:"name";s:13:"button[apply]";s:4:"help";s:19:"applies the changes";}i:3;a:4:{s:4:"type";s:6:"button";s:5:"label";s:6:"Cancel";s:4:"name";s:14:"button[cancel]";s:4:"help";s:22:"leaves without saveing";}}s:1:"B";a:1:{s:4:"type";s:5:"label";}s:1:"C";a:1:{s:4:"type";s:5:"label";}s:1:"D";a:1:{s:4:"type";s:5:"label";}s:1:"E";a:1:{s:4:"type";s:5:"label";}s:1:"F";a:1:{s:4:"type";s:5:"label";}}}s:4:"rows";i:6;s:4:"cols";i:6;}}','size' => '','style' => '.header { font-weight: bold; font-size: 120%; } +.error_msg { color: red; font-style: italics; }','modified' => '1061729975',); + $templ_data[] = array('name' => 'infolog.customfields','template' => '','lang' => '','group' => '0','version' => '1.3.001','data' => 'a:1:{i:0;a:4:{s:4:"type";s:4:"grid";s:4:"data";a:7:{i:0;a:3:{s:1:"F";s:3:"80%";s:2:"c2";s:6:"header";s:2:"c4";s:6:"header";}i:1;a:6:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:3:"Typ";}s:1:"B";a:5:{s:4:"type";s:6:"select";s:4:"name";s:5:"type2";s:8:"onchange";i:1;s:4:"help";s:52:"select a typ to edit it\'s status-values or delete it";s:7:"no_lang";s:1:"1";}s:1:"C";a:4:{s:4:"type";s:6:"button";s:5:"label";s:6:"Delete";s:4:"name";s:14:"button[delete]";s:4:"help";s:24:"deletes the selected typ";}s:1:"D";a:5:{s:4:"type";s:4:"text";s:4:"size";s:5:"10,40";s:4:"name";s:8:"new_name";s:4:"help";s:26:"name of new type to create";s:4:"blur";s:8:"new name";}s:1:"E";a:4:{s:4:"type";s:6:"button";s:5:"label";s:6:"Create";s:4:"name";s:14:"button[create]";s:4:"help";s:37:"creates a new typ with the given name";}s:1:"F";a:5:{s:4:"type";s:5:"label";s:4:"span";s:10:",error_msg";s:7:"no_lang";s:1:"1";s:5:"align";s:6:"center";s:4:"name";s:9:"error_msg";}}i:2;a:6:{s:1:"A";a:4:{s:4:"type";s:5:"label";s:4:"span";s:3:"all";s:5:"label";s:21:"Custom status for typ";s:4:"name";s:3:"typ";}s:1:"B";a:1:{s:4:"type";s:5:"label";}s:1:"C";a:1:{s:4:"type";s:5:"label";}s:1:"D";a:1:{s:4:"type";s:5:"label";}s:1:"E";a:1:{s:4:"type";s:5:"label";}s:1:"F";a:1:{s:4:"type";s:5:"label";}}i:3;a:6:{s:1:"A";a:4:{s:4:"type";s:8:"template";s:4:"size";s:6:"status";s:4:"span";s:3:"all";s:4:"name";s:6:"status";}s:1:"B";a:1:{s:4:"type";s:5:"label";}s:1:"C";a:1:{s:4:"type";s:5:"label";}s:1:"D";a:1:{s:4:"type";s:5:"label";}s:1:"E";a:1:{s:4:"type";s:5:"label";}s:1:"F";a:1:{s:4:"type";s:5:"label";}}i:4;a:6:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:4:"span";s:3:"all";s:5:"label";s:13:"Custom fields";}s:1:"B";a:1:{s:4:"type";s:5:"label";}s:1:"C";a:1:{s:4:"type";s:5:"label";}s:1:"D";a:1:{s:4:"type";s:5:"label";}s:1:"E";a:1:{s:4:"type";s:5:"label";}s:1:"F";a:1:{s:4:"type";s:5:"label";}}i:5;a:6:{s:1:"A";a:4:{s:4:"type";s:8:"template";s:4:"size";s:6:"fields";s:4:"span";s:3:"all";s:4:"name";s:6:"fields";}s:1:"B";a:1:{s:4:"type";s:5:"label";}s:1:"C";a:1:{s:4:"type";s:5:"label";}s:1:"D";a:1:{s:4:"type";s:5:"label";}s:1:"E";a:1:{s:4:"type";s:5:"label";}s:1:"F";a:1:{s:4:"type";s:5:"label";}}i:6;a:6:{s:1:"A";a:6:{s:4:"type";s:4:"hbox";s:4:"size";s:1:"3";s:4:"span";s:3:"all";i:1;a:4:{s:4:"type";s:6:"button";s:5:"label";s:4:"Save";s:4:"name";s:12:"button[save]";s:4:"help";s:33:"saves the changes made and leaves";}i:2;a:4:{s:4:"type";s:6:"button";s:5:"label";s:5:"Apply";s:4:"name";s:13:"button[apply]";s:4:"help";s:19:"applies the changes";}i:3;a:4:{s:4:"type";s:6:"button";s:5:"label";s:6:"Cancel";s:4:"name";s:14:"button[cancel]";s:4:"help";s:22:"leaves without saveing";}}s:1:"B";a:1:{s:4:"type";s:5:"label";}s:1:"C";a:1:{s:4:"type";s:5:"label";}s:1:"D";a:1:{s:4:"type";s:5:"label";}s:1:"E";a:1:{s:4:"type";s:5:"label";}s:1:"F";a:1:{s:4:"type";s:5:"label";}}}s:4:"rows";i:6;s:4:"cols";i:6;}}','size' => '','style' => '.header { font-weight: bold; font-size: 120%; } .error_msg { color: red; font-style: italics; }','modified' => '1159943136',); $templ_data[] = array('name' => 'infolog.customfields','template' => '','lang' => '','group' => '0','version' => '1.3.002','data' => 'a:1:{i:0;a:4:{s:4:"type";s:4:"grid";s:4:"data";a:8:{i:0;a:3:{s:2:"c2";s:6:"header";s:2:"c4";s:6:"header";s:1:"F";s:3:"80%";}i:1;a:6:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:3:"Typ";}s:1:"B";a:5:{s:4:"type";s:6:"select";s:4:"name";s:5:"type2";s:8:"onchange";i:1;s:4:"help";s:52:"select a typ to edit it\'s status-values or delete it";s:7:"no_lang";s:1:"1";}s:1:"C";a:4:{s:4:"type";s:6:"button";s:5:"label";s:6:"Delete";s:4:"name";s:14:"button[delete]";s:4:"help";s:24:"deletes the selected typ";}s:1:"D";a:5:{s:4:"type";s:4:"text";s:4:"size";s:5:"10,40";s:4:"name";s:8:"new_name";s:4:"help";s:26:"name of new type to create";s:4:"blur";s:8:"new name";}s:1:"E";a:4:{s:4:"type";s:6:"button";s:5:"label";s:6:"Create";s:4:"name";s:14:"button[create]";s:4:"help";s:37:"creates a new typ with the given name";}s:1:"F";a:5:{s:4:"type";s:5:"label";s:4:"span";s:10:",error_msg";s:7:"no_lang";s:1:"1";s:5:"align";s:6:"center";s:4:"name";s:9:"error_msg";}}i:2;a:6:{s:1:"A";a:4:{s:4:"type";s:5:"label";s:4:"span";s:3:"all";s:5:"label";s:21:"Custom status for typ";s:4:"name";s:3:"typ";}s:1:"B";a:1:{s:4:"type";s:5:"label";}s:1:"C";a:1:{s:4:"type";s:5:"label";}s:1:"D";a:1:{s:4:"type";s:5:"label";}s:1:"E";a:1:{s:4:"type";s:5:"label";}s:1:"F";a:1:{s:4:"type";s:5:"label";}}i:3;a:6:{s:1:"A";a:4:{s:4:"type";s:8:"template";s:4:"size";s:6:"status";s:4:"span";s:3:"all";s:4:"name";s:6:"status";}s:1:"B";a:1:{s:4:"type";s:5:"label";}s:1:"C";a:1:{s:4:"type";s:5:"label";}s:1:"D";a:1:{s:4:"type";s:5:"label";}s:1:"E";a:1:{s:4:"type";s:5:"label";}s:1:"F";a:1:{s:4:"type";s:5:"label";}}i:4;a:6:{s:1:"A";a:3:{s:4:"type";s:5:"label";s:4:"span";s:3:"all";s:5:"label";s:13:"Custom fields";}s:1:"B";a:1:{s:4:"type";s:5:"label";}s:1:"C";a:1:{s:4:"type";s:5:"label";}s:1:"D";a:1:{s:4:"type";s:5:"label";}s:1:"E";a:1:{s:4:"type";s:5:"label";}s:1:"F";a:1:{s:4:"type";s:5:"label";}}i:5;a:6:{s:1:"A";a:4:{s:4:"type";s:8:"template";s:4:"size";s:6:"fields";s:4:"span";s:3:"all";s:4:"name";s:6:"fields";}s:1:"B";a:1:{s:4:"type";s:5:"label";}s:1:"C";a:1:{s:4:"type";s:5:"label";}s:1:"D";a:1:{s:4:"type";s:5:"label";}s:1:"E";a:1:{s:4:"type";s:5:"label";}s:1:"F";a:1:{s:4:"type";s:5:"label";}}i:6;a:6:{s:1:"A";a:5:{s:4:"type";s:4:"hbox";s:4:"size";s:6:"2,,0,0";i:1;a:4:{s:4:"type";s:5:"label";s:4:"span";s:7:",header";s:5:"label";s:15:"Group owner for";s:4:"name";s:5:"type2";}i:2;a:5:{s:4:"type";s:14:"select-account";s:4:"size";s:11:"None,groups";s:4:"name";s:11:"group_owner";s:4:"help";s:119:"If a type has a group owner, all entries of that type will be owned by the given group and NOT the user who created it!";s:4:"span";s:10:",lpadding5";}s:4:"span";s:3:"all";}s:1:"B";a:1:{s:4:"type";s:5:"label";}s:1:"C";a:1:{s:4:"type";s:5:"label";}s:1:"D";a:1:{s:4:"type";s:5:"label";}s:1:"E";a:1:{s:4:"type";s:5:"label";}s:1:"F";a:1:{s:4:"type";s:5:"label";}}i:7;a:6:{s:1:"A";a:6:{s:4:"type";s:4:"hbox";s:4:"size";s:1:"3";s:4:"span";s:3:"all";i:1;a:4:{s:4:"type";s:6:"button";s:5:"label";s:4:"Save";s:4:"name";s:12:"button[save]";s:4:"help";s:33:"saves the changes made and leaves";}i:2;a:4:{s:4:"type";s:6:"button";s:5:"label";s:5:"Apply";s:4:"name";s:13:"button[apply]";s:4:"help";s:19:"applies the changes";}i:3;a:4:{s:4:"type";s:6:"button";s:5:"label";s:6:"Cancel";s:4:"name";s:14:"button[cancel]";s:4:"help";s:22:"leaves without saveing";}}s:1:"B";a:1:{s:4:"type";s:5:"label";}s:1:"C";a:1:{s:4:"type";s:5:"label";}s:1:"D";a:1:{s:4:"type";s:5:"label";}s:1:"E";a:1:{s:4:"type";s:5:"label";}s:1:"F";a:1:{s:4:"type";s:5:"label";}}}s:4:"rows";i:7;s:4:"cols";i:6;}}','size' => '','style' => '.header { font-weight: bold; font-size: 120%; } .error_msg { color: red; font-style: italics; }','modified' => '1173687088',); +$templ_data[] = array('name' => 'infolog.customfields.fields','template' => '','lang' => '','group' => '0','version' => '1.2.001','data' => 'a:1:{i:0;a:4:{s:4:"type";s:4:"grid";s:4:"data";a:3:{i:0;a:2:{s:2:"c1";s:2:"th";s:2:"c2";s:7:"row,top";}i:1;a:7:{s:1:"A";a:2:{s:4:"type";s:5:"label";s:5:"label";s:3:"Typ";}s:1:"B";a:2:{s:4:"type";s:5:"label";s:5:"label";s:4:"Name";}s:1:"C";a:2:{s:4:"type";s:5:"label";s:5:"label";s:5:"Label";}s:1:"D";a:2:{s:4:"type";s:5:"label";s:5:"label";s:20:"Values for selectbox";}s:1:"E";a:2:{s:4:"type";s:5:"label";s:5:"label";s:14:"Length
Rows";}s:1:"F";a:2:{s:4:"type";s:5:"label";s:5:"label";s:5:"Order";}s:1:"G";a:4:{s:4:"type";s:5:"label";s:5:"label";s:6:"Action";s:5:"align";s:6:"center";s:4:"help";s:18:"deletes this field";}}i:2;a:7:{s:1:"A";a:4:{s:4:"type";s:6:"select";s:4:"size";s:3:"All";s:4:"name";s:11:"${row}[typ]";s:4:"help";s:41:"for which types should this field be used";}s:1:"B";a:4:{s:4:"type";s:4:"text";s:4:"size";s:5:"20,32";s:4:"name";s:12:"${row}[name]";s:4:"help";s:83:"the name used internaly (<= 20 chars), changeing it makes existing data unavailible";}s:1:"C";a:4:{s:4:"type";s:4:"vbox";s:4:"size";s:1:"2";i:1;a:4:{s:4:"type";s:4:"text";s:4:"size";s:4:",255";s:4:"name";s:13:"${row}[label]";s:4:"help";s:30:"the text displayed to the user";}i:2;a:2:{s:4:"type";s:5:"label";s:4:"name";s:13:"${row}[label]";}}s:1:"D";a:4:{s:4:"type";s:8:"textarea";s:4:"size";s:4:"2,30";s:4:"name";s:14:"${row}[values]";s:4:"help";s:40:"each value is a line like [=