From: Ian Roth Date: Wed, 17 Nov 2010 22:19:24 +0000 (-0500) Subject: fixes Bug: 9394 X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=0d690c3093a9f453cb02f5c8b50413c46de57867;p=horde.git fixes Bug: 9394 Signed-off-by: Michael J. Rubinsky --- diff --git a/jonah/lib/Driver/Sql.php b/jonah/lib/Driver/Sql.php index c71f77cad..5100a6914 100644 --- a/jonah/lib/Driver/Sql.php +++ b/jonah/lib/Driver/Sql.php @@ -50,6 +50,7 @@ class Jonah_Driver_Sql extends Jonah_Driver *
      * 'channel_id'       If empty a new channel is being added, otherwise one
      *                    is being edited.
+     * 'channel_slug'     The channel slug.
      * 'channel_name'     The headline.
      * 'channel_desc'     A description of this channel.
      * 'channel_type'     Whether internal or external.
@@ -71,18 +72,19 @@ class Jonah_Driver_Sql extends Jonah_Driver
                 throw new Jonah_Exception($info['channel_id']);
             }
             $sql = 'INSERT INTO jonah_channels' .
-                   ' (channel_id, channel_name, channel_type, channel_desc, channel_interval, channel_url, channel_link, channel_page_link, channel_story_url, channel_img)' .
-                   ' VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)';
+                   ' (channel_id, channel_slug, channel_name, channel_type, channel_desc, channel_interval, channel_url, channel_link, channel_page_link, channel_story_url, channel_img)' .
+                   ' VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)';
             $values = array();
         } else {
             $sql = 'UPDATE jonah_channels' .
-                   ' SET channel_id = ?, channel_name = ?, channel_type = ?, channel_desc = ?, channel_interval = ?, channel_url = ?, channel_link = ?, channel_page_link = ?, channel_story_url = ?, channel_img = ?' .
+                   ' SET channel_id = ?, channel_slug = ?, channel_name = ?, channel_type = ?, channel_desc = ?, channel_interval = ?, channel_url = ?, channel_link = ?, channel_page_link = ?, channel_story_url = ?, channel_img = ?' .
                    ' WHERE channel_id = ?';
             $values = array((int)$info['channel_id']);
         }
 
         array_unshift($values,
                       (int)$info['channel_id'],
+                      Horde_String::convertCharset($info['channel_slug'], 'UTF-8', $this->_params['charset']),
                       Horde_String::convertCharset($info['channel_name'], 'UTF-8', $this->_params['charset']),
                       (int)$info['channel_type'],
                       isset($info['channel_desc']) ? $info['channel_desc'] : null,
@@ -231,10 +233,10 @@ class Jonah_Driver_Sql extends Jonah_Driver
             }
             $channel = $this->getChannel($info['channel_id']);
             $permalink = $this->getStoryLink($channel, $info);
-            $sql = 'INSERT INTO jonah_stories (story_id, channel_id, story_title, story_desc, story_body_type, story_body, story_url, story_published, story_updated, story_read, story_permalink) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)';
+            $sql = 'INSERT INTO jonah_stories (story_id, channel_id, story_author, story_title, story_desc, story_body_type, story_body, story_url, story_published, story_updated, story_read, story_permalink) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)';
             $values = array($permalink);
         } else {
-            $sql = 'UPDATE jonah_stories SET story_id = ?, channel_id = ?, story_title = ?, story_desc = ?, story_body_type = ?, story_body = ?, story_url = ?, story_published = ?, story_updated = ?, story_read = ? WHERE story_id = ?';
+            $sql = 'UPDATE jonah_stories SET story_id = ?, channel_id = ?, story_author = ?, story_title = ?, story_desc = ?, story_body_type = ?, story_body = ?, story_url = ?, story_published = ?, story_updated = ?, story_read = ? WHERE story_id = ?';
             $values = array((int)$info['id']);
         }
 
@@ -253,6 +255,7 @@ class Jonah_Driver_Sql extends Jonah_Driver
         array_unshift($values,
                       (int)$info['id'],
                       (int)$info['channel_id'],
+                      Horde_String::convertCharset($info['author'], 'UTF-8', $this->_params['charset']),
                       Horde_String::convertCharset($info['title'], 'UTF-8', $this->_params['charset']),
                       Horde_String::convertCharset($info['description'], 'UTF-8', $this->_params['charset']),
                       $info['body_type'],
diff --git a/jonah/lib/Form/Story.php b/jonah/lib/Form/Story.php
index f29a47968..33001db10 100644
--- a/jonah/lib/Form/Story.php
+++ b/jonah/lib/Form/Story.php
@@ -30,7 +30,7 @@ class Jonah_Form_Story extends Horde_Form
     {
         parent::Horde_Form($vars, $vars->get('id') ? _("Edit Story") : _("Add New Story"));
 
-        $this->setButtons(_("Save"), true);
+        $this->setButtons(_("Save"));
         $channel_id = $this->addHidden('', 'channel_id', 'int', false);
         $channel = $vars->get('channel_id');
         if ($channel) {
diff --git a/jonah/lib/View/StoryEdit.php b/jonah/lib/View/StoryEdit.php
index 1d089a831..b1cabad94 100644
--- a/jonah/lib/View/StoryEdit.php
+++ b/jonah/lib/View/StoryEdit.php
@@ -59,6 +59,7 @@ class Jonah_View_StoryEdit extends Jonah_View_Base
         $form = new Jonah_Form_Story($vars);
         if ($form->validate($vars)) {
             $form->getInfo($vars, $info);
+            $info['author'] = $registry->getAuth();
             try {
                 $result = $driver->saveStory($info);
                 $notification->push(sprintf(_("The story \"%s\" has been saved."), $info['title']), 'horde.success');
@@ -78,4 +79,4 @@ class Jonah_View_StoryEdit extends Jonah_View_Base
         require $registry->get('templates', 'horde') . '/common-footer.inc';
     }
 
-}
\ No newline at end of file
+}