<?php

if (!defined('DP_BASE_DIR')) {
    die('You should not access this file directly.');
}
$AppUI->savePlace();
require_once $AppUI->getSystemClass('CustomFields');
$titleBlock = new CTitleBlock('Custom field editor', 'customfields.png', 'admin', 'admin.custom_field_editor');
$titleBlock->addCrumb('?m=system', 'system admin');
$edit_field_id = dpGetParam($_POST, 'field_id', NULL);
$titleBlock->show();
$sql = 'SELECT * FROM modules' . ' ORDER BY mod_ui_order';
$q = new DBQuery();
$q->addTable('modules');
$q->addWhere('mod_name IN (\'Companies\', \'Projects\', \'Tasks\', \'Calendar\')');
$modules = $q->loadList();
echo '<table cellpadding="2" summary="module list">';
foreach ($modules as $module) {
    echo '<tr><td colspan="4">';
    echo '<h3>' . $AppUI->_($module['mod_name']) . '</h3>';
    echo '</td></tr>';
    echo '<tr><td colspan="4">';
    echo '<a href="?m=system&amp;a=custom_field_addedit&amp;module=' . $module['mod_name'] . '"><img src="./images/icons/stock_new.png" align="center" width="16" height="16" border="0" alt="" />' . $AppUI->_('Add a new Custom Field to this Module') . '</a><br /><br />';
    echo '</td></tr>';
    $q->clear();
    $q->addTable('custom_fields_struct');
    $q->addWhere('field_module = \'' . mb_strtolower($module['mod_name']) . "'");
    $custom_fields = $q->loadList();
    foreach ($custom_fields as $f) {
        echo '<tr><td class="hilite">';
        echo '<a href="?m=system&amp;a=custom_field_addedit&amp;module=' . $module['mod_name'] . '&amp;field_id=' . $f['field_id'] . '"><img src="./images/icons/stock_edit-16.png" align="center" width="16" height="16" border="0" alt="" />Edit</a>';
<?php

/* PUBLIC $Id: calendar.php,v 1.7 2006/04/10 15:34:24 Attest sw-libre@attest.es Exp $ */
/* PUBLIC $Id: calendar.php,v 1.6 2005/04/03 19:33:48 gregorerhardt Exp $ */
require_once "{$baseDir}/classes/ui.class.php";
require_once "{$baseDir}/modules/calendar/calendar.class.php";
$callback = isset($_GET['callback']) ? $_GET['callback'] : 0;
$date = dpGetParam($_GET, 'date', null);
$prev_date = dpGetParam($_GET, 'uts', null);
// if $date is empty, set to null
$date = $date !== '' ? $date : null;
$this_month = new CDate($date);
$uistyle = $AppUI->getPref('UISTYLE') ? $AppUI->getPref('UISTYLE') : $dPconfig['host_style'];
?>
<a href="javascript: void(0);" onClick="clickDay('', '');">borrar fecha</a>
<?php 
$cal = new CMonthCalendar($this_month);
$cal->setStyles('poptitle', 'popcal');
$cal->showWeek = false;
$cal->callback = $callback;
$cal->setLinkFunctions('clickDay');
if (isset($prev_date)) {
    $highlights = array($prev_date => "#FF8888");
    $cal->setHighlightedDays($highlights);
    $cal->showHighlightedDays = true;
}
echo $cal->show();
?>
<script language="javascript">
/**
 *	@param string Input date in the format YYYYMMDD
示例#3
0
<?php

if (!defined('DP_BASE_DIR')) {
    die('You should not access this file directly.');
}
//update task
$newparent = dpGetParam($_GET, 'newparent', 0);
$ticket = dpgetparam($_GET, 'ticket', 0);
$sql1 = "update tickets set parent = {$newparent},\n  assignment = 9999,\n  type = 'Client Followup'\n  where ticket = {$ticket}";
header("Location: index.php?m=ticketsmith");
if (isset($newparent) && isset($ticket) && $newparent != 0 && $ticket != 0) {
    // error_log("Updating ticket - $sql1");
    mysql_query($sql1);
    // error_log( mysql_error());
    $sql2 = "update tickets set activity = '" . time() . "' where ticket = {$newparent}";
    // error_log($sql2);
    mysql_query($sql2);
    // error_log($mysql_error());
}
// else error_log( "Ticket has not been reassigned");
示例#4
0
            $select_options = new CustomOptionList($field_id);
            $select_options->load();
            $select_items = $select_options->getOptions();
        }
    } else {
        $AppUI->setMsg('Couldnt load the Custom Field,<br/>It might have been deleted somehow.', UI_MSG_ERROR);
        echo $AppUI->getMsg();
        exit;
    }
    $edit_title = $AppUI->_('Edit Custom Field In');
} else {
    $edit_title = $AppUI->_('New Custom Field In');
    $field_name = dpGetParam($_POST, 'field_name', NULL);
    $field_description = dpGetParam($_POST, 'field_description', NULL);
    $field_htmltype = dpGetParam($_POST, 'field_htmltype', 'textinput');
    $field_extratags = dpGetParam($_POST, 'field_extratags', NULL);
}
$html_types = array('textinput' => $AppUI->_('Text Input'), 'textarea' => $AppUI->_('Text Area'), 'checkbox' => $AppUI->_('Checkbox'), 'select' => $AppUI->_('Select List'), 'label' => $AppUI->_('Label'), 'separator' => $AppUI->_('Separator'), 'href' => $AppUI->_('Weblink'));
?>
<form method="POST" action="?m=system&a=custom_field_editor" name="custform" />
<table border="0" cellspacing="0" cellpadding="4">
<th colspan="4" align="center" bgcolor="#E0E0E0">
	<?php 
echo $edit_title;
?>
 <?php 
echo $AppUI->_($module);
?>
 <?php 
echo $AppUI->_('Module');
?>
示例#5
0
<?php

/* $Id: viewer.php 5629 2008-02-29 16:26:48Z TheIdeaMan $ */
if (!defined('DP_BASE_DIR')) {
    die('You should not access this file directly.');
}
//view posts
$forum_id = isset($_GET["forum_id"]) ? (int) $_GET["forum_id"] : 0;
$message_id = isset($_GET["message_id"]) ? (int) $_GET["message_id"] : 0;
$post_message = isset($_GET["post_message"]) ? $_GET["post_message"] : 0;
$f = dpGetParam($_POST, 'f', 0);
// check permissions
$canRead = getPermission($m, 'view', $forum_id);
$canEdit = getPermission($m, 'edit', $forum_id);
if (!$canRead || $post_message & !$canEdit) {
    $AppUI->redirect("m=public&a=access_denied");
}
$df = $AppUI->getPref('SHDATEFORMAT');
$tf = $AppUI->getPref('TIMEFORMAT');
$q = new DBQuery();
$q->addTable('forums');
$q->addTable('projects', 'p');
$q->addTable('users', 'u');
$q->addQuery('forum_id, forum_project,	forum_description, forum_owner, forum_name,
	forum_create_date, forum_last_date, forum_message_count, forum_moderated,
	user_username, contact_first_name, contact_last_name,
	project_name, project_color_identifier');
$q->addJoin('contacts', 'con', 'contact_id = user_contact');
$q->addWhere("user_id = forum_owner");
$q->addWhere("forum_id = {$forum_id}");
$q->addWhere("forum_project = project_id");
    die('You should not access this file directly.');
}
/*
 *	do_custom_field_aed.php
 *
 */
require_once $AppUI->getSystemClass('CustomFields');
$edit_field_id = dpGetParam($_POST, "field_id", NULL);
if ($edit_field_id != NULL) {
    $edit_module = dpGetParam($_POST, "module", NULL);
    $field_name = dpGetParam($_POST, "field_name", NULL);
    $field_description = db_escape(dpGetParam($_POST, "field_description", NULL));
    $field_htmltype = dpGetParam($_POST, "field_htmltype", NULL);
    $field_datatype = dpGetParam($_POST, "field_datatype", "alpha");
    $field_extratags = db_escape(dpGetParam($_POST, "field_extratags", NULL));
    $list_select_items = dpGetParam($_POST, "select_items", NULL);
    $custom_fields = new CustomFields(strtolower($edit_module), 'addedit', null, null);
    if ($edit_field_id == 0) {
        $fid = $custom_fields->add($field_name, $field_description, $field_htmltype, $field_datatype, $field_extratags, $msg);
    } else {
        $fid = $custom_fields->update($edit_field_id, $field_name, $field_description, $field_htmltype, $field_datatype, $field_extratags, $msg);
    }
    // Add or Update a Custom Field
    if ($msg) {
        $AppUI->setMsg($AppUI->_('Error adding custom field:') . $msg, UI_MSG_ALERT, true);
    } else {
        if ($field_htmltype == "select") {
            $opts = new CustomOptionList($fid);
            $opts->setOptions($list_select_items);
            if ($edit_field_id == 0) {
                $o_msg = $opts->store();
<?php

if (!defined('DP_BASE_DIR')) {
    die('You should not access this file directly.');
}
/*
 *	Custom Field Editor (NEW)
 *
 */
$AppUI->savePlace();
require_once $AppUI->getSystemClass('CustomFields');
$titleBlock = new CTitleBlock('Custom field editor', "customfields.png", "admin", "admin.custom_field_editor");
$titleBlock->addCrumb("?m=system", "system admin");
$edit_field_id = dpGetParam($_POST, "field_id", NULL);
$titleBlock->show();
$sql = "SELECT * FROM modules WHERE mod_name IN ('Companies', 'Projects', 'Tasks', 'Calendar') ORDER BY mod_ui_order";
$modules = db_loadList($sql);
echo "<table cellpadding=\"2\">";
foreach ($modules as $module) {
    echo "<tr><td colspan=\"4\">";
    echo "<h3>" . $AppUI->_($module["mod_name"]) . "</h3>";
    echo "</td></tr>";
    echo "<tr><td colspan=\"4\">";
    echo "<a href=\"?m=system&a=custom_field_addedit&module=" . $module["mod_name"] . "\"><img src='./images/icons/stock_new.png' align='center' width='16' height='16' border='0'>" . $AppUI->_('Add a new Custom Field to this Module') . "</a><br /><br />";
    echo "</td></tr>";
    $sql = "SELECT * FROM custom_fields_struct WHERE field_module = '" . mb_strtolower($module["mod_name"]) . "'";
    $custom_fields = db_loadList($sql);
    foreach ($custom_fields as $f) {
        echo "<tr><td class=\"hilite\">";
        echo "<a href=\"?m=system&a=custom_field_addedit&module=" . $module["mod_name"] . "&field_id=" . $f["field_id"] . "\"><img src='./images/icons/stock_edit-16.png' align='center' width='16' height='16' border='0'>Edit</a>";
        echo "</td><td class=\"hilite\">";
            $select_options = new CustomOptionList($field_id);
            $select_options->load();
            $select_items = $select_options->getOptions();
        }
    } else {
        //No such field exists with this ID
        $AppUI->setMsg('Couldnt load the Custom Field, It might have been deleted somehow.');
        $AppUI->redirect();
    }
    $edit_title = $AppUI->_("Edit Custom Field In");
} else {
    $edit_title = $AppUI->_("New Custom Field In");
    $field_name = dpGetParam($_POST, "field_name", NULL);
    $field_description = dpGetParam($_POST, "field_description", NULL);
    $field_htmltype = dpGetParam($_POST, "field_htmltype", "textinput");
    $field_extratags = dpGetParam($_POST, "field_extratags", NULL);
}
$html_types = array('textinput' => $AppUI->_('Text Input'), 'textarea' => $AppUI->_('Text Area'), 'checkbox' => $AppUI->_('Checkbox'), 'select' => $AppUI->_('Select List'), 'label' => $AppUI->_('Label'), 'separator' => $AppUI->_('Separator'));
$visible_state = array();
foreach ($html_types as $k => $ht) {
    if ($k == $field_htmltype) {
        $visible_state["div_" . $k] = "display : block";
    } else {
        $visible_state["div_" . $k] = "display : none";
    }
}
?>
<script>
	function hideAll()
	{
		var selobj = document.getElementById('htmltype');