コード例 #1
0
$str[] = "<tr><td>" . $rtn["date"] . " </td><td class='nobr bold'> " . $rtn["duration"] . " " . $rtn["unit"] . "</td><td class='nobr'>&times; " . $rtn["multiplier"] . "</td></tr>";
$rtn["taskID"] and $str[] = "<tr><td colspan='3'>" . $rtn["taskID"] . "</td></tr>";
$rtn["comment"] and $str[] = "<tr><td colspan='3'>" . $rtn["comment"] . "</td></tr>";
if (isset($_REQUEST["save"]) && isset($_REQUEST["time_item"])) {
    $t = timeSheetItem::parse_time_string($_REQUEST["time_item"]);
    if (!is_numeric($t["duration"])) {
        $status = "bad";
        $extra = "Time not added. Duration not found.";
    } else {
        if (!is_numeric($t["taskID"])) {
            $status = "bad";
            $extra = "Time not added. Task not found.";
        }
    }
    if ($status != "bad") {
        $timeSheet = new timeSheet();
        $tsi_row = $timeSheet->add_timeSheetItem($t);
        if ($TPL["message"]) {
            $status = "bad";
            $extra = "Time not added.<br>" . implode("<br>", $TPL["message"]);
        } else {
            $status = "good";
            $tsid = $tsi_row["message"];
            $extra = "Added time to time sheet <a href='" . $TPL["url_alloc_timeSheet"] . "timeSheetID=" . $tsid . "'>#" . $tsid . "</a>";
        }
    }
}
#$extra and array_unshift($str, "<tr><td colspan='3' class='".$status." bold'>".$extra."</td></tr>");
$extra and $str[] = "<tr><td colspan='3' class='" . $status . " bold'>" . $extra . "</td></tr>";
print alloc_json_encode(array("status" => $status, "table" => "<table class='" . $status . "'>" . implode("\n", $str) . "</table>"));
コード例 #2
0
<?php

/*
 * Copyright (C) 2006-2011 Alex Lance, Clancy Malcolm, Cyber IT Solutions
 * Pty. Ltd.
 * 
 * This file is part of the allocPSA application <*****@*****.**>.
 * 
 * allocPSA is free software: you can redistribute it and/or modify it
 * under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or (at
 * your option) any later version.
 * 
 * allocPSA 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 Affero General Public
 * License for more details.
 * 
 * You should have received a copy of the GNU Affero General Public License
 * along with allocPSA. If not, see <http://www.gnu.org/licenses/>.
*/
define("NO_REDIRECT", 1);
require_once "../alloc.php";
if ($_GET["project"] && $_GET["person"]) {
    $rate = projectPerson::get_rate($_GET["project"], $_GET["person"]);
    $project = new project($_GET["project"]);
    $currency = $project->get_value("currencyTypeID") or $currency = config::get_config_item("currency");
    $rate['rate'] = page::money($currency, $rate['rate'], '%mo');
    echo alloc_json_encode($rate);
}
コード例 #3
0
ファイル: json.php プロジェクト: cjbayliss/alloc
                        echo alloc_json_encode($services->{$method}($a[0], $a[1], $a[2], $a[3], $a[4], $a[5]));
                    } else {
                        if ($n == 5) {
                            echo alloc_json_encode($services->{$method}($a[0], $a[1], $a[2], $a[3], $a[4]));
                        } else {
                            if ($n == 4) {
                                echo alloc_json_encode($services->{$method}($a[0], $a[1], $a[2], $a[3]));
                            } else {
                                if ($n == 3) {
                                    echo alloc_json_encode($services->{$method}($a[0], $a[1], $a[2]));
                                } else {
                                    if ($n == 2) {
                                        echo alloc_json_encode($services->{$method}($a[0], $a[1]));
                                    } else {
                                        if ($n == 1) {
                                            echo alloc_json_encode($services->{$method}($a[0]));
                                        } else {
                                            if ($n == 0) {
                                                echo alloc_json_encode($services->{$method}());
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
コード例 #4
0
ファイル: updateTimeGraph.php プロジェクト: cjbayliss/alloc
<?php

/*
 * Copyright (C) 2006-2011 Alex Lance, Clancy Malcolm, Cyber IT Solutions
 * Pty. Ltd.
 * 
 * This file is part of the allocPSA application <*****@*****.**>.
 * 
 * allocPSA is free software: you can redistribute it and/or modify it
 * under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or (at
 * your option) any later version.
 * 
 * allocPSA 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 Affero General Public
 * License for more details.
 * 
 * You should have received a copy of the GNU Affero General Public License
 * along with allocPSA. If not, see <http://www.gnu.org/licenses/>.
*/
define("NO_REDIRECT", 1);
require_once "../alloc.php";
$current_user =& singleton("current_user");
$num_days_back = 28;
$start = date("Y-m-d", mktime() - 60 * 60 * 24 * $num_days_back);
$points = timeSheetItem::get_total_hours_worked_per_day($current_user->get_id(), $start);
print alloc_json_encode(array("status" => "good", "points" => $points));