/[drupal]/contributions/modules/tasks/tasks.install
ViewVC logotype

Contents of /contributions/modules/tasks/tasks.install

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.7 - (show annotations) (download) (as text)
Tue Jun 19 05:59:13 2007 UTC (2 years, 5 months ago) by scor
Branch: MAIN
CVS Tags: DRUPAL-5--2-0, DRUPAL-5--2-0-ALPHA1, DRUPAL-5--1-3, DRUPAL-5--1-2, HEAD
Branch point for: DRUPAL-5--2, DRUPAL-5
Changes since 1.6: +8 -2 lines
File MIME type: text/x-php
- Patch #128552 by add1sun: rename parent field to task_parent to fix compatibility with book module
1 <?php
2 // $Id: tasks.install,v 1.6 2007/03/19 15:55:16 moonray Exp $
3
4 // Create the database table on install (MySQL only for now)
5 function tasks_install() {
6 if ($GLOBALS['db_type'] == 'mysqli' || $GLOBALS['db_type'] == 'mysql') {
7 drupal_set_message("Creating required tasks.module MySQL tables for first install");
8 db_query("CREATE TABLE {tasks} (
9 nid int(10) unsigned NOT NULL default '0',
10 task_parent int(10) unsigned NOT NULL default '0',
11 assigned_to int(10) unsigned NOT NULL default '0',
12 order_by float unsigned NOT NULL default '0',
13 completed date NOT NULL default '0000-00-00',
14 PRIMARY KEY (nid)
15 ) TYPE=MyISAM /*!40100 DEFAULT CHARACTER SET utf8 */;");
16 }
17 }
18
19 function tasks_uninstall() {
20 db_query('DROP TABLE {tasks}');
21 }
22
23 function tasks_update_1() {
24 $ret[] = update_sql("UPDATE {permission} SET perm = REPLACE(perm, 'edit own task', 'edit own tasks') WHERE perm LIKE '%edit own task%'");
25 $ret[] = update_sql("UPDATE {permission} SET perm = REPLACE(perm, 'create task', 'create tasks') WHERE perm LIKE '%create task%'");
26 return $ret;
27 }
28
29 function tasks_update_2() {
30 $items = array();
31 $items[] = update_sql("ALTER TABLE {tasks} CHANGE parent task_parent int(10) unsigned NOT NULL default '0'");
32 return $items;
33 }

  ViewVC Help
Powered by ViewVC 1.1.2