예제 #1
0
function drawEventForm()
{
    global $page;
    $f = new form('cal_events', @$_GET['id'], $page['title']);
    if (url_id()) {
        $f->set_title_prefix(drawHeader(false, ' '));
    }
    if ($page['is_admin']) {
        $f->set_field(array('name' => 'created_user', 'class' => 'admin', 'type' => 'select', 'sql' => 'SELECT id, CONCAT_WS(", ", lastname, firstname) FROM users WHERE is_active = 1 ORDER BY lastname, firstname', 'default' => $_SESSION['user_id'], 'required' => true, 'label' => getString('posted_by')));
    }
    $f->set_field(array('name' => 'title' . langExt(), 'label' => getString('title'), 'type' => 'text'));
    $f->set_field(array('name' => 'start_date', 'label' => getString('start_date'), 'type' => 'datetime', 'required' => true));
    $f->set_field(array('name' => 'end_date', 'label' => getString('end_date'), 'type' => 'datetime', 'required' => true));
    $f->set_field(array('name' => 'type_id', 'type' => 'select', 'sql' => 'SELECT id, description' . langExt() . ' FROM cal_events_types ORDER BY description', 'label' => getString('category'), 'required' => 'true'));
    $f->set_field(array('name' => 'description' . langExt(), 'label' => getString('description'), 'type' => 'textarea', 'class' => 'tinymce'));
    langUnsetFields($f, 'title,description');
    formAddChannels($f, 'cal_events', 'event_id');
    $f->set_order('created_user,title, start_date, end_date, type_id, description, channels');
    langTranslateCheckbox($f, url_id());
    return $f->draw(false, false);
}
예제 #2
0
<?php

include "../../include.php";
if ($posting) {
    langTranslatePost('title');
    $id = db_save('organizations');
    url_drop('id');
} elseif (url_action('delete') && url_id('delete_id')) {
    db_delete('organizations', $_GET['delete_id']);
    url_drop('delete_id,action');
}
echo drawTop();
if (url_id()) {
    //form
    $f = new form('organizations', @$_GET['id']);
    $f->set_field(array('type' => 'text', 'name' => 'title' . langExt(), 'label' => getString('title')));
    langUnsetFields($f, 'title');
    langTranslateCheckbox($f);
    echo $f->draw();
} else {
    //modules list
    $t = new table('organizations', drawHeader());
    $t->set_column('draggy', 'd', '&nbsp;');
    $t->set_column('title', 'l', getString('title'));
    $t->set_column('delete', 'd', '&nbsp;');
    $result = db_table('SELECT id, title' . langExt() . ' title FROM organizations WHERE is_active = 1 ORDER BY precedence');
    foreach ($result as &$r) {
        $r['draggy'] = draw_img('/images/icons/move.png');
        $r['title'] = draw_link('organizations.php?id=' . $r['id'], $r['title']);
        $r['delete'] = drawColumnDelete($r['id']);
    }
예제 #3
0
파일: edit.php 프로젝트: Rhenan/intranet-1
            //$r["title"] = str_replace("The Associated Press: ", "", $r["title"]);
        } elseif ($url["domainname"] == "google" && $url["subfolder"] == "afp") {
            $r["publication"] = "AFP";
            $r["title"] = str_replace("Afp: ", "", $r["title"]);
        } elseif ($url["domainname"] == "google" && $url["subfolder"] == "ap") {
            $r["publication"] = "AP";
            $r["title"] = str_replace("The Associated Press: ", "", $r["title"]);
        }
    }
}
//to control return_to redirects.  i'm not sure how i should handle this generally.  it's a problem mainly when the page is included
if ($referrer && $referrer["host"] == $request["host"]) {
    $_josh["referrer"] = false;
}
$f = new form('press_clips', @$_GET['id'], $action);
if (!$included) {
    $f->set_title_prefix($page['breadcrumbs']);
}
$f->set_field(array('name' => 'title' . langExt(), 'type' => 'text', 'label' => getString('title')));
$f->set_field(array('name' => 'url', 'type' => 'text', 'label' => getString('url')));
$f->set_field(array('name' => 'publication' . langExtT(), 'type' => 'text', 'label' => getString('publication')));
$f->set_field(array('name' => 'pub_date', 'type' => 'date', 'label' => getString('published'), 'required' => true));
$f->set_field(array('name' => 'description' . langExt(), 'type' => 'textarea', 'label' => getString('description'), 'class' => 'tinymce'));
$f->set_field(array('name' => 'type_id', 'label' => getString('category'), 'type' => 'select', 'sql' => 'SELECT id, title' . langExt() . ' title FROM press_clips_types ORDER BY precedence', 'required' => true));
formAddChannels($f, 'press_clips', 'clip_id');
langUnsetFields($f, 'title,description,publication');
langTranslateCheckbox($f, url_id());
echo $f->draw(@$r, !$included);
if (!$included) {
    echo drawBottom();
}
예제 #4
0
파일: index.php 프로젝트: Rhenan/intranet-1
		var field = document.getElementById("type_id").options;
		field.length = 0;
		field[i] = new Option("", "");
		for (var i = 0; i < types[departmentID].length; i++) {
			var value = types[departmentID][i].split("|");
			field[i + 1] = new Option(value[1], value[0]);
		}
		return true;
	}
	//-->
</script>


	<?php 
echo drawTableStart();
if (url_id("dept")) {
    $department = " AND t.departmentID = " . $_GET["dept"];
    $deptName = db_grab("SELECT shortName FROM departments WHERE departmentID = " . $_GET["dept"]);
} else {
    $department = "";
    $deptName = "";
}
$result = db_query("SELECT\r\n\t\t\t\t\t\tt.title,\r\n\t\t\t\t\t\ts.description,\r\n\t\t\t\t\t\tt.departmentID,\r\n\t\t\t\t\t\td.shortName department,\r\n\t\t\t\t\t\tt.created_date,\r\n\t\t\t\t\t\tt.created_user,\r\n\t\t\t\t\t\tt.id,\r\n\t\t\t\t\t\tISNULL(u2.nickname, u2.firstname) owner,\r\n\t\t\t\t\t\tISNULL(u.nickname, u.firstname) firstname,\r\n\t\t\t\t\t\tu.lastname lastname\r\n\t\t\t\t\tFROM helpdesk_tickets t\r\n\t\t\t\t\tJOIN helpdesk_tickets_statuses\ts  ON t.statusID = s.id\r\n\t\t\t\t\tJOIN users\t\t\t\tu  ON t.created_user = u.id\r\n\t\t\t\t\tJOIN departments\t\td  ON t.departmentID = d.departmentID\r\n\t\t\t\t\tLEFT JOIN users\t\tu2 ON t.ownerID = u2.id\r\n\t\t\t\t\tWHERE (t.statusID <> 9 OR t.statusID IS NULL) {$department}\r\n\t\t\t\t\tORDER BY d.shortName, t.created_date DESC");
$lastDept = "";
$count = db_found($result);
if ($count) {
    echo drawHeaderRow($deptName . " Open Tickets", 4, "new", "#bottom");
    ?>
	<tr>
		<th width="50%" align="left">Short Description</th>
		<th width="15%" align="left"><nobr>Submitted By</nobr></th>
예제 #5
0
파일: pages.php 프로젝트: Rhenan/intranet-1
<?php

include "../../include.php";
if (url_id('module_id')) {
    $result = db_table('SELECT p.id, p.title, p.url, p.is_hidden FROM pages p WHERE module_id = ' . $_GET['module_id'] . ' ORDER BY p.precedence');
} elseif (url_id('modulette_id')) {
    $result = db_table('SELECT p.id, p.title, p.url, p.is_hidden FROM pages p WHERE modulette_id = ' . $_GET['modulette_id'] . ' ORDER BY p.precedence');
} else {
    url_change('./');
}
echo drawTop();
//pages list
$t = new table('pages', drawHeader());
$t->set_column('is_hidden', 'd', '&nbsp;');
$t->set_column('draggy', 'd', '&nbsp;');
$t->set_column('title', 'l', getString('title'));
$t->set_column('url');
$t->set_draggable('draggy');
foreach ($result as &$r) {
    $r['is_hidden'] = draw_form_checkbox('foo', !$r['is_hidden'], false, 'ajax_set(\'pages\', \'is_hidden\', ' . $r['id'] . ', ' . abs($r['is_hidden'] - 1) . ');');
    $r['draggy'] = draw_img('/images/icons/move.png');
    $r['title'] = draw_link('page.php?id=' . $r['id'], $r['title']);
    if (empty($r['url'])) {
        $r['url'] = 'index.php';
    }
}
echo $t->draw($result, 'No pages');
echo drawBottom();
예제 #6
0
    url_chagne('skills.php');
}
echo drawTop();
echo drawTableStart();
if ($isAdmin) {
    echo drawHeaderRow($skill, 1, 'Edit', 'skill_add_edit.php?id=' . url_id());
} else {
    echo drawHeaderRow($skill, 1);
}
if ($users = db_table('SELECT 
		u.userID, 
		u.firstName,
		u.lastName 
	FROM users_to_skills u2s 
	JOIN intranet_users u ON u2s.user_id = u.userID
	WHERE u2s.skill_id = ' . url_id() . ' AND u.isActive = 1
	ORDER BY u.lastName, u.firstName')) {
    ?>
	<tr>
		<th>User</th>
	</tr>
	<?php 
    foreach ($users as $u) {
        echo '<tr>
			<td><a href="view.php?id=' . $u['userID'] . '">' . $u['firstName'] . ' ' . $u['lastName'] . '</a></td>
		</tr>';
    }
} else {
    echo drawEmptyResult('No users are tagged with this skill.');
}
echo drawTableEnd();
예제 #7
0
파일: url.php 프로젝트: joshreisner/hcfa-cc
function url_query_require($target = "./", $index = "id")
{
    //requires a _GET variable to be defined or eject page
    if (!url_id($index)) {
        url_change($target);
    }
}
예제 #8
0
파일: index.php 프로젝트: Rhenan/intranet-1
<?php

include "../../include.php";
if (url_id() && url_action('delete')) {
    db_delete('web_news_blurbs', $_GET['delete_id']);
    url_drop('action,delete_id');
}
echo drawTop();
$blurbs = db_table("SELECT b.id, b.title, b.publish_date FROM web_news_blurbs b WHERE b.is_active = 1 ORDER BY b.publish_date DESC");
$t = new table("web_news_blurbs");
$t->set_column("title");
$t->set_column("publish_date", "r");
$t->set_column('delete', 'c', '&nbsp;');
$t->set_title(drawHeader(array("add new" => "edit/")));
foreach ($blurbs as &$b) {
    $b["title"] = draw_link("edit/?id=" . $b["id"], $b["title"]);
    $b["publish_date"] = format_date($b["publish_date"]);
    $b['delete'] = draw_img('/images/icons/delete.gif', url_query_add(array('action' => 'delete', 'id' => $b['id']), false));
}
echo $t->draw($blurbs);
echo drawBottom();
예제 #9
0
<?php

include 'include.php';
if (!url_id()) {
    url_query_add(array('id' => 1));
}
drawTop();
$locations = db_query("SELECT \n\t\to.id, \n\t\to.name\n\tFROM intranet_offices o \n\tORDER BY (SELECT COUNT(*) FROM intranet_users u WHERE u.officeID = o.id) DESC");
if (db_found($locations)) {
    $pages = array();
    while ($l = db_fetch($locations)) {
        $pages["/staff/locations.php?id=" . $l["id"]] = $l["name"];
    }
    echo drawNavigationRow($pages, $location, true);
}
if ($_GET["id"] == "other") {
    echo drawStaffList("u.isactive = 1 AND u.officeID <> 1 AND u.officeID <> 6 AND u.officeID <> 11 AND u.officeID <> 9");
} else {
    $l = db_grab('SELECT name, address FROM intranet_offices WHERE id = ' . $_GET['id']);
    if (!empty($l['address'])) {
        echo drawServerMessage('<center><strong>' . $l['name'] . ' Office</strong><br>' . nl2br($l['address']) . '</center>');
    }
    echo drawStaffList("u.isactive = 1 and u.officeID = " . $_GET["id"]);
}
drawBottom();
예제 #10
0
}
echo drawSimpleTop(getString('login_account_request'));
echo drawMessage(getString('login_account_request_msg'));
$f = new form('users_requests', false, getString('login_account_request'));
$f->set_field(array('type' => 'select', 'sql' => 'SELECT id, title' . langExt() . ' title FROM organizations WHERE is_active = 1 ORDER BY precedence', 'name' => 'organization_id', 'label' => getString('organization'), 'required' => true, 'null_value' => getString('please_select')));
$f->set_field(array('type' => 'text', 'name' => 'firstname', 'label' => getString('name_first')));
$f->set_field(array('type' => 'text', 'name' => 'nickname', 'label' => getString('nickname')));
$f->set_field(array('type' => 'text', 'name' => 'lastname', 'label' => getString('name_last')));
$f->set_field(array('type' => 'text', 'name' => 'title', 'label' => getString('staff_title')));
$f->set_field(array('type' => 'text', 'name' => 'phone', 'label' => getString('telephone')));
$f->set_field(array('type' => 'text', 'name' => 'email', 'label' => getString('email')));
if (getOption('staff_showoffice')) {
    $f->set_field(array('type' => 'select', 'name' => 'officeID', 'label' => getString('location'), 'sql' => 'SELECT id, name FROM offices ORDER BY precedence', 'required' => true));
} else {
    $f->unset_fields('officeID');
}
if (getOption('staff_showdept')) {
    $f->set_field(array('type' => 'select', 'name' => 'departmentID', 'label' => getString('department'), 'sql' => 'SELECT departmentID, departmentName FROM departments WHERE is_active = 1 ORDER BY precedence'));
} else {
    $f->unset_fields('departmentID');
}
if (getOption('channels') && url_id() == user()) {
    $f->set_group(getString('email_prefs'));
    $f->set_field(array('name' => 'email_prefs', 'option_title' => 'title' . langExt(), 'type' => 'checkboxes', 'label' => getString('email_prefs_label'), 'options_table' => 'channels', 'linking_table' => 'users_to_channels_prefs', 'object_id' => 'user_id', 'option_id' => 'channel_id', 'default' => 'all'));
}
if (getOption('legal')) {
    $f->set_field(array('type' => 'checkbox', 'name' => 'legal', 'label' => getString('legal_checkbox')));
}
$f->set_field(array('type' => 'textarea', 'name' => 'bio', 'label' => getString('bio'), 'class' => 'tinymce'));
echo $f->draw();
echo drawSimpleBottom();
예제 #11
0
<?php

include '../include.php';
echo drawBBPosts(url_id('count'));
예제 #12
0
파일: index.php 프로젝트: Rhenan/intranet-1
<?php

include "../../include.php";
//download
if (url_action("delete")) {
    db_query("UPDATE policy_docs SET is_active = 0, deleted_date = GETDATE(), deleted_user = {$_SESSION["user_id"]} WHERE id = " . $_GET["id"]);
    url_drop("id, action");
} elseif (url_id()) {
    $d = db_grab("SELECT d.name, t.extension, d.content FROM policy_docs d JOIN docs_types t ON d.type_id = t.id WHERE d.id = " . $_GET["id"]);
    //db_query("INSERT INTO docs_views ( documentID, user_id, viewedOn ) VALUES ( {$_GET["id"]}, {$_SESSION["user_id"]}, GETDATE() )");
    file_download($d["content"], $d["name"], $d["extension"]);
}
//get nav options
$options = array();
$categories = db_query("SELECT id, description FROM policy_categories ORDER BY description");
while ($c = db_fetch($categories)) {
    if (!isset($_GET["category"])) {
        url_query_add(array("category" => $c["id"]));
    }
    $options[str_replace(url_base(), "", url_query_add(array("category" => $c["id"]), false))] = $c["description"];
}
echo drawTop();
echo drawNavigationRow($options, "areas", true);
?>
<table class="left">
	<?php 
if ($page['is_admin']) {
    echo drawheaderRow("", 4, "add", "edit/");
} else {
    echo drawheaderRow("", 3);
}
예제 #13
0
<?php

include 'include.php';
if ($posting) {
    $id = db_enter('skills', 'title group');
    if ($editing) {
        url_change('skill.php?id=' . url_id());
    } else {
        url_change('skills.php');
    }
}
echo drawTop();
if ($editing) {
    $r = db_grab('SELECT title, `group` FROM skills WHERE id = ' . $_GET['id']);
}
$form = new intranet_form();
$form->addRow('itext', 'Title', 'title', @$r['title'], '', true, 50);
$form->addRow('itext', 'Group', 'group', @$r['group'], '', true, 50);
$form->addRow('submit', $editing ? 'Save Changes' : 'Add Skill');
echo $form->draw('<a href="./">Staff</a> &gt; <a href="skills.php">Skills</a> &gt; ' . ($editing ? 'Edit Skill' : 'Add Skill'));
echo drawBottom();
예제 #14
0
function drawTopicForm()
{
    global $page;
    $f = new form('bb_topics', @$_GET['id'], getString('topic_new'));
    if ($page['is_admin']) {
        $f->set_field(array('name' => 'created_user', 'class' => 'admin', 'type' => 'select', 'sql' => 'SELECT id, CONCAT_WS(", ", lastname, firstname) FROM users WHERE is_active = 1 ORDER BY lastname, firstname', 'default' => user(), 'required' => true, 'label' => getString('posted_by')));
    }
    if ($page['is_admin'] && !getOption('bb_notifypost')) {
        $f->set_field(array('name' => 'is_admin', 'class' => 'admin', 'type' => 'checkbox', 'label' => getString('is_admin')));
    } else {
        $f->unset_fields('is_admin');
    }
    $f->set_field(array('name' => 'title' . langExt(), 'type' => 'text', 'label' => getString('title')));
    if (getOption('bb_types')) {
        $f->set_field(array('name' => 'type_id', 'type' => 'select', 'sql' => 'SELECT id, title' . langExt() . ' title FROM bb_topics_types', 'label' => getString('category')));
    }
    formAddChannels($f, 'bb_topics', 'topic_id');
    $f->set_field(array('name' => 'description' . langExt(), 'type' => 'textarea', 'label' => getString('description'), 'class' => 'tinymce'));
    $f->set_order('created_user,is_admin,title' . langExt() . ',type_id,channels,description' . langExt());
    $f->unset_fields('thread_date,type_id,replies');
    langUnsetFields($f, 'title,description');
    langTranslateCheckbox($f, url_id());
    return $f->draw(false, false);
}