⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 basic_config.php

📁 jsp程序开发系统
💻 PHP
📖 第 1 页 / 共 2 页
字号:
<?php
// +-------------------------------------------------------------+
// | DeskPRO v [2.0.1 Production]
// | Copyright (C) 2001 - 2004 Headstart Solutions Limited
// | Supplied by WTN-WDYL
// | Nullified by WTN-WDYL
// | Distribution via WebForum, ForumRU and associated file dumps
// +-------------------------------------------------------------+
// | DESKPRO IS NOT FREE SOFTWARE
// +-------------------------------------------------------------+
// | License ID : Full Enterprise License =) ...
// | License Owner : WTN-WDYL Team
// +-------------------------------------------------------------+
// | $RCSfile: basic_config.php,v $
// | $Date: 2004/02/13 00:04:40 $
// | $Revision: 1.20 $
// +-------------------------------------------------------------+
// | File Details:
// | - Basic Configuration
// +-------------------------------------------------------------+

error_reporting(E_ALL & ~E_NOTICE);

require_once('./global.php');
//Nullify WTN-WDYL Team
include "./settings_include.php";

########################################################################################

admin_header('Links', 'Basic Configuration');

// get config data
$config = unserialize(get_data('config'));

// submit, stored value, first option
if (!$_REQUEST['curconfig']) {
	if (is_array($config)) {
		$_REQUEST['curconfig'] = @max($config);
	} else {
		$_REQUEST['curconfig'] = 1;
	}
}

########################################################################################

// update any settings we have changed and update the page we are on
if ($_REQUEST['submit']) {

	// updates any non setting data
	update_config($_REQUEST['curconfig']);

	// add page to stored progress
	$config[] = $_REQUEST['curconfig'];
	$config = array_unique($config);

	update_data('config', serialize($config));

	// update settings
	update_settings();

	// get the settings again
	get_settings();

	// we now want to view the next page
	if (!$_REQUEST['smtp_override']) {
		$_REQUEST['curconfig']++;
	}
}

########################################################################################

// display the steps (current page, undone, done)
for ($i=1; $i < 9; $i++) {

	if (@in_array($i, $config)) {
		if ($i == $_REQUEST['curconfig']) {
			$bgcolor = "#64A0AA";
		} else {
			$bgcolor = "#347077";
		}
	} else {
		if ($i == $_REQUEST['curconfig']) {
			$bgcolor = "#BF4343";
		} else {
			$bgcolor = "#8F1313";
		}
	}
	
	$html .= "<td width=\"12%\" bgcolor=\"$bgcolor\"><a href=\"basic_config.php?basic_config=1&curconfig=$i\" class=\"stepCaptionPrev\">Step <strong>$i</strong></a></td>";
}

echo "<table width=\"100%\" border=\"0\" cellpadding=\"2\" cellspacing=\"2\"><tr align=\"center\"> " . $html . "</tr></table>";

// now show this steps page
show_config($_REQUEST['curconfig']);

################# FUNCTION update_config() ###################

function update_config($step) {
	
	global $_REQUEST, $db, $settings;

	############################### UPDATE CATS / PRIS ###############################

	if ($step == 7) {

		if ($_REQUEST['update_step']) {

			$categories = $db->query_return_array_id("SELECT id, name FROM ticket_cat", 'name');
			if (is_array($categories)) {
				foreach ($categories AS $key => $var) {
					if (!@in_array($key, $_REQUEST['category_list'])) {
						$cat_delete[] = $key;
					}
				}
			}

			$priorities = $db->query_return_array_id("SELECT id, name FROM ticket_pri", 'name');
			if (is_array($priorities)) {
				foreach ($priorities AS $key => $var) {
					if (!@in_array($key, $_REQUEST['priority_list'])) {
						$pri_delete[] = $key;
					}
				}
			}

			if (is_array($cat_delete)) {

				// delete langauage bits
				$category_languages = unserialize(get_data('category_languages'));
				foreach ($category_languages AS $key => $var) {
					foreach ($cat_delete AS $key2 => $var2) {
						unset($category_languages[$key][$key2]);
					}
				}
				update_data('category_languages', serialize($category_languages));
				$db->query("UPDATE ticket SET category = '0' WHERE category IN " . array2sql($cat_delete));
				$db->query("DELETE FROM ticket_cat WHERE id IN " . array2sql($cat_delete));
			}

			if (is_array($pri_delete)) {
				
				$db->query("UPDATE ticket SET priority = '0' WHERE priority IN " . array2sql($pri_delete));
				$db->query("DELETE FROM ticket_pri WHERE id IN " . array2sql($pri_delete));

				// delete langauage bits
				$priority_languages = unserialize(get_data('category_languages'));
				foreach ($priority_languages AS $key => $var) {
					foreach ($pri_delete AS $key2 => $var2) {
						unset($priority_languages[$key][$key2]);
					}
				}
				update_data('priority_languages', serialize($priority_languages));

			}
		}

		if (is_array($_REQUEST['category_list'])) {
			foreach ($_REQUEST['category_list'] AS $key => $var) {
				if (!in_array_keys($var, $categories)) {

					$db->query("
						INSERT INTO ticket_cat SET
						name = '" . addslashes($var) . "',
						user_view = 1,
						user_select = 1
					");
				
				}
			}
		}

		if (is_array($_REQUEST['priority_list'])) {
			foreach ($_REQUEST['priority_list'] AS $key => $var) {
				if (!in_array_keys($var, $priorities)) {

					$db->query("
						INSERT INTO ticket_pri SET
						name = '" . addslashes($var) . "',
						user_view = 1,
						user_select = 1
					");
				
				}
			}
		}
	}
}

################# FUNCTION show_config() ###################

function show_config($step) {
	
	global $_REQUEST, $db, $settings, $config;

	echo "<br /><form method=\"post\" action=\"basic_config.php\">";

	############################### FINISHED ###############################

	if ($step == 8 ) {

		$noform = 1;
		
		echo table_border("
		<b>STEP 8:</b> Congratulations! You have completed the basic configuration. You may need to complete a number of steps to make the email gateway work, you should read the installation documentation to review any further steps you need to take.<br /><br />
		At this point you may wish to do one of the following:
			<ul>
			<li>Edit the <a href=\"templates.php\">templates</a> to better integrate DeskPRO with your website</li>
			<li>Create <a href=\"tech.php?do=add\">technicians</a> to support your customers</li>
			<li>Create <a href=\"user_fields.php\">custom user</a> or <a href=\"ticket_fields.php\">ticket fields</a></li>
			<li>Modify your <a href=\"category.php\">category</a> or <a href=\"priority.php\">priority</a> options</li>
			<li>Review other <a href=\"settings.php\">settings</a> you can modify to find tune your DeskPRO installation</li>
			<li>Create new or modify further <a href=\"email.php\">options</a> and create <a href=\"email.php?do=view\">more accounts</a> for the email gateway or configure <a href=\"pop.php?do=view\">POP3 mail</a> collection</li>
			</ul>
		");

		echo "<br /><br />";

		if (count($config) == 6) {
			$submit_name = "Click here to mark Basic Config Completed";
		} elseif (count($config) == 7) {
			$noform = 1;
		}

	}

	############################### CATS / PRIS ###############################

	if ($step == 7) {

		echo table_border("
		<b>STEP 7:</b> This section allows you to quickly create some categories and priorities. There are a whole range of category and priority settings that you might want to edit after you have completed this configuration process.<br /><br />Note that any tickets you have already created that have a category or priority you remove will have their category or priority set as unspecified.
		");

		$categories = $db->query_return_array_id("SELECT id, name FROM ticket_cat", 'name');
		if (is_array($categories)) {
			foreach ($categories AS $key => $var) {
				$html_cat .= "<option value=\"$key\">$var</option>";
			}
		}

		$priorities = $db->query_return_array_id("SELECT id, name FROM ticket_pri", 'name');
		if (is_array($priorities)) {
			foreach ($priorities AS $key => $var) {
				$html_pri .= "<option value=\"$key\">$var</option>";

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -