[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] calendar/setup tables_update.inc.php, 1.25 setup.inc.
From: |
skwashd |
Subject: |
[Phpgroupware-cvs] calendar/setup tables_update.inc.php, 1.25 setup.inc.php, 1.31 phpgw_en.lang, 1.32 |
Date: |
Sun, 23 Oct 2005 14:57:00 +0200 |
Update of calendar/setup
Modified Files:
Branch: MAIN
tables_update.inc.php lines: +73 -1
setup.inc.php lines: +7 -5
phpgw_en.lang lines: +4 -1
Log Message:
now selection is based on contacts not account
====================================================
Index: calendar/setup/tables_update.inc.php
diff -u calendar/setup/tables_update.inc.php:1.24
calendar/setup/tables_update.inc.php:1.25
--- calendar/setup/tables_update.inc.php:1.24 Sun May 15 06:57:37 2005
+++ calendar/setup/tables_update.inc.php Sun Oct 23 12:57:16 2005
@@ -942,4 +942,76 @@
$GLOBALS['setup_info']['calendar']['currentver'] = '0.9.16.001';
return $GLOBALS['setup_info']['calendar']['currentver'];
}
+
+ $test[] = '0.9.16.001';
+ function calendar_upgrade0_9_16_001()
+ {
+ //Yes this is a little ugly but it can stop a bigger fsckup
later on
+
$GLOBALS['phpgw_setup']->oProc->AddColumn('phpgw_cal_user','rec_updated',array(
+ 'type' => 'int',
+ 'precision' => '4',
+ 'nullable' => False,
+ 'default' => '0'
+ ));
+
+ //$GLOBALS['phpgw'] = createObject('phpgwapi.phpgw');
+ $GLOBALS['phpgw']->db =& $GLOBALS['phpgw_setup']->db;
+ $GLOBALS['phpgw']->common = createObject('phpgwapi.common');
+
+ if ( !is_object($GLOBALS['phpgw']->accounts) )
+ {
+ $GLOBALS['phpgw']->accounts =
createObject('phpgwapi.accounts');
+ }
+
+ // Check that the mapping exists - if not create it or else it
will fsck up
+ $GLOBALS['phpgw']->accounts->sync_accounts_contacts();
+
+ // Each account should have a contact record
+ $acct_contacts =
$GLOBALS['phpgw']->accounts->get_account_with_contact();
+
+ $owner_map = array();
+ $GLOBALS['phpgw_setup']->db->query('SELECT cal_id, owner FROM
phpgw_cal', __LINE__, __FILE__);
+ while ( $GLOBALS['phpgw']->db->next_record() )
+ {
+ $owner_map[$GLOBALS['phpgw_setup']->db->f('cal_id')] =
$GLOBALS['phpgw_setup']->db->f('owner');
+ }
+
+ foreach ( $owner_map as $event_id => $acct_id )
+ {
+ echo "[calendar][info] Updating event #{$event_id}
owner from account id {$acct_id} to contact id {$acct_contacts[$acct_id]}<br
/>";
+
+
+ $GLOBALS['phpgw_setup']->db->query('UPDATE phpgw_cal'
+ . " SET owner =
{$acct_contacts[$acct_id]}"
+ . " WHERE
cal_id = {$event_id}"
+ , __LINE__, __FILE__);
+ }
+
+ foreach ( $acct_contacts as $acct_id => $contact_id )
+ {
+ echo "[calendar][info] Updating event participant user
id {$acct_id} to contact id {$contact_id}<br />\n";
+ $GLOBALS['phpgw_setup']->db->query('UPDATE
phpgw_cal_user'
+ . " SET
cal_login = {$contact_id}, rec_updated = 1"
+ . " WHERE
cal_login = {$acct_id}"
+ . ' AND
rec_updated = 0'
+ , __LINE__, __FILE__);
+ }
+
+ //Clean up our little mess
+
$GLOBALS['phpgw_setup']->oProc->DropColumn('phpgw_cal_user',array(
+ 'fd' => array(
+ 'cal_id' => array('type' => 'int','precision'
=> '8','nullable' => False,'default' => '0'),
+ 'cal_login' => array('type' =>
'int','precision' => '8','nullable' => False,'default' => '0'),
+ 'cal_status' => array('type' =>
'char','precision' => '1','nullable' => True,'default' => 'A'),
+ 'cal_type' => array('type' =>
'varchar','precision' => '1','nullable' => False,'default' => '')
+ ),
+ 'pk' => array('cal_id','cal_login'),
+ 'fk' => array(),
+ 'ix' => array(),
+ 'uc' => array()
+ ),'rec_updated');
+
+ $GLOBALS['setup_info']['calendar']['currentver'] = '0.9.18.000';
+ return $GLOBALS['setup_info']['calendar']['currentver'];
+ }
?>
====================================================
Index: calendar/setup/setup.inc.php
diff -u calendar/setup/setup.inc.php:1.30 calendar/setup/setup.inc.php:1.31
--- calendar/setup/setup.inc.php:1.30 Fri Oct 14 23:33:04 2005
+++ calendar/setup/setup.inc.php Sun Oct 23 12:57:16 2005
@@ -12,7 +12,7 @@
/* $Id$ */
$setup_info['calendar']['name'] = 'calendar';
- $setup_info['calendar']['version'] = '0.9.16.001';
+ $setup_info['calendar']['version'] = '0.9.18.001';
$setup_info['calendar']['app_order'] = 3;
$setup_info['calendar']['enable'] = 1;
@@ -26,8 +26,8 @@
<a href="http://docs.phpgroupware.org/wiki/calendar"
target="_blank">Calendar page in our Wiki</a> or
<a href="http://docs.phpgroupware.org/wiki/calendarFAQs"
target="_blank">Calendar FAQs</a>.';
$setup_info['calendar']['maintainer'] = array(
- 'name' => 'Mark Peters',
- 'email' => 'address@hidden'
+ 'name' => 'Dave Hall',
+ 'email' => 'address@hidden'
);
$setup_info['calendar']['tables'][] = 'phpgw_cal';
@@ -54,8 +54,10 @@
/* Dependencies for this app to work */
$setup_info['calendar']['depends'][] = array(
'appname' => 'phpgwapi',
- 'versions' => Array('0.9.14','0.9.15','0.9.16')
+ 'versions' => Array('0.9.16','0.9.17','0.9.18')
);
+
+
====================================================
Index: calendar/setup/phpgw_en.lang
diff -u calendar/setup/phpgw_en.lang:1.31 calendar/setup/phpgw_en.lang:1.32
--- calendar/setup/phpgw_en.lang:1.31 Sun May 15 06:57:37 2005
+++ calendar/setup/phpgw_en.lang Sun Oct 23 12:57:16 2005
@@ -43,6 +43,7 @@
change status calendar en Change Status
click %1here%2 to return to the calendar. calendar en Click
%1here%2 to return to the calendar.
configuration calendar en Configuration
+contacts calendar en Contacts
countries calendar en Countries
country calendar en Country
csv-fieldname calendar en CSV-Fieldname
@@ -195,6 +196,7 @@
refresh calendar en Refresh
reinstate calendar en Reinstate
rejected calendar en Rejected
+remove calendar en Remove
repeat day calendar en Repeat day
repeat end date calendar en Repeat End date
repeat type calendar en Repeat type
@@ -216,7 +218,8 @@
should new events created as private by default ? calendar en
Should new events created as private by default ?
should the mini calendars by printed / displayed in the printer friendly views
? calendar en Should the mini calendars by printed /
displayed in the printer friendly views ?
should the printer friendly view be in black & white or in color (as in normal
view)? calendar en Should the printer friendly view be in black &
white or in color (as in normal view)?
-should the status of the event-participants (accept, reject, ...) be shown in
brakets after each participants name ? calendar en Should the
status of the event-participants (accept, reject, ...) be shown in brakets
after each participants name ?
+should the status of the event-participants (accept, reject, ...) be shown in
brakets after each participants name ? calendar en Should the
status of the event-participants (accept, reject, ...) be shown in brakets
after each participants name ?a
+show contacts calendar en Show Contacts
show day view on main screen calendar en show day view on main
screen
show default view on main screen calendar en Show default
view on main screen
show high priority events on main screen calendar en Show
high priority events on main screen
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] calendar/setup tables_update.inc.php, 1.25 setup.inc.php, 1.31 phpgw_en.lang, 1.32,
skwashd <=