phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] CVS: news_admin/setup default_records.inc.php,1.2,1.


From: Michael Totschnig <address@hidden>
Subject: [Phpgroupware-cvs] CVS: news_admin/setup default_records.inc.php,1.2,1.2.4.1 setup.inc.php,1.5.4.3,1.5.4.4tables_current.inc.php,1.3.4.2,1.3.4.3 tables_update.inc.php,1.1.4.2,1.1.4.3
Date: Sat, 28 Jun 2003 00:33:49 -0400

Update of /cvsroot/phpgroupware/news_admin/setup
In directory subversions:/tmp/cvs-serv10181/setup

Modified Files:
      Tag: Version-0_9_16-branch
        default_records.inc.php setup.inc.php tables_current.inc.php 
        tables_update.inc.php 
Log Message:
restrict visibility of news item with start and end date
make news_date again the exact timestamp of the creation date


Index: default_records.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/news_admin/setup/default_records.inc.php,v
retrieving revision 1.2
retrieving revision 1.2.4.1
diff -C2 -r1.2 -r1.2.4.1
*** default_records.inc.php     5 Jul 2001 07:29:49 -0000       1.2
--- default_records.inc.php     28 Jun 2003 04:33:47 -0000      1.2.4.1
***************
*** 12,17 ****
    /* $Id$ */
  
!       $oProc->query("INSERT INTO phpgw_news 
(news_date,news_subject,news_submittedby,news_content,news_status) "
!               . "VALUES ('" . time()
!               . "','Sample news item','1','This is a sample item to show what 
this program does.','Active')");
  ?>
--- 12,17 ----
    /* $Id$ */
  
! //    $oProc->query("INSERT INTO phpgw_news 
(news_date,news_subject,news_submittedby,news_content,news_status) "
! //            . "VALUES ('" . time()
! //            . "','Sample news item','1','This is a sample item to show what 
this program does.','Active')");
  ?>

Index: setup.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/news_admin/setup/setup.inc.php,v
retrieving revision 1.5.4.3
retrieving revision 1.5.4.4
diff -C2 -r1.5.4.3 -r1.5.4.4
*** setup.inc.php       27 Jun 2003 05:09:16 -0000      1.5.4.3
--- setup.inc.php       28 Jun 2003 04:33:47 -0000      1.5.4.4
***************
*** 15,19 ****
        $setup_info['news_admin']['name']      = 'news_admin';
        //$setup_info['news_admin']['title']     = 'News Admin';
!       $setup_info['news_admin']['version']   = '0.9.14.501';
        $setup_info['news_admin']['app_order'] = 4;
        $setup_info['news_admin']['enable']    = 1;
--- 15,19 ----
        $setup_info['news_admin']['name']      = 'news_admin';
        //$setup_info['news_admin']['title']     = 'News Admin';
!       $setup_info['news_admin']['version']   = '0.9.14.502';
        $setup_info['news_admin']['app_order'] = 4;
        $setup_info['news_admin']['enable']    = 1;

Index: tables_current.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/news_admin/setup/tables_current.inc.php,v
retrieving revision 1.3.4.2
retrieving revision 1.3.4.3
diff -C2 -r1.3.4.2 -r1.3.4.3
*** tables_current.inc.php      23 Jun 2003 19:20:52 -0000      1.3.4.2
--- tables_current.inc.php      28 Jun 2003 04:33:47 -0000      1.3.4.3
***************
*** 25,29 ****
                                'news_submittedby' => array('type' => 
'varchar','precision' => '255','nullable' => True),
                                'news_content' => array('type' => 
'blob','nullable' => True),
!                               'news_status' => array('type' => 
'varchar','precision' => '16','nullable' => True),
                                'news_cat' => array('type' => 'int','precision' 
=> '4','nullable' => True),
                                'news_teaser' => array('type' => 
'varchar','precision' => '255','nullable' => True)
--- 25,30 ----
                                'news_submittedby' => array('type' => 
'varchar','precision' => '255','nullable' => True),
                                'news_content' => array('type' => 
'blob','nullable' => True),
!                               'news_begin' => array('type' => 
'int','precision' => '4','nullable' => True),
!                               'news_end' => array('type' => 'int','precision' 
=> '4','nullable' => True),
                                'news_cat' => array('type' => 'int','precision' 
=> '4','nullable' => True),
                                'news_teaser' => array('type' => 
'varchar','precision' => '255','nullable' => True)

Index: tables_update.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/news_admin/setup/tables_update.inc.php,v
retrieving revision 1.1.4.2
retrieving revision 1.1.4.3
diff -C2 -r1.1.4.2 -r1.1.4.3
*** tables_update.inc.php       23 Jun 2003 19:20:52 -0000      1.1.4.2
--- tables_update.inc.php       28 Jun 2003 04:33:47 -0000      1.1.4.3
***************
*** 47,53 ****
        }
  
- 
- 
- 
        $test[] = '0.8.1.002';
        function news_admin_upgrade0_8_1_002()
--- 47,50 ----
***************
*** 88,90 ****
--- 85,130 ----
                return $GLOBALS['setup_info']['news_admin']['currentver'];
        }
+ 
+       $test[] = '0.9.14.501';
+       function news_admin_upgrade0_9_14_501()
+       {
+               
$GLOBALS['phpgw_setup']->oProc->AddColumn('phpgw_news','news_begin',array(
+                       'type' => 'int','precision' => '4','nullable' => True
+               ));
+               
$GLOBALS['phpgw_setup']->oProc->AddColumn('phpgw_news','news_end',array(
+                       'type' => 'int','precision' => '4','nullable' => True
+               ));
+               $db2 = $GLOBALS['phpgw_setup']->db;
+               $GLOBALS['phpgw_setup']->oProc->query('SELECT 
news_id,news_status FROM phpgw_news');
+               while($GLOBALS['phpgw_setup']->oProc->next_record())
+               {
+                       $unixtimestampmax = 2147483647;
+                       $db2->query('UPDATE phpgw_news SET 
news_begin=news_date,news_end=' . 
+                               
(($GLOBALS['phpgw_setup']->oProc->f('news_status') == 'Active') ? 
$unixtimestampmax : 'news_date') .
+                               ' WHERE news_id=' . 
$GLOBALS['phpgw_setup']->oProc->f('news_id'));
+               }
+               $newtbldef = array(
+                       'fd' => array(
+                               'news_id' => array('type' => 'auto','nullable' 
=> False),
+                               'news_date' => array('type' => 
'int','precision' => '4','nullable' => True),
+                               'news_subject' => array('type' => 
'varchar','precision' => '255','nullable' => True),
+                               'news_submittedby' => array('type' => 
'varchar','precision' => '255','nullable' => True),
+                               'news_content' => array('type' => 
'blob','nullable' => True),
+                               'news_begin' => array('type' => 
'int','precision' => '4','nullable' => True),
+                               'news_end' => array('type' => 'int','precision' 
=> '4','nullable' => True),
+                               'news_cat' => array('type' => 'int','precision' 
=> '4','nullable' => True),
+                               'news_teaser' => array('type' => 
'varchar','precision' => '255','nullable' => True)
+                       ),
+                       'pk' => array('news_id'),
+                       'fk' => array(),
+                       'ix' => array('news_date','news_subject'),
+                       'uc' => array()
+               );
+               
$GLOBALS['phpgw_setup']->oProc->DropColumn('phpgw_news',$newtbldef,'news_status');
+ 
+               $GLOBALS['setup_info']['news_admin']['currentver'] = 
'0.9.14.502';
+               return $GLOBALS['setup_info']['news_admin']['currentver'];
+       }
+ 
+               
  ?>





reply via email to

[Prev in Thread] Current Thread [Next in Thread]