Example #1
0
function drawTicketFilter()
{
    global $total, $default, $pageName, $_GET;
    $target = isset($_GET["id"]) ? $pageName . "?id=" . $_GET["id"] : $pageName . "?";
    return draw_javascript('
		function goToMonth(str) {
			if (str == "") {
				location.href=\'' . $target . '\';
			} else {
				arr = str.split("/");
				location.href=\'' . $target . '&month=\' + arr[0] + \'&year=\' + arr[1];
			}
			return true;
		}
	') . draw_div_class('message', 'Filter by month: ' . draw_form_select_month("month", $total["month"] . "/" . $total["year"], $default, false, "sleek", "goToMonth(this.value)", true));
    return $return;
}
Example #2
0
function drawTop($headcontent = false)
{
    global $_josh, $page, $user;
    ob_start('browser_output');
    error_debug('starting top', __FILE__, __LINE__);
    if ($_josh['db']['language'] == 'mysql') {
        url_header_utf8();
    }
    if (empty($page['helptext'])) {
        $page['helptext'] = getString('help_empty');
    }
    $return = draw_doctype() . draw_container('head', ($_josh['db']['language'] == 'mysql' ? draw_meta_utf8() : '') . draw_container('title', $page['title']) . draw_favicon(DIRECTORY_WRITE . '/favicon.png') . draw_css_src('/css/global.css', 'screen') . draw_css_src('/css/print.css', 'print') . draw_css_src('/css/ie.css', 'ie') . draw_css_src(DIRECTORY_WRITE . '/screen.css', 'screen') . lib_get('jquery') . draw_javascript_src() . draw_javascript_src('/js/global.js') . draw_css('
				#left table.left td.head, #left div.display div.title { background-color:#' . $page['color'] . '; }
				#left table.table th.table_title, #left form fieldset legend span, #left table.navigation { background-color:#' . $page['color'] . '; }
				#left table.navigation tr, #left form fieldset div.admin, #left table td.hilite { background-color:#' . $page['hilite'] . '; }
			') . draw_javascript('
			function confirmDelete(id) {
				if (confirm("' . getString('are_you_sure') . '")) {
					var newloc = "' . url_query_add(array('action' => 'delete', 'delete_id' => 'replaceme'), false) . '";
					location.href = newloc.replace("replaceme", id);
				}
			}
			function changeDept(id, user_id) {
				location.href="' . $_josh['request']['path_query'] . '&newDeptID=" + id + "&contactID=" + user_id;
			}
			') . drawSyndicateLink('bb') . $headcontent);
    $return .= draw_body_open() . '
		<div id="container">
			' . draw_div('banner', draw_img(DIRECTORY_WRITE . '/banner' . langExt() . '.png', $_SESSION['homepage'])) . '
			<div id="left">
				<div id="help">
					<div id="help_buttons">' . draw_link($_SESSION['homepage'], getString('home'), false, 'left') . draw_link('javascript:helpShow(' . user() . ')', getString('help_show'), false, array('class' => 'right' . ($user['help'] ? ' hidden' : false), 'id' => 'show_help_btn')) . draw_link('javascript:helpHide(' . user() . ')', getString('help_hide'), false, array('class' => 'right' . (!$user['help'] ? ' hidden' : false), 'id' => 'hide_help_btn'));
    if ($_SESSION['is_admin']) {
        if ($page['id']) {
            $return .= draw_link('/a/admin/page.php?id=' . $page['id'], getString('page_edit_info'), false, 'right');
        } else {
            $return .= draw_link('/a/admin/page.php?module_id=' . $page['module_id'] . '&modulette_id=' . $page['modulette_id'] . '&url=' . urlencode($_josh['request']['page']), 'Create Page Here', false, 'right');
        }
    }
    $return .= '</div><div id="help_text"';
    if (!$user['help']) {
        $return .= ' class="hidden"';
    }
    $return .= '>' . $page['helptext'] . '</div></div>';
    if ($_josh['request']['folder'] == 'helpdesk') {
        $return .= drawNavigationHelpdesk();
    }
    $return .= drawNavigation();
    $_josh['drawn']['top'] = true;
    error_debug('finished drawing top', __FILE__, __LINE__);
    return $return;
}
Example #3
0
<?php

include "include.php";
if ($posting) {
    db_query('DELETE FROM it_system_status');
    db_query('INSERT INTO it_system_status ( message, updated_date, updated_user ) VALUES ("' . format_html($_POST['helpdesk_status']) . '", GETDATE(),' . user() . ')');
    url_change('./');
}
echo drawTop();
echo lib_get('tinymce');
echo draw_javascript_src('/_intranet.seedco.site/lib/tinymce/tinymce_3_3_8/tiny_mce.js');
echo draw_javascript('form_tinymce_init("/css/tinymce-helpdesk-status.css", true);');
?>
<table class="left" cellspacing="1">
	<form action="<?php 
echo $request["path_query"];
?>
" method="post">
	<?php 
echo drawHeaderRow("Update Status Message");
?>
	<tr>
		<td><?php 
echo draw_form_textarea("helpdesk_status", $helpdeskStatus, "tinymce", false);
?>
</td>
	</tr>
	<tr>
		<td class="bottom"><?php 
echo draw_form_submit("update message");
?>
Example #4
0
    function draw($pageTitle)
    {
        global $rows, $_josh, $js;
        if ($js) {
            echo draw_javascript("function validate(form) {\n\t\t\t\tvar errors = new Array();\n\t\t\t\t" . $js . "\n\t\t\t\treturn form_errors(errors);\n\t\t\t}");
        }
        ?>
		<a name="bottom"></a>
		<table class="left" cellspacing="1">
			<tr>
				<td class="head" colspan="2"><?php 
        echo $pageTitle;
        ?>
</td>
			</tr>
			<form method="post" action="<?php 
        echo $_josh["request"]["path_query"];
        ?>
" enctype="multipart/form-data" accept-charset="utf-8" onsubmit="javascript:return validate(this);">
			<?php 
        if (isset($_josh["referrer"])) {
            echo draw_form_hidden("return_to", $_josh["referrer"]["url"]);
        }
        echo $rows;
        ?>
			</form>
		</table>
		<?php 
    }
Example #5
0
						u.lastname, 
						t.title' . langExt($l['code']) . ' title, 
						t.description' . langExt($l['code']) . ' description, 
						y.title' . langExt($l['code']) . ' type,
						t.created_date
					FROM bb_topics t
					LEFT JOIN bb_topics_types y ON t.type_id = y.id
					JOIN users u ON t.created_user = u.id
					WHERE t.id = ' . $id);
            $channels_text = db_array('SELECT title' . langExt($l['code']) . ' FROM channels WHERE id IN (' . implode(',', $channels) . ')');
            $channels_text = implode(', ', $channels_text);
            $message = '<p style="font-weight:bold;">' . $topic['firstname'] . ' ' . $topic['lastname'] . ' ' . getString('bb_notify', $l['code']) . '</p>
				<p>' . getString('title', $l['code']) . ': ' . draw_link(url_base() . '/bb/topic.php?id=' . $id, $topic['title']) . '</p>
				<p>' . getString('channels_label', $l['code']) . ': ' . $channels_text . '</p>';
            if ($topic['type']) {
                $message .= '<p>' . getString('category', $l['code']) . ': ' . $topic['type'] . '</p>';
            }
            $message .= '<div style="color:#555; border-top:1px dotted #555; padding-top:5px; margin-top:5px;">' . $topic['description'] . '</div>';
            emailUser($addresses, $topic['title'], $message);
        }
    }
    bbDrawRss();
    url_change();
}
echo drawTop(drawSyndicateLink('bb'));
echo draw_div('bb_topics', bbDrawTable(15));
echo draw_javascript('function_attach(setInterval(refreshBB, 60000));');
//add new topic
echo '<a name="bottom"></a>';
echo drawTopicForm();
echo drawBottom();
Example #6
0
function draw_navigation($options, $match = false, $type = "text", $class = "navigation")
{
    //type could be text, images or rollovers
    global $_josh;
    //debug();
    $return = $_josh["newline"] . $_josh["newline"] . "<!--start nav-->" . $_josh["newline"] . "<ul class='" . $class . "'>";
    if ($match === false) {
        $match = $_josh["request"]["path"];
    } elseif ($match === true) {
        $match = $_josh["request"]["path_query"];
    } elseif ($match == "//") {
        //to take care of a common / . folder . / scenario
        $match = "/";
    }
    error_debug("<b>draw_navigation</b> match is " . $match);
    $counter = 1;
    $javascript = $_josh["newline"];
    foreach ($options as $title => $url) {
        $name = 'option' . $counter;
        $return .= $_josh["newline"] . '<li><a href="' . $url . '" class="' . $name;
        if (str_replace(url_base(), "", $url) == $match) {
            $img_state = "_on";
            $return .= ' selected';
        } else {
            $img_state = "_off";
            if ($type == "rollovers") {
                $return .= '" onmouseover="javascript:roll(\'' . $name . '\',\'on\');" onmouseout="javascript:roll(\'' . $name . '\',\'off\');';
            }
        }
        $return .= '">';
        if ($type == "text") {
            $return .= $title;
        } elseif ($type == "images" || $type == "rollovers") {
            $img = str_replace("/", "", $url);
            if (empty($img)) {
                $img = "home";
            }
            $img = "/images/navigation/" . $img;
            if ($type == "rollovers") {
                $javascript .= $name . "_on\t\t = new Image;" . $_josh["newline"];
                $javascript .= $name . "_off\t = new Image;" . $_josh["newline"];
                $javascript .= $name . "_on.src\t = '" . $img . "_on.png';" . $_josh["newline"];
                $javascript .= $name . "_off.src = '" . $img . "_off.png';" . $_josh["newline"];
            }
            $img .= $img_state . ".png";
            $return .= draw_img($img, false, false, $name);
        }
        $return .= '</a></li>';
        $counter++;
    }
    $return .= $_josh["newline"] . "</ul>";
    if ($type == "rollovers") {
        $return = draw_javascript('if (document.images) {' . $javascript . '}
		function roll(what, how) { eval("document." + what + ".src = " + what + "_" + how + ".src;"); }') . $return;
    }
    return $return;
}
Example #7
0
include "../../include.php";
if ($posting) {
    if ($uploading) {
        list($_POST["type_id"], $_POST["content"]) = file_get_uploaded("userfile", "docs_types");
    }
    $id = db_save("policy_docs");
    url_change("../?category=" . $_POST["categoryID"]);
}
echo drawTop();
$types = db_query("SELECT description, extension FROM docs_types ORDER BY description");
$extensions = $doctypes = $array = array();
while ($t = db_fetch($types)) {
    $extensions[] = '(extension != "' . $t["extension"] . '")';
    $doctypes[] = " - " . $t["description"] . " (." . $t["extension"] . ")";
    $array[] = "'" . $t["extension"] . "'";
}
$array = implode(",", $array);
echo draw_javascript("\n\tfunction suggestName(which) {\n\t\t//var types = new Array(" . $array . ");\n\t\tvar fileParts   = which.value.split('.');\n\t\tvar extension\t= fileParts.pop();\n\t\tvar filename\t= fileParts.join(' ');\n\n\t\tif (!url_id()) which.form.name.value = format_title(filename);\n\t}\n\t\n\tfunction validate() {\n\t\treturn true;\n\t}\n");
$form = new intranet_form();
//function addRow($type, $title, $name="", $value="", $default="", $required=false, $maxlength=50, $onchange=false) {
$form->addRow("file", "Document", "userfile", "", "", true, false, "suggestName(this);");
$form->addRow("itext", "Name", "name", @$r["name"], "", true, 50);
$form->addRow("select", "Category", "categoryID", "SELECT id, description FROM policy_categories ORDER BY description", @$r["categoryID"], true);
$form->addRow("submit", "Save Changes");
if (isset($_GET["id"])) {
    $form->draw("<a href='/policy/?category=1'>Policy</a> > Edit Policy Document");
} else {
    $form->draw("<a href='/policy/?category=1'>Policy</a> > Add New Policy Document");
}
echo drawBottom();