/**
  * Method used to output the headers and the binary data for
  * an attachment file.
  *
  * This method never returns to caller.
  *
  * @param   string $data The binary data of this file download
  * @param   string $filename The filename
  * @param   integer $filesize The size of this file
  * @param   string $mimetype The mimetype of this file
  * @param   boolean $force_inline If the file should be forced to render in the browser
  * @return  void
  */
 public static function outputDownload(&$data, $filename, $filesize, $mimetype, $force_inline = false)
 {
     if ($force_inline == true) {
         header('Content-Type: text/plain');
         if (stristr($mimetype, 'gzip')) {
             header('Content-Encoding: gzip');
         }
         header('Content-Disposition: inline; filename="' . urlencode($filename) . '"');
         header('Content-Length: ' . $filesize);
         echo $data;
         exit;
     }
     if (empty($mimetype)) {
         $mimetype = 'application/octet-stream';
     }
     if (empty($filename)) {
         $filename = ev_gettext('Untitled');
     }
     $disposition = self::displayInline($mimetype) ? 'inline' : 'attachment';
     $filename = rawurlencode($filename);
     header('Content-Type: ' . $mimetype);
     header("Content-Disposition: {$disposition}; filename=\"{$filename}\"; filename*=" . APP_CHARSET . "''{$filename}");
     header("Content-Length: {$filesize}");
     echo $data;
     exit;
 }
function smarty_function_get_display_label($params, &$smarty)
{
    $print_result = true;
    $show = ev_gettext('show');
    $hide = ev_gettext('hide');
    extract($params);
    $cookie_name = 'visibility_' . $element_name;
    if (!empty($_COOKIE[$cookie_name])) {
        if ($_COOKIE[$cookie_name] == 'none') {
            $html_result = $show;
        } else {
            $html_result = $hide;
        }
    } else {
        $html_result = $hide;
    }
    // automatically hide the table if there is nothing to be displayed
    if (isset($total)) {
        if ($total < 1) {
            $html_result = $show;
        }
    }
    if ($print_result) {
        print $html_result;
    } else {
        return $html_result;
    }
}
 private function markAsDuplicateAction()
 {
     $res = Issue::markAsDuplicate($this->issue_id);
     $map = array(1 => array(ev_gettext('Thank you, the issue was marked as a duplicate successfully'), Misc::MSG_INFO), -1 => array(ev_gettext('Sorry, an error happened while trying to run your query.'), Misc::MSG_ERROR));
     Misc::mapMessages($res, $map);
     $this->redirect(APP_RELATIVE_URL . 'view.php', array('id' => $this->issue_id));
 }
 /**
  * @inheritdoc
  */
 protected function defaultAction()
 {
     AuthCookie::setProjectCookie($this->prj_id);
     Misc::setMessage(ev_gettext('The project has been switched'), Misc::MSG_INFO);
     $url = $this->getRedirectUrl();
     $this->redirect($url);
 }
Example #5
0
 private static function getLocalizedRoles()
 {
     if (self::$localized_roles === null) {
         foreach (self::$roles as $id => $role) {
             self::$localized_roles[$id] = ev_gettext($role);
         }
     }
     return self::$localized_roles;
 }
 private function updateReporterAction()
 {
     $post = $this->getRequest()->request;
     $email = trim($post->get('email'));
     $res = Edit_Reporter::update($this->issue_id, $email);
     $map = 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));
     Misc::mapMessages($res, $map);
     $this->redirect(APP_RELATIVE_URL . 'view.php', array('id' => $this->issue_id));
 }
Example #7
0
 private static function getTopics()
 {
     if (self::$topics !== null) {
         return self::$topics;
     }
     // we need this in function as function calls are not allowed in static properties
     self::$topics = array('main' => array('title' => ev_gettext('Help Topics'), 'parent' => ''), 'report' => array('title' => ev_gettext('Reporting Issues'), 'parent' => 'main'), 'report_category' => array('title' => ev_gettext('Category Field'), 'parent' => 'report'), 'report_priority' => array('title' => ev_gettext('Priority Field'), 'parent' => 'report'), 'report_assignment' => array('title' => ev_gettext('Assignment Field'), 'parent' => 'report'), 'report_release' => array('title' => ev_gettext('Scheduled Release Field'), 'parent' => 'report'), 'report_summary' => array('title' => ev_gettext('Summary Field'), 'parent' => 'report'), 'report_description' => array('title' => ev_gettext('Description Field'), 'parent' => 'report'), 'report_estimated_dev_time' => array('title' => ev_gettext('Estimated Development Time Field'), 'parent' => 'report'), 'scm_integration' => array('title' => ev_gettext('SCM Integration'), 'parent' => 'main'), 'scm_integration_usage' => array('title' => ev_gettext('Usage Examples'), 'parent' => 'scm_integration'), 'scm_integration_installation' => array('title' => ev_gettext('Installation Instructions'), 'parent' => 'scm_integration'), 'list' => array('title' => ev_gettext('Listing / Searching for Issues'), 'parent' => 'main'), 'adv_search' => array('title' => ev_gettext('Advanced Search / Creating Custom Queries'), 'parent' => 'main'), 'support_emails' => array('title' => ev_gettext('Associate Emails'), 'parent' => 'main'), 'preferences' => array('title' => ev_gettext('Account Preferences'), 'parent' => 'main'), 'notifications' => array('title' => ev_gettext('Email Notifications'), 'parent' => 'main'), 'view' => array('title' => ev_gettext('Viewing Issues'), 'parent' => 'main'), 'email_blocking' => array('title' => ev_gettext('Email Blocking'), 'parent' => 'main'), 'link_filters' => array('title' => ev_gettext('Link Filters'), 'parent' => 'main'), 'field_display' => array('title' => ev_gettext('Edit Fields to Display'), 'parent' => 'main'), 'column_display' => array('title' => ev_gettext('Edit Columns to Display'), 'parent' => 'main'), 'customize_listing' => array('title' => ev_gettext('Customize Issue Listing Screen'), 'parent' => 'main'), 'segregate_reporter' => array('title' => ev_gettext('Segregate Reporters'), 'parent' => 'main'), 'permission_levels' => array('title' => ev_gettext('User Permission Levels'), 'parent' => 'main'));
     return self::$topics;
 }
Example #8
0
 private function checkRequirements()
 {
     $errors = array();
     // check if templates_c is writable by the web server user
     if (!Misc::isWritableDirectory($dir = APP_TPL_COMPILE_PATH)) {
         $errors[] = ev_gettext('Directory "%1$s" is not writable.', $dir);
         Misc::displayRequirementErrors($errors);
         exit;
     }
 }
 private function attachmentAction()
 {
     $file = Attachment::getDetails($this->iaf_id);
     if (!$file) {
         $this->error(ev_gettext('No such attachment'));
     }
     if (!Issue::canAccess($file['iat_iss_id'], $this->usr_id)) {
         $this->error(ev_gettext('No access to requested attachment'));
     }
     Attachment::outputDownload($file['iaf_file'], $file['iaf_filename'], $file['iaf_filesize'], $file['iaf_filetype'], $this->force_inline);
     exit;
 }
Example #10
0
 private function createVisitorAccountAction()
 {
     $setup = Setup::get();
     if ($setup['open_signup'] != 'enabled') {
         $error = ev_gettext('Sorry, but this feature has been disabled by the administrator.');
         $this->error($error);
     }
     $res = User::createVisitorAccount($setup['accounts_role'], $setup['accounts_projects']);
     $this->tpl->assign('signup_result', $res);
     //  TODO: translate
     $map = array(1 => array('Thank you, your account creation request was processed successfully. For security reasons a confirmation email was sent to the provided email address with instructions on how to confirm your request and activate your account.', Misc::MSG_INFO), -1 => array('Error: An error occurred while trying to run your query.', Misc::MSG_ERROR), -2 => array('Error: The email address specified is already associated with an user in the system.', Misc::MSG_ERROR));
     Misc::mapMessages($res, $map);
 }
 /**
  * @inheritdoc
  */
 protected function defaultAction()
 {
     if (User::isClockedIn($this->usr_id)) {
         User::ClockOut($this->usr_id);
         $message = ev_gettext('You have been clocked out');
     } else {
         User::ClockIn($this->usr_id);
         $message = ev_gettext('You have been clocked in');
     }
     Misc::setMessage($message, Misc::MSG_INFO);
     $url = $this->url ?: APP_RELATIVE_URL . 'list.php';
     $this->redirect($url);
 }
 /**
  * @inheritdoc
  */
 protected function prepareTemplate()
 {
     $note = Note::getDetails($this->note_id);
     if (!$note) {
         $this->tpl->assign('note', '');
         return;
     }
     $note['message'] = $note['not_note'];
     $seq_no = Note::getNoteSequenceNumber($this->issue_id, $this->note_id);
     // TRANSLATORS: %1: note sequence number, %2: note title
     $extra_title = ev_gettext('Note #%1$s: %2$s', $seq_no, $note['not_title']);
     $this->tpl->assign(array('note' => $note, 'issue_id' => $this->issue_id, 'extra_title' => $extra_title, 'recipients' => Mail_Queue::getMessageRecipients('notes', $this->note_id)));
     $this->setSideLinks();
 }
Example #13
0
 /**
  * Method used to get the list of changes made against a specific issue.
  *
  * @param   integer $iss_id The issue ID
  * @param   string $order_by The order to sort the history
  * @return  array The list of changes
  */
 public static function getListing($iss_id, $order_by = 'DESC')
 {
     $order_by = DB_Helper::orderBy($order_by);
     $stmt = "SELECT\n                    *\n                 FROM\n                    {{%issue_history}},\n                    {{%history_type}}\n                 WHERE\n                    htt_id = his_htt_id AND\n                    his_is_hidden != 1 AND\n                    his_iss_id=? AND\n                    his_min_role <= ?\n                 ORDER BY\n                    his_id {$order_by}";
     $params = array($iss_id, Auth::getCurrentRole());
     try {
         $res = DB_Helper::getInstance()->getAll($stmt, $params);
     } catch (DbException $e) {
         return '';
     }
     foreach ($res as &$row) {
         $row['his_summary'] = Misc::processTokens(ev_gettext($row['his_summary']), $row['his_context']);
     }
     return $res;
 }
Example #14
0
 /**
  * Generate options for assign list.
  * If there are groups and user is above a customer, include groups
  *
  * @param array $users
  * @return array
  */
 public function getAssignOptions($users)
 {
     $assign_options = array('' => ev_gettext('Any'), '-1' => ev_gettext('un-assigned'), '-2' => ev_gettext('myself and un-assigned'));
     if (Auth::isAnonUser()) {
         unset($assign_options['-2']);
     } elseif (User::getGroupID($this->usr_id)) {
         $assign_options['-3'] = ev_gettext('myself and my group');
         $assign_options['-4'] = ev_gettext('myself, un-assigned and my group');
     }
     if (Auth::getCurrentRole() > User::ROLE_CUSTOMER && ($groups = Group::getAssocList($this->prj_id))) {
         foreach ($groups as $grp_id => $grp_name) {
             $assign_options["grp:{$grp_id}"] = ev_gettext('Group') . ': ' . $grp_name;
         }
     }
     return $assign_options + $users;
 }
Example #15
0
// |                                                                      |
// | 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('manage/email_alias.tpl.html');
Auth::checkAuthentication(APP_COOKIE, null, true);
$role_id = Auth::getCurrentRole();
if ($role_id < User::getRoleID('manager')) {
    $tpl->setTemplate('permission_denied.tpl.html');
    $tpl->displayTemplate();
    exit;
}
$usr_id = $_REQUEST['id'];
if (@$_POST['cat'] == 'save') {
    $res = User::addAlias($usr_id, trim($_POST['alias']));
    Misc::mapMessages($res, array(true => array(ev_gettext('Thank you, the alias was added successfully.'), Misc::MSG_INFO), false => array(ev_gettext('An error occurred while trying to add the alias.'), Misc::MSG_ERROR)));
} elseif (@$_POST['cat'] == 'remove') {
    foreach ($_POST['item'] as $aliastmp) {
        $res = User::removeAlias($usr_id, $aliastmp);
    }
    Misc::mapMessages($res, array(true => array(ev_gettext('Thank you, the alias was removed successfully.'), Misc::MSG_INFO), false => array(ev_gettext('An error occurred while trying to remove the alias.'), Misc::MSG_ERROR)));
}
$tpl->assign('list', User::getAliases($usr_id));
$tpl->assign('username', User::getFullName($usr_id));
$tpl->assign('id', $usr_id);
$tpl->displayTemplate();
Example #16
0
 /**
  * Retrieves the last status change date for the given issue.
  *
  * @param   integer $prj_id The project ID
  * @param   array $result The associative array of data
  * @see     Search::getListing()
  */
 public static function getLastStatusChangeDates($prj_id, &$result)
 {
     $ids = array();
     foreach ($result as $res) {
         $ids[] = $res['iss_sta_id'];
     }
     if (!$ids) {
         return;
     }
     $customizations = Status::getProjectStatusCustomization($prj_id, $ids);
     foreach ($result as &$row) {
         if (empty($row['iss_sta_id'])) {
             $row['status_change_date'] = '';
             continue;
         }
         list($label, $date_field_name) = @$customizations[$row['iss_sta_id']];
         if (empty($label) || empty($date_field_name)) {
             $row['status_change_date'] = '';
             continue;
         }
         // TRANSLATORS: %1 = label, %2 = date diff
         $desc = ev_gettext('%1$s: %2$s ago');
         $target_date = $row[$date_field_name];
         if (empty($target_date)) {
             $row['status_change_date'] = '';
             continue;
         }
         $dateDiff = Date_Helper::getFormattedDateDiff(time(), $target_date);
         $row['status_change_date'] = sprintf($desc, $label, $dateDiff);
     }
 }
Example #17
0
 private function addTimeEntry()
 {
     $post = $this->getRequest()->request;
     $date = (array) $post->get('date');
     $ttc_id = $post->getInt('category');
     $time_spent = $post->getInt('time_spent');
     $summary = ev_gettext('Time entry inserted when closing issue.');
     Time_Tracking::addTimeEntry($this->issue_id, $ttc_id, $time_spent, $date, $summary);
 }
Example #18
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();
Example #19
0
 /**
  * Generates a graph for workload by date range report.
  *
  * @param string $graph
  * @param string $type
  * @param string $start_date
  * @param string $end_date
  * @param $interval
  * @return bool
  */
 public function WorkloadDateRangeGraph($graph, $type, $start_date, $end_date, $interval)
 {
     $data = Session::get('workload_date_range_data');
     if (empty($data)) {
         return false;
     }
     switch ($interval) {
         case 'dow':
             $x_title = ev_gettext('Day of Week');
             break;
         case 'week':
             $x_title = ev_gettext('Week');
             break;
         case 'dom':
             $x_title = ev_gettext('Day of Month');
             break;
         case 'day':
             $x_title = ev_gettext('Day');
             break;
         case 'month':
             $x_title = ev_gettext('Month');
             break;
         default:
             return false;
     }
     switch ($graph) {
         case 'issue':
             $plots = array_values($data['issues']['points']);
             $graph_title = ev_gettext('Issues by created date %s through %s', $start_date, $end_date);
             $labels = array_keys($data['issues']['points']);
             $y_label = ev_gettext('Issues');
             break;
         case 'email':
             $plots = array_values($data['emails']['points']);
             $graph_title = ev_gettext('Emails by sent date %s through %s', $start_date, $end_date);
             $labels = array_keys($data['emails']['points']);
             $y_label = ev_gettext('Emails');
             break;
         case 'note':
             $plots = array_values($data['notes']['points']);
             $graph_title = ev_gettext('Notes by sent date %s through %s', $start_date, $end_date);
             $labels = array_keys($data['notes']['points']);
             $y_label = ev_gettext('Notes');
             break;
         case 'phone':
             $plots = array_values($data['phone']['points']);
             $graph_title = ev_gettext('Phone calls by date %s through %s', $start_date, $end_date);
             $labels = array_keys($data['phone']['points']);
             $y_label = ev_gettext('Phone Calls');
             break;
         case 'time_spent':
             $plots = array_values($data['time_spent']['points']);
             $graph_title = ev_gettext('Time spent (hrs) %s through %s', $start_date, $end_date);
             $labels = array_keys($data['time_spent']['points']);
             $y_label = ev_gettext('Hours');
             break;
         case 'avg_time_per_issue':
             $plots = array_values($data['avg_time_per_issue']['points']);
             $graph_title = ev_gettext('Avg. Time spent per issue (min) %s through %s', $start_date, $end_date);
             $labels = array_keys($data['avg_time_per_issue']['points']);
             $y_label = ev_gettext('Minutes');
             break;
         default:
             return false;
     }
     if (count($plots) < 1) {
         return false;
     }
     // convert to phplot format
     $plotData = array();
     foreach ($plots as $i => $plot) {
         $plotData[] = array($labels[$i], $plot);
     }
     if ($type == 'pie') {
         $plot = $this->create(500, 300);
         $plot->SetPlotType('pie');
         $plot->SetDataType('text-data-single');
         $plot->SetLegend($labels);
     } else {
         $plot = $this->create(500, 350);
         $plot->SetPlotType('bars');
         $plot->SetDataType('text-data');
         $plot->SetYTitle($y_label);
         $plot->SetXTitle($x_title);
         $plot->SetYDataLabelPos('plotin');
     }
     $plot->SetTitle($graph_title);
     $plot->SetImageBorderType('plain');
     $plot->SetDataValues($plotData);
     return $plot->DrawGraph();
 }
Example #20
0
/*
 * 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/private_key.tpl.html');
Auth::checkAuthentication();
$role_id = Auth::getCurrentRole();
if ($role_id < User::ROLE_ADMINISTRATOR) {
    Misc::setMessage(ev_gettext('Sorry, you are not allowed to access this page.'), Misc::MSG_ERROR);
    $tpl->displayTemplate();
    exit;
}
$cat = isset($_POST['cat']) ? (string) $_POST['cat'] : null;
if ($cat == 'update') {
    // regenerate key
    try {
        Auth::generatePrivateKey();
        Misc::setMessage(ev_gettext('Thank you, the private key was regenerated.'));
    } catch (Exception $e) {
        Misc::setMessage(ev_gettext('Private key regeneration error. Check server error logs.'), Misc::MSG_ERROR);
    }
}
$tpl->displayTemplate();
Example #21
0
$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;
@($prj_id = $_POST['prj_id'] ? $_POST['prj_id'] : $_GET['prj_id']);
if (!empty($prj_id)) {
    $tpl->assign('status_list', Status::getAssocStatusList($prj_id, true));
    $tpl->assign('project_id', $prj_id);
    $display_customer_fields = CRM::hasCustomerIntegration($prj_id);
}
$tpl->assign('date_fields', Issue::getDateFieldsAssocList($display_customer_fields));
$tpl->assign('project_list', Project::getAll());
$tpl->assign('list', Status::getCustomizationList());
Example #22
0
// | 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)) {
    $excluded_roles[] = 'customer';
}
$user_roles = User::getRoles($excluded_roles);
$user_roles[9] = 'Never Display';
$tpl->assign('prj_id', $prj_id);
$tpl->assign('fields', $fields);
$tpl->assign('user_roles', $user_roles);
$tpl->assign('display_settings', Project::getFieldDisplaySettings($prj_id));
$tpl->displayTemplate();
Example #23
0
        $new_issue_message = $customer->getNewIssueMessage();
        if ($new_issue_message) {
            Misc::setMessage($new_issue_message, Misc::MSG_INFO);
        }
    }
}
$cat = isset($_POST['cat']) ? (string) $_POST['cat'] : (isset($_GET['cat']) ? (string) $_GET['cat'] : null);
if ($cat == 'report') {
    $res = Issue::createFromPost();
    if ($res != -1) {
        // redirect to view issue page
        Misc::setMessage(ev_gettext('Your issue was created successfully.'));
        Auth::redirect(APP_BASE_URL . 'view.php?id=' . $res);
    } else {
        // need to show everything again
        Misc::setMessage(ev_gettext('There was an error creating your issue.'), Misc::MSG_ERROR);
        $tpl->assign('error_msg', '1');
    }
}
if ($cat == 'associate') {
    $item = isset($_GET['item']) ? (array) $_GET['item'] : null;
    if (count($item) > 0) {
        $res = Support::getListDetails($item);
        $tpl->assign('emails', $res);
        $tpl->assign('attached_emails', @implode(',', $item));
        if (CRM::hasCustomerIntegration($prj_id)) {
            $crm = CRM::getInstance($prj_id);
            // also need to guess the contact_id from any attached emails
            try {
                $info = $crm->getCustomerInfoFromEmails($prj_id, $item);
                $tpl->assign(array('customer_id' => $info['customer_id'], 'customer_name' => $info['customer_name'], 'contact_id' => $info['contact_id'], 'contact_name' => $info['contact_name'], 'contacts' => $info['contacts']));
<?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.
 */
/**
 * Decode attachment filenames from QuotedPrintable MIME encoding.
 * Also set Untitled.jpg to unnamed attachments (Usually inline).
 */
/** @var DbInterface $db */
// Attachments that need to be decoded
$res = $db->getAll('SELECT iaf_id, iaf_filename FROM {{%issue_attachment_file}} WHERE iaf_filename LIKE ?', array('%=?%'));
foreach ($res as $idx => $row) {
    $iaf_filename = Mime_Helper::decodeQuotedPrintable($row['iaf_filename']);
    $db->query('UPDATE {{%issue_attachment_file}} ' . 'SET iaf_filename=? ' . 'WHERE iaf_id=?', array($iaf_filename, $row['iaf_id']));
}
// Unnamed attachments
$res = $db->getAll("SELECT iaf_id, iaf_filetype FROM {{%issue_attachment_file}} WHERE iaf_filename=''");
foreach ($res as $idx => $row) {
    list($type, $ext) = explode('/', $row['iaf_filetype']);
    $iaf_filename = ev_gettext('Untitled.%s', $ext);
    $db->query('UPDATE {{%issue_attachment_file}} ' . 'SET iaf_filename=? ' . 'WHERE iaf_id=?', array($iaf_filename, $row['iaf_id']));
}
Example #25
0
if (!Access::canAccessReports(Auth::getUserID())) {
    echo 'Invalid role';
    exit;
}
$prj_id = Auth::getCurrentProject();
// get list of fields and convert info useful arrays
$fields = Custom_Field::getListByProject($prj_id, '');
$custom_fields = array();
$options = array();
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']);
}
 private function deleteAction()
 {
     $post = $this->getRequest()->request;
     $res = Notification::remove($post->get('items'));
     if ($res == 1) {
         Misc::setMessage(ev_gettext('Thank you, the items have been deleted.'));
     }
 }
Example #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.
 */
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();
Example #28
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/resolution.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 = Resolution::insert();
    Misc::mapMessages($res, array(1 => array(ev_gettext('Thank you, the issue resolution was added successfully.'), Misc::MSG_INFO), -1 => array(ev_gettext('An error occurred while trying to add the new issue resolution.'), Misc::MSG_INFO), -2 => array(ev_gettext('Please enter the title for this new issue resolution.'), Misc::MSG_ERROR)));
} elseif (@$_POST['cat'] == 'update') {
    $res = Resolution::update();
    Misc::mapMessages($res, array(1 => array(ev_gettext('Thank you, the issue resolution was updated successfully.'), Misc::MSG_INFO), -1 => array(ev_gettext('An error occurred while trying to update the new issue resolution.'), Misc::MSG_INFO), -2 => array(ev_gettext('Please enter the title for this new issue resolution.'), Misc::MSG_ERROR)));
} elseif (@$_POST['cat'] == 'delete') {
    Resolution::remove();
}
if (@$_GET['cat'] == 'edit') {
    $tpl->assign('info', Resolution::getDetails($_GET['id']));
}
$tpl->assign('list', Resolution::getList());
$tpl->displayTemplate();
Example #29
0
$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') {
    $tpl->assign('info', Time_Tracking::getCategoryDetails($_GET['id']));
}
$tpl->assign('list', Time_Tracking::getCategoryList($prj_id));
$tpl->displayTemplate();
Example #30
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();