Page 1 of 1

change default setting for new articles to "draft" instead of "public"

Posted: Wed Dec 14, 2016 9:54 am
by anika
Script URL: http://helpdesk.caratec.de
Version of script: ?
Hosting company: 1&1
URL of phpinfo.php: http://helpdesk.caratec.de/docs/phpinfo.php
URL of session_test.php: http://helpdesk.caratec.de/docs/session_test.php
What terms did you try when SEARCHING for a solution: Request Entity Too Large, exceeds size,

Write your message below:

Hi there,

is there any possibility to change the default setting for the type of new articles to "draft" instead of "public"?

Thank you for your support.

Kind regards

Anika

Re: change default setting for new articles to "draft" instead of "public"

Posted: Wed Dec 14, 2016 5:03 pm
by Klemen
In admin/manage_knowldgebase.php find this code (around line 295):

Code: Select all

	if (isset($_SESSION['new_article']))
    {
		$_SESSION['new_article'] = hesk_stripArray($_SESSION['new_article']);
    }
    elseif ( isset($_GET['type']) )
    {
		$_SESSION['new_article']['type'] = intval( hesk_GET('type') );
        if ($_SESSION['new_article']['type'] != 1 && $_SESSION['new_article']['type'] != 2)
        {
        	$_SESSION['new_article']['type'] = 0;
        }
    }
Just BELOW that add

Code: Select all

    if ( ! isset($_SESSION['new_article']['type']))
    {
        $_SESSION['new_article']['type'] = 2;
    }
That should do the trick.

Make sure:
#1 you backup any files before editing
#2 use a good text editor like the free Notepad++ to make sure files are saved correctly (Windows notepad will NOT save files in correct encoding!)

Re: change default setting for new articles to "draft" instead of "public"

Posted: Fri Dec 16, 2016 12:07 pm
by anika
Thank you very much. This was the solution for my problem!
Have a nice day!