Author: Kevin Papst
Inheritance: extends Zend_View
Esempio n. 1
0
 /**
  * @return string
  */
 public function getHtml()
 {
     $view = new Kimai_View();
     $view->setScriptPath($this->getTemplateDir() . $this->getTemplateFile());
     // DO NOT RELY ON THESE VARIABLES - they are only here for compatibility with the ODT layer
     $view->assign('CustomerODT', $this->prepareCustomerArray($this->getModel()->getCustomer()));
     $view->assign('project', implode(', ', array_map(function ($project) {
         return $project['name'];
     }, $this->getModel()->getProjects())));
     $data = $this->getModel()->toArray();
     foreach ($data as $key => $value) {
         $view->assign($key, $value);
     }
     // can be used to reference styles and images
     $view->assign('invoiceUrl', 'invoices/' . $this->getTemplateFile() . '/');
     return $view->render($this->getTemplateFilename());
 }
Esempio n. 2
0
File: init.php Progetto: kimai/kimai
<?php

/**
* This file is part of
* Kimai - Open Source Time Tracking // http://www.kimai.org
* (c) Kimai-Development-Team since 2006
*
* Kimai 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; Version 3, 29 June 2007
*
* Kimai 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 Kimai; If not, see <http://www.gnu.org/licenses/>.
*/
// Include Basics
include '../../includes/basics.php';
$user = checkUser();
$view = new Kimai_View();
$view->addBasePath(__DIR__ . '/templates/');
$view->assign('delete_logfile', $kga['delete_logfile']);
$view->assign('kga_sections', array('all' => '', 'plain' => 'plain', 'lang' => 'translations', 'user' => 'user', 'conf' => 'config'));
$view->assign('limitText', sprintf($view->translate('debug:lines'), $kga['logfile_lines']));
if ($kga['logfile_lines'] == "@") {
    $view->assign('limitText', "");
}
echo $view->render('index.php');
Esempio n. 3
0
File: init.php Progetto: kimai/kimai
 * 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 Kimai; If not, see <http://www.gnu.org/licenses/>.
 */
include '../../includes/basics.php';
require "private_func.php";
$user = checkUser();
// ============================================
// = initialize currently displayed timeframe =
// ============================================
$timeframe = get_timeframe();
$in = $timeframe[0];
$out = $timeframe[1];
$view = new Kimai_View();
$view->addBasePath(__DIR__ . '/templates/');
// prevent IE from caching the response
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
$timeformat = 'H:M';
$dateformat = $kga->getDateFormat(1);
$view->assign('timeformat', $timeformat);
$view->assign('dateformat', $dateformat);
echo $view->render('panel.php');
$view->assign('timeformat', preg_replace('/([A-Za-z])/', '%$1', $timeformat));
$users = null;
$customers = null;
if (isset($kga['customer'])) {
Esempio n. 4
0
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; Version 3, 29 June 2007
 *
 * Kimai 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 Kimai; If not, see <http://www.gnu.org/licenses/>.
 */
$isCoreProcessor = 0;
$dir_templates = 'templates/';
require '../../includes/kspi.php';
require 'private_func.php';
$view = new Kimai_View();
$view->addBasePath(__DIR__ . '/templates/');
$filters = explode('|', $axValue);
if (empty($filters[0])) {
    $filterUsers = array();
} else {
    $filterUsers = explode(':', $filters[0]);
}
$filterCustomers = array_map(function ($customer) {
    return $customer['customerID'];
}, $database->get_customers($kga['user']['groups']));
if (!empty($filters[1])) {
    $filterCustomers = array_intersect($filterCustomers, explode(':', $filters[1]));
}
$filterProjects = array_map(function ($project) {
    return $project['projectID'];
Esempio n. 5
0
File: init.php Progetto: kimai/kimai
 *
 * Kimai 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; Version 3, 29 June 2007
 *
 * Kimai 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 Kimai; If not, see <http://www.gnu.org/licenses/>.
 */
include '../../includes/basics.php';
$user = checkUser();
$view = new Kimai_View();
$view->addBasePath(__DIR__ . '/templates/');
// get list of projects for select box
if (isset($kga['customer'])) {
    $view->assign('customers', array($kga['customer']['customerID'] => $kga['customer']['name']));
} else {
    $view->assign('customers', makeSelectBox("customer", $kga['user']['groups']));
}
$tmpCustomers = array_keys($view->customers);
$projects = $database->get_projects_by_customer($tmpCustomers[0], $kga['user']['groups']);
$tmpProjects = array();
foreach ($projects as $project) {
    $tmpProjects[$project['projectID']] = $project['name'];
}
$view->assign('projects', $tmpProjects);
// Select values for Round Time option
Esempio n. 6
0
File: init.php Progetto: kimai/kimai
 * Kimai 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; Version 3, 29 June 2007
 *
 * Kimai 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 Kimai; If not, see <http://www.gnu.org/licenses/>.
 */
// Include Basics
include '../../includes/basics.php';
$user = checkUser();
$view = new Kimai_View();
$view->addBasePath(__DIR__ . '/templates/');
require 'functions.php';
$viewOtherGroupsAllowed = $database->global_role_allows($kga['user']['globalRoleID'], 'core-group-otherGroup-view');
// ========================
// = display groups table =
// ========================
$groupsData = getGroupsData($database, $kga['user'], $viewOtherGroupsAllowed);
foreach ($groupsData as $key => $value) {
    $view->assign($key, $value);
}
$view->tab_groups = $view->render("groups.php");
// ==========================
// = display customer table =
// ==========================
$customersData = getCustomersData($database, $kga['user'], $viewOtherGroupsAllowed);
Esempio n. 7
0
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; Version 3, 29 June 2007
 *
 * Kimai 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 Kimai; If not, see <http://www.gnu.org/licenses/>.
 */
// insert KSPI
$isCoreProcessor = 0;
$dir_templates = "templates";
require '../../includes/kspi.php';
$view = new Kimai_View();
$view->addBasePath(__DIR__ . '/templates/');
require 'functions.php';
switch ($axAction) {
    // =============================
    // = Builds edit-user dialogue =
    // =============================
    case "editUser":
        $userDetails = $database->user_get_data($id);
        $userDetails['rate'] = $database->get_rate($userDetails['userID'], NULL, NULL);
        $view->assign('globalRoles', array());
        foreach ($database->global_roles() as $role) {
            $view->globalRoles[$role['globalRoleID']] = $role['name'];
        }
        $view->assign('memberships', array());
        foreach ($database->getGroupMemberships($id) as $groupId) {
Esempio n. 8
0
 *
 * Kimai 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 Kimai; If not, see <http://www.gnu.org/licenses/>.
 */
/**
 * Show an login window or process the login request. On success the user
 * will be redirected to core/kimai.php.
 */
ob_start();
require_once 'includes/basics.php';
$view = new Kimai_View();
$authPlugin = Kimai_Registry::getAuthenticator();
// current database setup correct?
checkDBversion(".");
// ==========================
// = installation required? =
// ==========================
if (count($database->get_users()) == 0) {
    $view->assign('devtimespan', '2006-' . date('y'));
    if (isset($_REQUEST['disagreedGPL'])) {
        $view->assign('disagreedGPL', 1);
    } else {
        $view->assign('disagreedGPL', 0);
    }
    echo $view->render('install/welcome.php');
    ob_end_flush();
Esempio n. 9
0
File: init.php Progetto: kimai/kimai
<?php

/**
 * This file is part of
 * Kimai - Open Source Time Tracking // http://www.kimai.org
 * (c) Kimai-Development-Team since 2006
 *
 * Kimai 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; Version 3, 29 June 2007
 *
 * Kimai 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 Kimai; If not, see <http://www.gnu.org/licenses/>.
 */
include '../../includes/basics.php';
$user = checkUser();
$view = new Kimai_View();
$view->addBasePath(__DIR__ . '/templates/');
// track which activities we want to see, so we can exclude them when we create the plot
$view->assign('kga', $kga);
echo $view->render('index.php');