Пример #1
0
 public function __invoke(Template_Helper $tpl)
 {
     $units = array('hour' => 'Hours', 'day' => 'Days');
     $type_list = array('phone' => 'Phone Calls', 'note' => 'Notes', 'email' => 'Email', 'draft' => 'Drafts', 'time' => 'Time Tracking', 'reminder' => 'Reminders');
     $tpl->assign(array('units' => $units, 'users' => Project::getUserAssocList($this->prj_id, 'active', User::ROLE_CUSTOMER), 'developer' => $this->usr_id, 'type_list' => $type_list, 'activity_types' => $this->activity_types ?: array_keys($type_list), 'unit' => $this->unit, 'amount' => $this->amount, 'start_date' => $this->start_date, 'end_date' => $this->end_date, 'sort_order' => $this->sort_order));
     if (!$this->unit && !$this->amount) {
         return;
     }
     $data = array();
     if (in_array('phone', $this->activity_types)) {
         $data['phone'] = $this->phoneActivity();
     }
     if (in_array('note', $this->activity_types)) {
         $data['note'] = $this->noteActivity();
     }
     if (in_array('email', $this->activity_types)) {
         $data['email'] = $this->emailActivity();
     }
     if (in_array('draft', $this->activity_types)) {
         $data['draft'] = $this->draftActivity();
     }
     if (in_array('time', $this->activity_types)) {
         $data['time'] = $this->timeActivity();
     }
     if (!$this->developer && in_array('reminder', $this->activity_types)) {
         $data['reminder'] = $this->reminderActivity();
     }
     $tpl->assign(array('data' => $data, 'developer' => $this->developer));
 }
Пример #2
0
function rssError($msg)
{
    $tpl = new Template_Helper();
    $tpl->setTemplate('rss_error.tpl.xml');
    header('Content-Type: text/xml; charset=' . APP_CHARSET);
    $tpl->assign(array('error' => $msg));
    $tpl->displayTemplate();
}
Пример #3
0
// | Copyright (c) 2008 - 2010 Sun Microsystem Inc.                       |
// | Copyright (c) 2011 - 2013 Eventum Team.                              |
// |                                                                      |
// | This program is free software; you can redistribute it and/or modify |
// | it under the terms of the GNU General Public License as published by |
// | the Free Software Foundation; either version 2 of the License, or    |
// | (at your option) any later version.                                  |
// |                                                                      |
// | This program is distributed in the hope that it will be useful,      |
// | but WITHOUT ANY WARRANTY; without even the implied warranty of       |
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        |
// | GNU General Public License for more details.                         |
// |                                                                      |
// | You should have received a copy of the GNU General Public License    |
// | along with this program; if not, write to:                           |
// |                                                                      |
// | Free Software Foundation, Inc.                                       |
// | 51 Franklin Street, Suite 330                                          |
// | Boston, MA 02110-1301, USA.                                          |
// +----------------------------------------------------------------------+
// | Authors: João Prado Maia <*****@*****.**>                             |
// +----------------------------------------------------------------------+
require_once dirname(__FILE__) . '/../init.php';
$tpl = new Template_Helper();
$tpl->setTemplate('requirement.tpl.html');
Auth::checkAuthentication(APP_COOKIE, 'index.php?err=5', true);
if (@$_POST['cat'] == 'set_analysis') {
    $res = Impact_Analysis::update($_POST['isr_id']);
    $tpl->assign('set_analysis_result', $res);
}
$tpl->displayTemplate();
Пример #4
0
// | Free Software Foundation, Inc.                                       |
// | 51 Franklin Street, Suite 330                                          |
// | Boston, MA 02110-1301, USA.                                          |
// +----------------------------------------------------------------------+
// | Authors: João Prado Maia <*****@*****.**>                             |
// +----------------------------------------------------------------------+
require_once dirname(__FILE__) . '/../../init.php';
$tpl = new Template_Helper();
$tpl->setTemplate('manage/statuses.tpl.html');
Auth::checkAuthentication(APP_COOKIE);
$role_id = Auth::getCurrentRole();
if ($role_id < User::getRoleID('manager')) {
    Misc::setMessage(ev_gettext('Sorry, you are not allowed to access this page.'), Misc::MSG_ERROR);
    $tpl->displayTemplate();
    exit;
}
if (@$_POST['cat'] == 'new') {
    $res = Status::insert();
    Misc::mapMessages($res, array(1 => array(ev_gettext('Thank you, the status was added successfully.'), Misc::MSG_INFO), -1 => array(ev_gettext('An error occurred while trying to add the status.'), Misc::MSG_ERROR), -2 => array(ev_gettext('Please enter the title for this status.'), Misc::MSG_ERROR)));
} elseif (@$_POST['cat'] == 'update') {
    $res = Status::update();
    Misc::mapMessages($res, array(1 => array(ev_gettext('Thank you, the status was updated successfully.'), Misc::MSG_INFO), -1 => array(ev_gettext('An error occurred while trying to add the status.'), Misc::MSG_ERROR), -2 => array(ev_gettext('Please enter the title for this status.'), Misc::MSG_ERROR)));
} elseif (@$_POST['cat'] == 'delete') {
    Status::remove();
}
if (@$_GET['cat'] == 'edit') {
    $tpl->assign('info', Status::getDetails($_GET['id']));
}
$tpl->assign('list', Status::getList());
$tpl->assign('project_list', Project::getAll());
$tpl->displayTemplate();
Пример #5
0
 * @copyright (c) Eventum Team
 * @license GNU General Public License, version 2 or later (GPL-2+)
 *
 * For the full copyright and license information,
 * please see the COPYING and AUTHORS files
 * that were distributed with this source code.
 */
require_once __DIR__ . '/../../init.php';
$tpl = new Template_Helper();
$tpl->setTemplate('manage/anonymous.tpl.html');
Auth::checkAuthentication();
@($prj_id = $_POST['prj_id'] ? $_POST['prj_id'] : $_GET['prj_id']);
$role_id = Auth::getCurrentRole();
if ($role_id < User::ROLE_MANAGER) {
    Misc::setMessage(ev_gettext('Sorry, you are not allowed to access this page.'), Misc::MSG_ERROR);
    $tpl->displayTemplate();
    exit;
}
if (@$_POST['cat'] == 'update') {
    $res = Project::updateAnonymousPost($prj_id);
    $tpl->assign('result', $res);
    Misc::mapMessages($res, array(1 => array(ev_gettext('Thank you, the information was updated successfully.'), Misc::MSG_INFO), -1 => array(ev_gettext('An error occurred while trying to update the information.'), Misc::MSG_ERROR)));
}
// load the form fields
$tpl->assign('project', Project::getDetails($prj_id));
$tpl->assign('cats', Category::getAssocList($prj_id));
$tpl->assign('priorities', Priority::getList($prj_id));
$tpl->assign('users', Project::getUserAssocList($prj_id, 'active'));
$tpl->assign('options', Project::getAnonymousPostOptions($prj_id));
$tpl->assign('prj_id', $prj_id);
$tpl->displayTemplate();
Пример #6
0
 * For the full copyright and license information,
 * please see the COPYING and AUTHORS files
 * that were distributed with this source code.
 */
require_once __DIR__ . '/../../init.php';
$tpl = new Template_Helper();
$tpl->setTemplate('manage/severities.tpl.html');
Auth::checkAuthentication();
$role_id = Auth::getCurrentRole();
if ($role_id < User::ROLE_MANAGER) {
    Misc::setMessage('Sorry, you are not allowed to access this page.', Misc::MSG_ERROR);
    $tpl->displayTemplate();
    exit;
}
@($prj_id = $_POST['prj_id'] ? $_POST['prj_id'] : $_GET['prj_id']);
$tpl->assign('project', Project::getDetails($prj_id));
if (@$_POST['cat'] == 'new') {
    $res = Severity::insert($prj_id, $_POST['title'], $_POST['description'], $_POST['rank']);
    Misc::mapMessages($res, array(1 => array('Thank you, the severity was added successfully.', Misc::MSG_INFO), -1 => array('An error occurred while trying to add the severity.', Misc::MSG_ERROR), -2 => array('Please enter the title for this new severity.', Misc::MSG_ERROR)));
} elseif (@$_POST['cat'] == 'update') {
    $res = Severity::update($_POST['id'], $_POST['title'], $_POST['description'], $_POST['rank']);
    Misc::mapMessages($res, array(1 => array('Thank you, the severity was added successfully.', Misc::MSG_INFO), -1 => array('An error occurred while trying to add the severity.', Misc::MSG_ERROR), -2 => array('Please enter the title for this new severity.', Misc::MSG_ERROR)));
} elseif (@$_POST['cat'] == 'delete') {
    Severity::remove($_POST['items']);
}
if (@$_GET['cat'] == 'edit') {
    $tpl->assign('info', Severity::getDetails($_GET['id']));
} elseif (@$_GET['cat'] == 'change_rank') {
    Severity::changeRank($prj_id, $_GET['id'], $_GET['rank']);
}
$tpl->assign('list', Severity::getList($prj_id));
Пример #7
0
 * please see the COPYING and AUTHORS files
 * that were distributed with this source code.
 */
require_once __DIR__ . '/../../init.php';
$tpl = new Template_Helper();
$tpl->setTemplate('manage/time_tracking.tpl.html');
Auth::checkAuthentication();
$role_id = Auth::getCurrentRole();
if ($role_id < User::ROLE_MANAGER) {
    Misc::setMessage(ev_gettext('Sorry, you are not allowed to access this page.'), Misc::MSG_ERROR);
    $tpl->displayTemplate();
    exit;
}
$prj_id = isset($_POST['prj_id']) ? (int) $_POST['prj_id'] : (int) $_GET['prj_id'];
$cat = isset($_POST['cat']) ? (string) $_POST['cat'] : null;
$tpl->assign('project', Project::getDetails($prj_id));
if ($cat == 'new') {
    $title = $_POST['title'];
    $res = Time_Tracking::insertCategory($prj_id, $title);
    Misc::mapMessages($res, array(1 => array(ev_gettext('Thank you, the time tracking category was added successfully.'), Misc::MSG_INFO), -1 => array(ev_gettext('An error occurred while trying to add the new time tracking category.'), Misc::MSG_INFO), -2 => array(ev_gettext('Please enter the title for this new time tracking category.'), Misc::MSG_ERROR)));
} elseif ($cat == 'update') {
    $title = (string) $_POST['title'];
    $prj_id = (int) $_POST['prj_id'];
    $id = (int) $_POST['id'];
    $res = Time_Tracking::updateCategory($prj_id, $id, $title);
    Misc::mapMessages($res, array(1 => array(ev_gettext('Thank you, the time tracking category was updated successfully.'), Misc::MSG_INFO), -1 => array(ev_gettext('An error occurred while trying to update the time tracking category information.'), Misc::MSG_INFO), -2 => array(ev_gettext('Please enter the title for this time tracking category.'), Misc::MSG_ERROR)));
} elseif ($cat == 'delete') {
    $items = (array) $_POST['items'];
    Time_Tracking::removeCategory($items);
}
if ($cat == 'edit') {
Пример #8
0
    $res = Reminder_Condition::insert();
    Misc::mapMessages($res, array(1 => array(ev_gettext('Thank you, the condition was added successfully.'), Misc::MSG_INFO), -1 => array(ev_gettext('An error occurred while trying to add the new condition.'), Misc::MSG_ERROR), -2 => array(ev_gettext('Please enter the title for this new condition.'), Misc::MSG_ERROR)));
} elseif (@$_POST['cat'] == 'update') {
    $res = Reminder_Condition::update();
    Misc::mapMessages($res, array(1 => array(ev_gettext('Thank you, the condition was updated successfully.'), Misc::MSG_INFO), -1 => array(ev_gettext('An error occurred while trying to update the condition.'), Misc::MSG_ERROR), -2 => array(ev_gettext('Please enter the title for this condition.'), Misc::MSG_ERROR)));
} elseif (@$_POST['cat'] == 'delete') {
    Reminder_Condition::remove();
}
if (@$_GET['cat'] == 'edit') {
    $info = Reminder_Condition::getDetails($_GET['id']);
    if (!empty($_GET['field'])) {
        $info['rlc_rmf_id'] = $_GET['field'];
    } else {
        $_GET['field'] = $info['rlc_rmf_id'];
    }
    $tpl->assign('info', $info);
}
if (!empty($_GET['field'])) {
    $field_title = Reminder_Condition::getFieldTitle($_GET['field']);
    if (Reminder_Condition::canFieldBeCompared($_GET['field'])) {
        $tpl->assign(array('show_field_options' => 'yes', 'comparable_fields' => Reminder_Condition::getFieldAdminList(true)));
    } elseif (strtolower($field_title) == 'status') {
        $prj_id = Reminder::getProjectID($rem_id);
        $tpl->assign(array('show_status_options' => 'yes', 'statuses' => Status::getAssocStatusList($prj_id)));
    } elseif (strtolower($field_title) == 'category') {
        $prj_id = Reminder::getProjectID($rem_id);
        $tpl->assign(array('show_category_options' => 'yes', 'categories' => Category::getAssocList($prj_id)));
    } elseif (strtolower($field_title) == 'group' || strtolower($field_title) == 'active group') {
        $prj_id = Reminder::getProjectID($rem_id);
        $tpl->assign(array('show_group_options' => 'yes', 'groups' => Group::getAssocList($prj_id)));
    } else {
Пример #9
0
<?php

/*
 * This file is part of the Eventum (Issue Tracking System) package.
 *
 * @copyright (c) Eventum Team
 * @license GNU General Public License, version 2 or later (GPL-2+)
 *
 * For the full copyright and license information,
 * please see the COPYING and AUTHORS files
 * that were distributed with this source code.
 */
require_once __DIR__ . '/../../init.php';
$tpl = new Template_Helper();
$tpl->setTemplate('manage/monitor.tpl.html');
Auth::checkAuthentication();
$role_id = Auth::getCurrentRole();
if ($role_id < User::ROLE_REPORTER) {
    Misc::setMessage(ev_gettext('Sorry, you are not allowed to access this page.'), Misc::MSG_ERROR);
    $tpl->displayTemplate();
    exit;
}
$tpl->assign('project_list', Project::getAll());
if (!empty($_POST['cat']) && $_POST['cat'] == 'update') {
    $setup = array('diskcheck' => $_POST['diskcheck'], 'paths' => $_POST['paths'], 'ircbot' => $_POST['ircbot']);
    $res = Setup::save(array('monitor' => $setup));
    Misc::mapMessages($res, array(1 => array(ev_gettext('Thank you, the setup information was saved successfully.'), Misc::MSG_INFO), -1 => array(ev_gettext("ERROR: The system doesn't have the appropriate permissions to create the configuration file in the setup directory (%s). " . 'Please contact your local system administrator and ask for write privileges on the provided path.', APP_CONFIG_PATH), Misc::MSG_NOTE_BOX), -2 => array(ev_gettext("ERROR: The system doesn't have the appropriate permissions to update the configuration file in the setup directory (%s). " . 'Please contact your local system administrator and ask for write privileges on the provided filename.', APP_SETUP_FILE), Misc::MSG_NOTE_BOX)));
}
$tpl->assign(array('enable_disable', array('enabled' => ev_gettext('Enabled'), 'disabled' => ev_gettext('Disabled')), 'setup' => Setup::get()));
$tpl->displayTemplate();
Пример #10
0
    exit;
}
// TODO: move this query to some class
$sql = 'SELECT
            prc_id,
        	prc_title,
        	SUM(iss_dev_time) as dev_time
        FROM
        	{{%issue}},
        	{{%project_category}},
        	{{%status}}
        WHERE
        	iss_prc_id = prc_id AND
        	iss_sta_id = sta_id AND
        	sta_is_closed != 1 AND
        	iss_prj_id = ?
        GROUP BY
        	iss_prc_id';
try {
    $res = DB_Helper::getInstance()->getAll($sql, array(Auth::getCurrentProject()));
} catch (DbException $e) {
    return false;
}
$total = 0;
foreach ($res as $id => $row) {
    $total += $row['dev_time'];
    $res[$id]['dev_time'] = str_replace(' ', '&nbsp;', str_pad($row['dev_time'], 5, ' ', STR_PAD_LEFT));
}
$res[] = array('dev_time' => str_replace(' ', '&nbsp;', str_pad($total, 5, ' ', STR_PAD_LEFT)), 'prc_title' => 'Total');
$tpl->assign('data', $res);
$tpl->displayTemplate();
Пример #11
0
// | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the        |
// | GNU General Public License for more details.                         |
// |                                                                      |
// | You should have received a copy of the GNU General Public License    |
// | along with this program; if not, write to:                           |
// |                                                                      |
// | Free Software Foundation, Inc.                                       |
// | 51 Franklin Street, Suite 330                                          |
// | Boston, MA 02110-1301, USA.                                          |
// +----------------------------------------------------------------------+
// | Authors: Bryan Alsdorf <*****@*****.**>                             |
// +----------------------------------------------------------------------+
require_once dirname(__FILE__) . '/../../init.php';
$tpl = new Template_Helper();
$tpl->setTemplate('reports/workload_time_period.tpl.html');
Auth::checkAuthentication(APP_COOKIE);
$usr_id = Auth::getUserID();
if (!Access::canAccessReports(Auth::getUserID())) {
    echo 'Invalid role';
    exit;
}
$prj_id = Auth::getCurrentProject();
// get timezone of current user
$user_prefs = Prefs::get($usr_id);
if (@$_GET['type'] == 'email') {
    $data = Report::getEmailWorkloadByTimePeriod(@$user_prefs['timezone']);
} else {
    $data = Report::getWorkloadByTimePeriod(@$user_prefs['timezone']);
}
$tpl->assign(array('data' => $data, 'type' => @$_GET['type'], 'user_tz' => Date_Helper::getTimezoneShortNameByUser($usr_id)));
$tpl->displayTemplate();
Пример #12
0
 /**
  * @param int $week
  * @param string $start
  * @param string $end
  * @param bool $separate_closed
  * @return string
  * @access protected
  * @deprecated use getWeeklyReportData() and format data yourself
  */
 public function getWeeklyReport($week, $start, $end, $separate_closed)
 {
     $usr_id = Auth::getUserID();
     $week = abs($week);
     // we have to set a project so the template class works, even though the weekly report doesn't actually need it
     $projects = Project::getAssocList(Auth::getUserID());
     $prj_id = current(array_keys($projects));
     AuthCookie::setProjectCookie($prj_id);
     $prj_id = Auth::getCurrentProject();
     // figure out the correct week
     if (empty($start) || empty($end)) {
         $start = date('U') - Date_Helper::DAY * (date('w') - 1);
         if ($week > 0) {
             $start = $start - Date_Helper::WEEK * $week;
         }
         $end = date('Y-m-d', $start + Date_Helper::DAY * 6);
         $start = date('Y-m-d', $start);
     }
     if ($separate_closed) {
         // emulate smarty value for reports/weekly_data.tpl.tmpl:
         // {if $smarty.post.separate_closed == 1}
         $_POST['separate_closed'] = true;
     }
     $options = array('separate_closed' => $separate_closed);
     $tpl = new Template_Helper();
     $tpl->setTemplate('reports/weekly_data.tpl.html');
     $tpl->assign(array('report_type' => 'weekly', 'data' => Report::getWeeklyReport($usr_id, $prj_id, $start, $end, $options)));
     $ret = $tpl->getTemplateContents() . "\n";
     return $ret;
 }
Пример #13
0
// +----------------------------------------------------------------------+
require_once dirname(__FILE__) . '/../init.php';
$tpl = new Template_Helper();
$tpl->setTemplate('popup.tpl.html');
Auth::checkAuthentication(APP_COOKIE, 'index.php?err=5', true);
$usr_id = Auth::getUserID();
$prj_id = Auth::getCurrentProject();
$iss_id = isset($_GET['iss_id']) ? (int) $_GET['iss_id'] : (isset($_POST['issue_id']) ? (int) $_POST['issue_id'] : null);
$cat = isset($_GET['cat']) ? (string) $_GET['cat'] : (isset($_POST['cat']) ? (string) $_POST['cat'] : null);
$id = isset($_GET['id']) ? (int) $_GET['id'] : null;
$status_id = isset($_GET['new_sta_id']) ? (int) $_GET['new_sta_id'] : null;
$isr_id = isset($_POST['isr_id']) ? (int) $_POST['isr_id'] : null;
$items = isset($_POST['item']) ? (array) $_POST['item'] : null;
if ($cat == 'delete_note') {
    $res = Note::remove($id);
    $tpl->assign('note_delete_result', $res);
} elseif ($cat == 'delete_time') {
    $res = Time_Tracking::removeTimeEntry($id, $usr_id);
    $tpl->assign('time_delete_result', $res);
} elseif ($cat == 'bulk_update') {
    $res = Issue::bulkUpdate();
    $tpl->assign('bulk_update_result', $res);
} elseif ($cat == 'set_initial_impact') {
    $res = Issue::setImpactAnalysis($iss_id);
    $tpl->assign('set_initial_impact_result', $res);
} elseif ($cat == 'add_requirement') {
    $res = Impact_Analysis::insert($iss_id);
    $tpl->assign('add_requirement_result', $res);
} elseif ($cat == 'set_impact_requirement') {
    $res = Impact_Analysis::update($isr_id);
    $tpl->assign('set_impact_requirement_result', $res);
Пример #14
0
 */
require_once __DIR__ . '/../../init.php';
$tpl = new Template_Helper();
$tpl->setTemplate('manage/round_robin.tpl.html');
Auth::checkAuthentication();
$role_id = Auth::getCurrentRole();
if ($role_id < User::ROLE_MANAGER) {
    Misc::setMessage(ev_gettext('Sorry, you are not allowed to access this page.'), Misc::MSG_ERROR);
    $tpl->displayTemplate();
    exit;
}
if (@$_POST['cat'] == 'new') {
    $res = Round_Robin::insert();
    Misc::mapMessages($res, array(1 => array(ev_gettext('Thank you, the round robin entry was added successfully.'), Misc::MSG_INFO), -1 => array(ev_gettext('An error occurred while trying to add the round robin entry.'), Misc::MSG_ERROR), -2 => array(ev_gettext('Please enter the title for this round robin entry.'), Misc::MSG_ERROR), -3 => array(ev_gettext('Please enter the message for this round robin entry.'), Misc::MSG_ERROR)));
} elseif (@$_POST['cat'] == 'update') {
    $res = Round_Robin::update();
    Misc::mapMessages($res, array(1 => array(ev_gettext('Thank you, the round robin entry was updated successfully.'), Misc::MSG_INFO), -1 => array(ev_gettext('An error occurred while trying to update the round robin entry information.'), Misc::MSG_ERROR), -2 => array(ev_gettext('Please enter the title for this round robin entry.'), Misc::MSG_ERROR), -3 => array(ev_gettext('Please enter the message for this round robin entry.'), Misc::MSG_ERROR)));
} elseif (@$_POST['cat'] == 'delete') {
    Round_Robin::remove();
}
if (@$_GET['cat'] == 'edit') {
    $info = Round_Robin::getDetails($_GET['id']);
    $tpl->assign('info', $info);
    $_REQUEST['prj_id'] = $info['prr_prj_id'];
}
$tpl->assign('list', Round_Robin::getList());
if (!empty($_REQUEST['prj_id'])) {
    $tpl->assign('user_options', User::getActiveAssocList($_REQUEST['prj_id'], User::ROLE_CUSTOMER));
}
$tpl->assign('project_list', Project::getAll());
$tpl->displayTemplate();
Пример #15
0
// | 51 Franklin Street, Suite 330                                          |
// | Boston, MA 02110-1301, USA.                                          |
// +----------------------------------------------------------------------+
// | Authors: João Prado Maia <*****@*****.**>                             |
// +----------------------------------------------------------------------+
require_once dirname(__FILE__) . '/../../init.php';
$tpl = new Template_Helper();
$tpl->setTemplate('manage/customize_listing.tpl.html');
Auth::checkAuthentication(APP_COOKIE);
$role_id = Auth::getCurrentRole();
if ($role_id < User::getRoleID('administrator')) {
    Misc::setMessage(ev_gettext('Sorry, you are not allowed to access this page.'), Misc::MSG_ERROR);
    $tpl->displayTemplate();
    exit;
}
$tpl->assign('project_list', Project::getAll());
if (@$_POST['cat'] == 'new') {
    $res = Status::insertCustomization($_POST['project'], $_POST['status'], $_POST['date_field'], $_POST['label']);
    Misc::mapMessages($res, array(1 => array(ev_gettext('Thank you, the customization was added successfully.'), Misc::MSG_INFO), -1 => array(ev_gettext('An error occurred while trying to add the new customization.'), Misc::MSG_ERROR), -2 => array(ev_gettext('Please enter the title for this new customization'), Misc::MSG_ERROR)));
} elseif (@$_POST['cat'] == 'update') {
    $res = Status::updateCustomization($_POST['id'], $_POST['project'], $_POST['status'], $_POST['date_field'], $_POST['label']);
    Misc::mapMessages($res, array(1 => array(ev_gettext('Thank you, the customization was updated successfully.'), Misc::MSG_INFO), -1 => array(ev_gettext('An error occurred while trying to update the customization information.'), Misc::MSG_ERROR), -2 => array(ev_gettext('Please enter the title for this customization.'), Misc::MSG_ERROR)));
} elseif (@$_POST['cat'] == 'delete') {
    $res = Status::removeCustomization(@$_POST['items']);
    Misc::mapMessages($res, array(true => array(ev_gettext('Thank you, the customization was deleted successfully.'), Misc::MSG_INFO), false => array(ev_gettext('An error occurred while trying to delete the customization information.'), Misc::MSG_ERROR)));
}
if (@$_GET['cat'] == 'edit') {
    $details = Status::getCustomizationDetails($_GET['id']);
    $tpl->assign(array('info' => $details, 'project_id' => $details['psd_prj_id'], 'status_list' => Status::getAssocStatusList($details['psd_prj_id'], true)));
}
$display_customer_fields = false;
Пример #16
0
 * For the full copyright and license information,
 * please see the COPYING and AUTHORS files
 * that were distributed with this source code.
 */
require_once __DIR__ . '/../../init.php';
$tpl = new Template_Helper();
$tpl->setTemplate('manage/phone_categories.tpl.html');
Auth::checkAuthentication();
$role_id = Auth::getCurrentRole();
if ($role_id < User::ROLE_MANAGER) {
    Misc::setMessage(ev_gettext('Sorry, you are not allowed to access this page.'), Misc::MSG_ERROR);
    $tpl->displayTemplate();
    exit;
}
@($prj_id = $_POST['prj_id'] ? $_POST['prj_id'] : $_GET['prj_id']);
$tpl->assign('project', Project::getDetails($prj_id));
if (@$_POST['cat'] == 'new') {
    $res = Phone_Support::insertCategory();
    $tpl->assign('result', $res);
    Misc::mapMessages($res, array(1 => array(ev_gettext('Thank you, the phone category was added successfully.'), Misc::MSG_INFO), -1 => array(ev_gettext('An error occurred while trying to add the phone category.'), Misc::MSG_ERROR), -2 => array(ev_gettext('Please enter the title for this new phone category.'), Misc::MSG_ERROR)));
} elseif (@$_POST['cat'] == 'update') {
    $res = Phone_Support::updateCategory();
    $tpl->assign('result', $res);
    Misc::mapMessages($res, array(1 => array(ev_gettext('Thank you, the phone category was updated successfully.'), Misc::MSG_INFO), -1 => array(ev_gettext('An error occurred while trying to uodate the phone category.'), Misc::MSG_ERROR), -2 => array(ev_gettext('Please enter the title for this phone category.'), Misc::MSG_ERROR)));
} elseif (@$_POST['cat'] == 'delete') {
    Phone_Support::removeCategory();
}
if (@$_GET['cat'] == 'edit') {
    $tpl->assign('info', Phone_Support::getCategoryDetails($_GET['id']));
}
$tpl->assign('list', Phone_Support::getCategoryList($prj_id));
Пример #17
0
// | 51 Franklin Street, Suite 330                                        |
// | Boston, MA 02110-1301, USA.                                          |
// +----------------------------------------------------------------------+
// | Authors: João Prado Maia <*****@*****.**>                             |
// | Authors: Elan Ruusamäe <*****@*****.**>                               |
// +----------------------------------------------------------------------+
require_once dirname(__FILE__) . '/../init.php';
Auth::checkAuthentication(APP_COOKIE);
$usr_id = Auth::getUserID();
$prj_id = Auth::getCurrentProject();
if (!Access::canCreateIssue($usr_id)) {
    Auth::redirect('main.php');
}
$tpl = new Template_Helper();
$tpl->setTemplate('new.tpl.html');
$tpl->assign('new_issue_id', '');
// If the project has changed since the new issue form was requested, then change it back
$issue_prj_id = !empty($_REQUEST['prj_id']) ? (int) $_REQUEST['prj_id'] : 0;
if ($issue_prj_id > 0 && $issue_prj_id != $prj_id) {
    // Switch the project back
    $assigned_projects = Project::getAssocList($usr_id);
    if (isset($assigned_projects[$issue_prj_id])) {
        $cookie = Auth::getCookieInfo(APP_PROJECT_COOKIE);
        Auth::setCurrentProject($issue_prj_id, $cookie['remember']);
        $prj_id = $issue_prj_id;
    } else {
        Misc::setMessage(ev_gettext('There was an error creating your issue.'), Misc::MSG_ERROR);
        $tpl->assign('error_msg', '1');
    }
}
if (CRM::hasCustomerIntegration($prj_id)) {
Пример #18
0
 *
 * @copyright (c) Eventum Team
 * @license GNU General Public License, version 2 or later (GPL-2+)
 *
 * For the full copyright and license information,
 * please see the COPYING and AUTHORS files
 * that were distributed with this source code.
 */
require_once __DIR__ . '/../../init.php';
$tpl = new Template_Helper();
$tpl->setTemplate('reports/open_issues.tpl.html');
Auth::checkAuthentication();
if (!Access::canAccessReports(Auth::getUserID())) {
    echo 'Invalid role';
    exit;
}
$prj_id = Auth::getCurrentProject();
if (!isset($_GET['cutoff_days'])) {
    $cutoff_days = 7;
} else {
    $cutoff_days = $_GET['cutoff_days'];
}
if (empty($_GET['group_by_reporter'])) {
    $group_by_reporter = false;
} else {
    $group_by_reporter = true;
}
$tpl->assign('cutoff_days', $cutoff_days);
$res = Report::getOpenIssuesByUser($prj_id, $cutoff_days, $group_by_reporter);
$tpl->assign('users', $res);
$tpl->displayTemplate();
Пример #19
0
 /**
  * Method used to send a confirmation email to the user that is associated
  * to the email address.
  *
  * @param   string $usr_id The user ID
  * @return  void
  */
 public static function sendPasswordConfirmationEmail($usr_id)
 {
     $info = self::getDetails($usr_id);
     // send confirmation email to user
     $hash = md5($info['usr_full_name'] . $info['usr_email'] . Auth::privateKey());
     $tpl = new Template_Helper();
     $tpl->setTemplate('notifications/password_confirmation.tpl.text');
     $tpl->assign(array('app_title' => Misc::getToolCaption(), 'user' => $info, 'hash' => $hash));
     $text_message = $tpl->getTemplateContents();
     $setup = Setup::load();
     $mail = new Mail_Helper();
     // need to make this message MIME based
     $mail->setTextBody($text_message);
     $mail->send($setup['smtp']['from'], $info['usr_email'], APP_SHORT_NAME . ': New Password - Confirmation Required');
 }
Пример #20
0
// | GNU General Public License for more details.                         |
// |                                                                      |
// | You should have received a copy of the GNU General Public License    |
// | along with this program; if not, write to:                           |
// |                                                                      |
// | Free Software Foundation, Inc.                                       |
// | 51 Franklin Street, Suite 330                                          |
// | Boston, MA 02110-1301, USA.                                          |
// +----------------------------------------------------------------------+
// | Authors: Dave Anderson <*****@*****.**>                        |
// +----------------------------------------------------------------------+
require_once dirname(__FILE__) . '/../init.php';
$tpl = new Template_Helper();
$tpl->setTemplate('edit_reporter.tpl.html');
Auth::checkAuthentication(APP_COOKIE, 'index.php?err=5', true);
$prj_id = Auth::getCurrentProject();
$issue_id = @$_POST['issue_id'] ? $_POST['issue_id'] : $_GET['iss_id'];
$tpl->assign('issue_id', $issue_id);
if (!Access::canChangeReporter($issue_id, Auth::getUserID())) {
    $tpl->setTemplate('permission_denied.tpl.html');
    $tpl->displayTemplate();
    exit;
}
if (@$_POST['cat'] == 'update') {
    $res = Edit_Reporter::update($issue_id, trim($_POST['email']));
    Misc::mapMessages($res, array(1 => array(ev_gettext('Thank you, the Reporter was updated successfully.'), Misc::MSG_INFO), -1 => array(ev_gettext('An error occurred while trying to update the Reporter.'), Misc::MSG_ERROR)));
    Auth::redirect(APP_RELATIVE_URL . 'view.php?id=' . $issue_id);
}
$t = Project::getAddressBook($prj_id, $issue_id);
$tpl->assign('allowed_reporters', $t);
$tpl->displayTemplate();
Пример #21
0
// | along with this program; if not, write to:                           |
// |                                                                      |
// | Free Software Foundation, Inc.                                       |
// | 51 Franklin Street, Suite 330                                          |
// | Boston, MA 02110-1301, USA.                                          |
// +----------------------------------------------------------------------+
// | Authors: João Prado Maia <*****@*****.**>                             |
// +----------------------------------------------------------------------+
require_once dirname(__FILE__) . '/../init.php';
$tpl = new Template_Helper();
$tpl->setTemplate('self_assign.tpl.html');
Auth::checkAuthentication(APP_COOKIE, 'index.php?err=5', true);
$usr_id = Auth::getUserID();
$prj_id = Auth::getCurrentProject();
$issue_id = $_REQUEST['iss_id'];
$tpl->assign('issue_id', $issue_id);
// check if issue is assigned to someone else and if so, confirm change.
$assigned_user_ids = Issue::getAssignedUserIDs($issue_id);
if (count($assigned_user_ids) > 0 && empty($_REQUEST['target'])) {
    $tpl->assign(array('prompt_override' => 1, 'assigned_users' => Issue::getAssignedUsers($issue_id)));
} else {
    $issue_details = Issue::getDetails($issue_id);
    // force assignment change
    if (@$_REQUEST['target'] == 'replace') {
        // remove current user(s) first
        Issue::deleteUserAssociations($issue_id, $usr_id);
    }
    $res = Issue::addUserAssociation($usr_id, $issue_id, $usr_id);
    $tpl->assign('self_assign_result', $res);
    Notification::subscribeUser($usr_id, $issue_id, $usr_id, Notification::getDefaultActions($issue_id, User::getEmail($usr_id), 'self_assign'));
    Workflow::handleAssignmentChange($prj_id, $issue_id, $usr_id, $issue_details, Issue::getAssignedUserIDs($issue_id), false);
Пример #22
0
$role_id = Auth::getCurrentRole();
if ($role_id < User::ROLE_MANAGER) {
    Misc::setMessage(ev_gettext('Sorry, you are not allowed to access this page.'), Misc::MSG_ERROR);
    $tpl->displayTemplate();
    exit;
}
if (@$_POST['cat'] == 'new') {
    $res = Group::insert();
    Misc::mapMessages($res, array(1 => array(ev_gettext('Thank you, the group was added successfully.'), Misc::MSG_INFO), -1 => array(ev_gettext('An error occurred while trying to add the new group.'), Misc::MSG_ERROR)));
} elseif (@$_POST['cat'] == 'update') {
    $res = Group::update();
    Misc::mapMessages($res, array(1 => array(ev_gettext('Thank you, the group was updated successfully.'), Misc::MSG_INFO), -1 => array(ev_gettext('An error occurred while trying to update the group.'), Misc::MSG_ERROR)));
} elseif (@$_POST['cat'] == 'delete') {
    Group::remove();
}
if (@$_GET['cat'] == 'edit') {
    $info = Group::getDetails($_GET['id']);
    $tpl->assign('info', $info);
    $user_options = User::getActiveAssocList(Auth::getCurrentProject(), User::ROLE_CUSTOMER, false, $_GET['id']);
} else {
    $user_options = User::getActiveAssocList(Auth::getCurrentProject(), User::ROLE_CUSTOMER, true);
}
if (@$_GET['show_customers'] == 1) {
    $show_customer = true;
} else {
    $show_customer = false;
}
$tpl->assign('user_options', $user_options);
$tpl->assign('list', Group::getList());
$tpl->assign('project_list', Project::getAll());
$tpl->displayTemplate();
Пример #23
0
if (is_array($fields) && count($fields) > 0) {
    foreach ($fields as $field) {
        $custom_fields[$field['fld_id']] = $field['fld_title'];
        $options[$field['fld_id']] = Custom_Field::getOptions($field['fld_id']);
    }
} else {
    echo ev_gettext('No custom fields for this project');
    exit;
}
if (!empty($_REQUEST['start']['Year']) && !empty($_REQUEST['start']['Month']) && !empty($_REQUEST['start']['Day'])) {
    $start = implode('-', $_REQUEST['start']);
} else {
    $start = false;
}
if (!empty($_REQUEST['end']['Year']) && !empty($_REQUEST['end']['Month']) && !empty($_REQUEST['end']['Day'])) {
    $end = implode('-', $_REQUEST['end']);
} else {
    $end = false;
}
if (count(@$_GET['custom_field']) > 0) {
    $data = Report::getCustomFieldReport(@$_GET['custom_field'], @$_GET['custom_options'], @$_GET['group_by'], $start, $end, true, @$_REQUEST['interval'], @$_REQUEST['assignee']);
}
if ($start == false || ($end = false)) {
    $start = '--';
    $end = '--';
}
$tpl->assign(array('custom_fields' => $custom_fields, 'custom_field' => @$_GET['custom_field'], 'options' => $options, 'custom_options' => @$_GET['custom_options'], 'group_by' => @$_GET['group_by'], 'selected_options' => @$_REQUEST['custom_options'], 'data' => @$data, 'start_date' => $start, 'end_date' => $end, 'assignees' => Project::getUserAssocList($prj_id, 'active', User::ROLE_CUSTOMER), 'assignee' => @$_REQUEST['assignee']));
if (isset($_GET['custom_field'])) {
    $tpl->assign(array('field_info' => Custom_Field::getDetails($_GET['custom_field'])));
}
$tpl->displayTemplate();
Пример #24
0
 * that were distributed with this source code.
 */
require_once __DIR__ . '/../../init.php';
$tpl = new Template_Helper();
$tpl->setTemplate('manage/products.tpl.html');
Auth::checkAuthentication();
$role_id = Auth::getCurrentRole();
if ($role_id < User::ROLE_MANAGER) {
    Misc::setMessage('Sorry, you are not allowed to access this page.', Misc::MSG_ERROR);
    $tpl->displayTemplate();
    exit;
}
if (@$_POST['cat'] == 'new') {
    $res = Product::insert($_POST['title'], $_POST['version_howto'], $_POST['rank'], @$_POST['removed'], @$_POST['email']);
    Misc::mapMessages($res, array(1 => array('Thank you, the product was added successfully.', Misc::MSG_INFO), -1 => array('An error occurred while trying to add the product.', Misc::MSG_ERROR)));
} elseif (@$_POST['cat'] == 'update') {
    $res = Product::update($_POST['id'], $_POST['title'], $_POST['version_howto'], $_POST['rank'], @$_POST['removed'], @$_POST['email']);
    Misc::mapMessages($res, array(1 => array('Thank you, the product was updated successfully.', Misc::MSG_INFO), -1 => array('An error occurred while trying to update the product.', Misc::MSG_ERROR)));
} elseif (@$_POST['cat'] == 'delete') {
    Product::remove($_POST['items']);
}
if (@$_GET['cat'] == 'edit') {
    $info = Product::getDetails($_GET['id']);
    $tpl->assign('info', $info);
    $user_options = User::getActiveAssocList(Auth::getCurrentProject(), User::ROLE_CUSTOMER, false, $_GET['id']);
} else {
    $user_options = User::getActiveAssocList(Auth::getCurrentProject(), User::ROLE_CUSTOMER, true);
}
$tpl->assign('list', Product::getList());
$tpl->assign('project_list', Project::getAll());
$tpl->displayTemplate();
Пример #25
0
// | GNU General Public License for more details.                         |
// |                                                                      |
// | You should have received a copy of the GNU General Public License    |
// | along with this program; if not, write to:                           |
// |                                                                      |
// | Free Software Foundation, Inc.                                       |
// | 51 Franklin Street, Suite 330                                          |
// | Boston, MA 02110-1301, USA.                                          |
// +----------------------------------------------------------------------+
// | Authors: João Prado Maia <*****@*****.**>                             |
// +----------------------------------------------------------------------+
require_once dirname(__FILE__) . '/../../init.php';
$tpl = new Template_Helper();
$tpl->setTemplate('manage/field_display.tpl.html');
Auth::checkAuthentication(APP_COOKIE);
$tpl->assign('type', 'field_display');
$prj_id = @$_GET['prj_id'];
$role_id = Auth::getCurrentRole();
if ($role_id < User::ROLE_MANAGER) {
    Misc::setMessage(ev_gettext('Sorry, you are not allowed to access this page.'), Misc::MSG_ERROR);
    $tpl->displayTemplate();
    exit;
}
if (count(@$_POST['fields']) > 0) {
    $res = Project::updateFieldDisplaySettings($prj_id, $_POST['fields']);
    $tpl->assign('result', $res);
    Misc::mapMessages($res, array(1 => array(ev_gettext('Thank you, the information was updated successfully.'), Misc::MSG_INFO), -1 => array(ev_gettext('An error occurred while trying to update the information.'), Misc::MSG_ERROR)));
}
$fields = Project::getDisplayFields();
$excluded_roles = array('viewer');
if (!CRM::hasCustomerIntegration($prj_id)) {
Пример #26
0
// |                                                                      |
// | Free Software Foundation, Inc.                                       |
// | 51 Franklin Street, Suite 330                                          |
// | Boston, MA 02110-1301, USA.                                          |
// +----------------------------------------------------------------------+
// | Authors: João Prado Maia <*****@*****.**>                             |
// +----------------------------------------------------------------------+
require_once dirname(__FILE__) . '/../init.php';
$tpl = new Template_Helper();
$tpl->setTemplate('view_note.tpl.html');
Auth::checkAuthentication(APP_COOKIE, 'index.php?err=5', true);
$usr_id = Auth::getUserID();
$note_id = $_GET['id'];
$note = Note::getDetails($note_id);
if ($note == '') {
    $tpl->assign('note', '');
    $tpl->displayTemplate();
    exit;
} else {
    $note['message'] = $note['not_note'];
    $issue_id = Note::getIssueID($note_id);
    $usr_id = Auth::getUserID();
}
if (User::getRoleByUser($usr_id, Issue::getProjectID($issue_id)) < User::getRoleID('Standard User') || !Access::canViewInternalNotes($issue_id, Auth::getUserID())) {
    $tpl->setTemplate('permission_denied.tpl.html');
    $tpl->displayTemplate();
    exit;
}
$note = Note::getDetails($_GET['id']);
$note['message'] = $note['not_note'];
$issue_id = Note::getIssueID($_GET['id']);
Пример #27
0
<?php

/*
 * This file is part of the Eventum (Issue Tracking System) package.
 *
 * @copyright (c) Eventum Team
 * @license GNU General Public License, version 2 or later (GPL-2+)
 *
 * For the full copyright and license information,
 * please see the COPYING and AUTHORS files
 * that were distributed with this source code.
 */
// this file may be called from db_helper, so init already called
if (!defined('APP_PATH')) {
    require_once __DIR__ . '/../init.php';
}
$tpl = new Template_Helper();
if (php_sapi_name() == 'cli') {
    $tpl->setTemplate('offline.tpl.text');
} else {
    $tpl->setTemplate('offline.tpl.html');
}
$tpl->assign('error_type', $error_type);
$tpl->displayTemplate();
Пример #28
0
// | along with this program; if not, write to:                           |
// |                                                                      |
// | Free Software Foundation, Inc.                                       |
// | 51 Franklin Street, Suite 330                                          |
// | Boston, MA 02110-1301, USA.                                          |
// +----------------------------------------------------------------------+
// | Authors: João Prado Maia <*****@*****.**>                             |
// +----------------------------------------------------------------------+
require_once dirname(__FILE__) . '/../init.php';
$tpl = new Template_Helper();
$tpl->setTemplate('post.tpl.html');
if (@$_POST['cat'] == 'report') {
    $res = Issue::addAnonymousReport();
    if ($res != -1) {
        // show direct links to the issue page, issue listing page and email listing page
        $tpl->assign('new_issue_id', $res);
    } else {
        // need to show everything again
        $tpl->assign('error_msg', '1');
    }
} elseif (@$_GET['post_form'] == 'yes') {
    // only list those projects that are allowing anonymous reporting of new issues
    $projects = Project::getAnonymousList();
    if (empty($projects)) {
        $tpl->assign('no_projects', '1');
    } else {
        if (!in_array($_GET['project'], array_keys($projects))) {
            $tpl->assign('no_projects', '1');
        } else {
            // get list of custom fields for the selected project
            $options = Project::getAnonymousPostOptions($_GET['project']);
/*
 * This file is part of the Eventum (Issue Tracking System) package.
 *
 * @copyright (c) Eventum Team
 * @license GNU General Public License, version 2 or later (GPL-2+)
 *
 * For the full copyright and license information,
 * please see the COPYING and AUTHORS files
 * that were distributed with this source code.
 */
require_once __DIR__ . '/../../init.php';
Auth::checkAuthentication();
if (!empty($_REQUEST['iss_id'])) {
    $fields = Custom_Field::getListByIssue(Auth::getCurrentProject(), $_REQUEST['iss_id']);
} else {
    $fields = Custom_Field::getListByProject(Auth::getCurrentProject(), $_REQUEST['form_type']);
}
$data = array();
foreach ($fields as $field) {
    $backend = Custom_Field::getBackend($field['fld_id']);
    if (is_object($backend) && is_subclass_of($backend, 'Dynamic_Custom_Field_Backend')) {
        $field['structured_data'] = $backend->getStructuredData();
        $data[] = $field;
    }
}
header('Content-Type: text/javascript; charset=UTF-8');
$tpl = new Template_Helper();
$tpl->setTemplate('js/dynamic_custom_field.tpl.js');
$tpl->assign('fields', $data);
$tpl->displayTemplate();
Пример #30
0
 * that were distributed with this source code.
 */
require_once __DIR__ . '/../../init.php';
$tpl = new Template_Helper();
$tpl->setTemplate('manage/link_filters.tpl.html');
Auth::checkAuthentication();
$role_id = Auth::getCurrentRole();
if ($role_id < User::ROLE_MANAGER) {
    Misc::setMessage(ev_gettext('Sorry, you are not allowed to access this page.'), Misc::MSG_ERROR);
    $tpl->displayTemplate();
    exit;
}
if (@$_POST['cat'] == 'new') {
    $res = Link_Filter::insert();
    Misc::mapMessages($res, array(1 => array(ev_gettext('Thank you, the link filter was added successfully.'), Misc::MSG_INFO), -1 => array(ev_gettext('An error occurred while trying to add the new link filter.'), Misc::MSG_INFO)));
} elseif (@$_POST['cat'] == 'update') {
    $res = Link_Filter::update();
    Misc::mapMessages($res, array(1 => array(ev_gettext('Thank you, the link filter was updated successfully.'), Misc::MSG_INFO), -1 => array(ev_gettext('An error occurred while trying to update the link filter.'), Misc::MSG_INFO)));
} elseif (@$_POST['cat'] == 'delete') {
    $res = Link_Filter::remove();
    Misc::mapMessages($res, array(1 => array(ev_gettext('Thank you, the link filter was deleted successfully.'), Misc::MSG_INFO), -1 => array(ev_gettext('An error occurred while trying to delete the link filter.'), Misc::MSG_INFO)));
}
if (@$_GET['cat'] == 'edit') {
    $info = Link_Filter::getDetails($_GET['id']);
    $tpl->assign('info', $info);
}
$user_roles = User::getRoles();
$tpl->assign('list', Link_Filter::getList());
$tpl->assign('project_list', Project::getAll());
$tpl->assign('user_roles', $user_roles);
$tpl->displayTemplate();