phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] news_admin/inc class.uinews.inc.php,1.32


From: skwashd
Subject: [Phpgroupware-cvs] news_admin/inc class.uinews.inc.php,1.32
Date: Mon, 3 Oct 2005 14:31:00 +0200

Update of news_admin/inc

Modified Files:
     Branch: MAIN
            class.uinews.inc.php lines: +15 -16

Log Message:
a few more fixes

====================================================
Index: news_admin/inc/class.uinews.inc.php
diff -u news_admin/inc/class.uinews.inc.php:1.31 
news_admin/inc/class.uinews.inc.php:1.32
--- news_admin/inc/class.uinews.inc.php:1.31    Mon Aug 29 12:57:40 2005
+++ news_admin/inc/class.uinews.inc.php Mon Oct  3 12:31:53 2005
@@ -426,7 +426,7 @@
                                }

                                $begin = 
$jscal->input2date($this->news_data['begin']);
-                               $this->news_data['being'] = $begin['raw'];
+                               $this->news_data['begin'] = $begin['raw'];
                                unset($begin);

                                $end = 
$jscal->input2date($this->news_data['end']);
@@ -711,18 +711,16 @@
                function _get_option_vals(&$news)
                {
                        $now = time();
-                       if (!isset($news['begin'])) //always is default
+                       if (!isset($news['begin']) || $news['begin'] == 0 ) 
//always is default
                        {
                                //these are only displayed values not 
necessarily the ones that will get stored
-                               $news['begin'] = $now;
-                               $news['end'] = $now;
+                               $news['begin'] = 0;
+                               $news['end'] = $this->bo->unixtimestampmax;
                                $from = 1;
                                $until = 1;
                        }
                        elseif ($news['end'] < $now) //if enddate is in the 
past set option to never
                        {
-                               $news['begin'] = $now;
-                               $news['end'] = $now;
                                $from = 0;
                                $until = 1;
                        }
@@ -731,9 +729,8 @@
                                if ($news['begin'] < $now)
                                {
                                        $news['begin'] = $now;
-                                       if ($news['end'] == 
$this->unixtimestampmax)
+                                       if ($news['end'] == 
$this->bo->unixtimestampmax)
                                        {
-                                               $news['end'] = $now;
                                                $from = 1;
                                                $until = 1;
                                        }
@@ -747,7 +744,6 @@
                                {
                                        if ($news['end'] == 
$this->unixtimestampmax)
                                        {
-                                               $news['end'] = $now;
                                                $from = 0.5;
                                                $until = 1;
                                        }
@@ -767,6 +763,9 @@
                        $options['from_never_selected'] = '';
                        $options['from_from_selected']  = '';

+                       $options['to_until_selected'] = '';
+                       $options['to_always_selected'] = '';
+
                        switch($from * 10)
                        {
                                case 0:
@@ -848,9 +847,6 @@
                                        )
                                );

-                       //echo '<br />UI:<br /><pre>'; 
print_r($this->news_data); echo '</pre>';
-
-                       $this->template->set_var( 
$this->_get_option_vals($this->news_data) );
                        $this->template->set_var(
                                                array
                                                        (
@@ -873,22 +869,25 @@
                                                                'value_end'     
=> $jscal->input('news[end]', $this->news_data['end']),
                                                        )
                                                );
+                       //echo '<pre>' . print_r($this->news_data, true) . 
'</pre>';
+                       //echo '<pre>' . 
print_r($this->_get_option_vals($this->news_data), true) . '</pre>';

+                       $this->template->set_var( 
$this->_get_option_vals($this->news_data) );
                        $this->template->pfp('out','form');
                }

                //with $default, we are called from the news form
-               function _selectlist($type, $default=false)
+               function _selectlist($type, $default = 0)
                {
                        $right = ($type == 'read') ? PHPGW_ACL_READ : 
PHPGW_ACL_ADD;
-                       $selectlist = ($default === false) ? ('<option>' . 
lang($type . ' news') . '</option>') : '';
+                       $selectlist = ( !$default ? ('<option>' . lang($type . 
' news') . '</option>') : '');
                        $cats = is_array($this->bo->cats) ? $this->bo->cats : 
array();
                        foreach($cats as $cat)
                        {
                                
if($this->bo->acl->is_permitted($cat['id'],$right))
                                {
                                        $selectlist .= "<option 
value=\"{$cat['id']}\"";
-                                       $selectlist .= ($default === $cat_id) ? 
' selected="selected"' : '';
+                                       $selectlist .= ($default == $cat['id']) 
? ' selected="selected"' : '';
                                        $selectlist .= '>' . $cat['name'] . 
'</option>' . "\n";
                                }
                        }






reply via email to

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