phpgroupware-cvs
[Top][All Lists]
Advanced

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

[Phpgroupware-cvs] CVS: phpbrain/inc class.bokb.inc.php,1.2,1.3 class.so


From: Dave Hall <address@hidden>
Subject: [Phpgroupware-cvs] CVS: phpbrain/inc class.bokb.inc.php,1.2,1.3 class.sokb.inc.php,1.1.1.1,1.2 class.uikb.inc.php,1.2,1.3
Date: Sun, 16 Mar 2003 21:30:38 -0500

Update of /cvsroot/phpgroupware/phpbrain/inc
In directory subversions:/tmp/cvs-serv25172/inc

Modified Files:
        class.bokb.inc.php class.sokb.inc.php class.uikb.inc.php 
Log Message:
lots of little bug fixes :)

Index: class.bokb.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpbrain/inc/class.bokb.inc.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** class.bokb.inc.php  16 Mar 2003 22:28:14 -0000      1.2
--- class.bokb.inc.php  17 Mar 2003 02:30:31 -0000      1.3
***************
*** 91,100 ****
                function get_faq_list($cat_id = '', $unpublished = false)
                {
!                       if(!$this->is_admin() && !$unpublished)
                        {
                                $unpublished = false;
                        }
  
!                       $faqs = $this->so->get_faq_list($cat_id);
                        if(is_array($faqs))
                        {
--- 91,100 ----
                function get_faq_list($cat_id = '', $unpublished = false)
                {
!                       if(!$this->is_admin() && $unpublished)
                        {
                                $unpublished = false;
                        }
  
!                       $faqs = $this->so->get_faq_list($cat_id, $unpublished);
                        if(is_array($faqs))
                        {
***************
*** 133,138 ****
                function get_questions($pending = false)
                {
!                       
!                       if(!$this->is_admin() && $pending = true)
                        {
                                return null;
--- 133,137 ----
                function get_questions($pending = false)
                {
!                       if(!$this->is_admin() && $pending)
                        {
                                return null;
***************
*** 167,171 ****
                {
                        return 
isset($GLOBALS['phpgw_info']['user']['apps']['admin']);
-                       //return $GLOBALS['phpgw']->acl->check('run', 1, 
'admin');
                }//end is_admin
                
--- 166,169 ----
***************
*** 176,180 ****
                }//end is_anon
  
!               function save($faq_id, $faq)
                {
                        
if(!$GLOBALS['phpgw_info']['apps']['phpkb']['config']['alow_tags'])
--- 174,178 ----
                }//end is_anon
  
!               function save($faq_id, $faq, $question_id)
                {
                        
if(!$GLOBALS['phpgw_info']['apps']['phpkb']['config']['alow_tags'])
***************
*** 185,189 ****
                        }
                        $faq['user_id'] = 
$GLOBALS['phpgw_info']['user']['account_id'];
!                       return $this->so->save($faq_id, $faq, 
$this->is_admin());
                }//end save
                
--- 183,193 ----
                        }
                        $faq['user_id'] = 
$GLOBALS['phpgw_info']['user']['account_id'];
!                       $new_faq_id = $this->so->save($faq_id, $faq, 
$this->is_admin());
!                       if($new_faq_id && $question_id && !$faq_id)
!                       {
!                               $this->so->delete_question($question_id);
!                       }
!                       return $new_faq_id;
!                       
                }//end save
                

Index: class.sokb.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpbrain/inc/class.sokb.inc.php,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -r1.1.1.1 -r1.2
*** class.sokb.inc.php  16 Mar 2003 15:25:18 -0000      1.1.1.1
--- class.sokb.inc.php  17 Mar 2003 02:30:31 -0000      1.2
***************
*** 28,32 ****
                        foreach($faq_ids as $key => $val)
                        {
!                               $this->db->query("DELETE FROM phpgw_kb_faqs 
WHERE faq_id = $key");
                                $i++;
                        }
--- 28,32 ----
                        foreach($faq_ids as $key => $val)
                        {
!                               $this->db->query("DELETE FROM phpgw_kb_faq 
WHERE faq_id = $key");
                                $i++;
                        }
***************
*** 34,37 ****
--- 34,56 ----
                }//end set_active_answer
  
+               function delete_question($question_ids)
+               {
+                       if(is_array($question_ids))
+                       {
+                               $i=0;
+                       foreach($question_ids as $key => $val)
+                       {
+                               $this->db->query("DELETE FROM 
phpgw_kb_questions WHERE question_id = $key");
+                               $i++;
+                       }//end foreach(q_id)
+                       }
+                       elseif(is_int($question_ids))
+                       {
+                               $this->db->query("DELETE FROM 
phpgw_kb_questions WHERE question_id = $question_ids");
+                               $i = 1;
+                       }//end is_type
+                       return $i;
+               }//end set_active_answer
+ 
                function get_stats()
                {       
***************
*** 43,47 ****
      
        /* how many tutorials? */
!       $this->db->query('SELECT COUNT(*) FROM phpgw_kb_faq WHERE is_faq = 1', 
__LINE__, __FILE__);
        $this->db->next_record();
        $stats['num_tutes'] = $this->db->f(0);
--- 62,66 ----
      
        /* how many tutorials? */
!       $this->db->query('SELECT COUNT(*) FROM phpgw_kb_faq WHERE published = 1 
AND is_faq = 1', __LINE__, __FILE__);
        $this->db->next_record();
        $stats['num_tutes'] = $this->db->f(0);
***************
*** 127,131 ****
      function get_count($cat_id)
      {
!       $this->db->query("SELECT COUNT(*) FROM phpgw_kb_faq WHERE cat_id = 
$cat_id", __LINE__, __FILE__);
                        if($this->db->next_record())
                        {
--- 146,150 ----
      function get_count($cat_id)
      {
!       $this->db->query("SELECT COUNT(*) FROM phpgw_kb_faq WHERE cat_id = 
$cat_id AND published = 1", __LINE__, __FILE__);
                        if($this->db->next_record())
                        {
***************
*** 175,180 ****
                function get_questions($pending = false)
                {
!                       $where = ($pending ? 'pending = 0' : 'pending = 1');
!                       $this->db->query('SELECT * FROM phpgw_kb_questions 
WHERE ' . $where, __LINE__, __FILE__);
                        while($this->db->next_record())
                        {
--- 194,199 ----
                function get_questions($pending = false)
                {
!                       $where = ($pending ? 'pending = 1' : 'pending = 0');
!                       $this->db->query("SELECT * FROM phpgw_kb_questions 
WHERE $where", __LINE__, __FILE__);
                        while($this->db->next_record())
                        {
***************
*** 197,201 ****
                                        $sql .= ' modified = ' . time() .',';
                                        $sql .= ' user_id = ' . $faq['user_id'] 
.',';
!                                       $sql .= ' published = ' . ($admin ? 1 : 
0) . ' ';
                                        $sql .= " WHERE faq_id = $faq_id";
                                        $this->db->query($sql);
--- 216,221 ----
                                        $sql .= ' modified = ' . time() .',';
                                        $sql .= ' user_id = ' . $faq['user_id'] 
.',';
!                                       $sql .= ' published = ' . ($admin ? 1 : 
0) . ', ';
!                                       $sql .= ' is_faq = ' . $faq['is_faq'];
                                        $sql .= " WHERE faq_id = $faq_id";
                                        $this->db->query($sql);

Index: class.uikb.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpbrain/inc/class.uikb.inc.php,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** class.uikb.inc.php  16 Mar 2003 16:23:29 -0000      1.2
--- class.uikb.inc.php  17 Mar 2003 02:30:31 -0000      1.3
***************
*** 1,721 ****
! <?php
!       
/**************************************************************************\
!       * phpGroupWare - KnowledgeBase                                          
   *
!       * http://www.phpgroupware.org                                           
   *
!       * Written by Dave Hall [skwashd AT phpgroupware.org]                    
         *
!       * 
------------------------------------------------------------------------ *
!       * Started off as a port of phpBrain - http://vrotvrot.com/phpBrain/     
         *
!       *  but quickly became a full rewrite                                    
                                         *
!       * 
------------------------------------------------------------------------ *
!       *  This program is free software; you can redistribute it and/or modify 
it *
[...1428 lines suppressed...]
!                                       'p {  font-family: 
'.$this->theme['font'].'; font-size: 10pt} '. "\n".
!                                       'li {  font-family: 
'.$this->theme['font'].'; font-size: 10pt} '. "\n".
!                                       'h1   {  font-family: 
'.$this->theme['font'].'; font-size: 16pt; font-weight: bold} '. "\n".
!                                       'h2   {  font-family: 
'.$this->theme['font'].'; font-size: 13pt; font-weight: bold} '. "\n".
!                                       'A:link    {  font-family: 
'.$this->theme['font'].'; text-decoration: none; '.$this->theme['link'].'} '. 
"\n".
!                                       'A:visited {  font-family: 
'.$this->theme['font'].'; text-decoration: none; color: 
'.$this->theme['link'].' } '. "\n".
!                                       'A:hover   {  font-family: 
'.$this->theme['font'].'; text-decoration: underline; color: 
'.$this->theme['alink'].'} '. "\n".
!                                       'A.small:link    {  font-family: 
'.$this->theme['font'].'; font-size: 8pt; text-decoration: none; color: 
'.$this->theme['link'].'} '. "\n".
!                                       'A.small:visited {  font-family: 
'.$this->theme['font'].'; font-size: 8pt; text-decoration: none; color: 
'.$this->theme['vlink'].'} '. "\n".
!                                       'A.small:hover   {  font-family: 
'.$this->theme['font'].'; font-size: 8pt; text-decoration: underline; color: 
'.$this->theme['alink'].'} '. "\n".
!                                       '.nav {  font-family: 
'.$this->theme['font'].'; background-color: ' . $this->theme['bg10'] . ';} ' . 
"\n".
!                                       '.search   {  font-family: 
'.$this->theme['font']. '; color: ' . $this->theme['navbar_text'] . '; 
background-color: '.$this->theme['navbar_bg'] . '; font-size: 9pt; border: 1px 
solid ' . $this->theme['bg_color'] . ';} '. "\n".
!                                       '.navbg { font-family: 
'.$this->theme['font'].'; color: '.$this->theme['navbar_text'] .'; 
background-color: '.$this->theme['navbar_bg'] . ';} '. "\n".
!                                       'a.contrlink { font-family: 
'.$this->theme['font'].'; color: '.$this->theme['navbar_text'] .'; 
text-decoration: none;} '. "\n".
!                                       'a.contrlink:hover, a.stats:active { 
font-family: '.$this->theme['font'].'; color: '.$this->theme['navbar_text'] .'; 
text-decoration: underline;}' . "\n".
!                                       '.faq_info {  font-family: 
'.$this->theme['font'].'; color:' . $this->theme['navbar_bg'] . '; font-size: 
8pt} ' . "\n" .
!                                       'hr {background-color: ' . 
$this->theme['navbar_bg'] . '; border-width: 0px; heght: 2px;} ' . "\n" .
!                                       '';
!               }
!       }       





reply via email to

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