function render() { $current_user =& singleton("current_user"); global $TPL; $ops["showShortProjectLink"] = "true"; $ops["personID"] = $current_user->get_id(); $ops["status"] = array('edit', 'manager', 'admin', 'invoiced', 'rejected'); $rtn = timeSheet::get_list($ops); $TPL["timeSheetListRows"] = $rtn["rows"]; $TPL["timeSheetListExtra"] = $rtn["extra"]; if ($TPL["timeSheetListRows"]) { return true; } }
* 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/>. */ require_once "../alloc.php"; function show_filter() { global $TPL; global $defaults; $_FORM = timeSheet::load_form_data($defaults); $arr = timeSheet::load_timeSheet_filter($_FORM); is_array($arr) and $TPL = array_merge($TPL, $arr); include_template("templates/timeSheetListFilterS.tpl"); } $defaults = array("url_form_action" => $TPL["url_alloc_timeSheetList"], "form_name" => "timeSheetList_filter", "showFinances" => $_REQUEST["showFinances"], "dateFromComparator" => ">=", "dateToComparator" => "<="); $_FORM = timeSheet::load_form_data($defaults); $rtn = timeSheet::get_list($_FORM); $TPL["timeSheetListRows"] = $rtn["rows"]; $TPL["timeSheetListExtra"] = $rtn["extra"]; if (!$current_user->prefs["timeSheetList_filter"]) { $TPL["message_help"][] = "\n\nallocPSA allows you to record the time that you've worked on various\nProjects using Time Sheets. This page allows you to view a list of Time Sheets. \n\n<br><br>\n\nSimply adjust the filter settings and click the <b>Filter</b> button to\ndisplay a list of previously created Time Sheets. \nIf you would prefer to create a new Time Sheet, click the <b>New Time Sheet</b> link\nin the top-right hand corner of the box below."; } $TPL["main_alloc_title"] = "Timesheet List - " . APPLICATION_NAME; include_template("templates/timeSheetListM.tpl");
} $TPL["total_invoice_transactions_pending"] = page::money_print($rows); $q = prepare("SELECT SUM((amount * pow(10,-currencyType.numberToBasic))) \n AS amount, transaction.currencyTypeID as currency\n FROM transaction\n LEFT JOIN invoiceItem on invoiceItem.invoiceItemID = transaction.invoiceItemID\n LEFT JOIN invoice on invoice.invoiceID = invoiceItem.invoiceID\n LEFT JOIN currencyType on currencyType.currencyTypeID = invoice.currencyTypeID\n WHERE invoice.projectID = %d\n AND transaction.status = 'approved'\n GROUP BY transaction.currencyTypeID\n ", $project->get_id()); $db->query($q); unset($rows); while ($row = $db->row()) { $rows[] = $row; } $TPL["total_invoice_transactions_approved"] = page::money_print($rows); $q = prepare("SELECT SUM((amount * pow(10,-currencyType.numberToBasic))) \n AS amount, transaction.currencyTypeID as currency\n FROM transaction\n LEFT JOIN currencyType on currencyType.currencyTypeID = transaction.currencyTypeID\n WHERE transaction.projectID = %d\n AND transaction.status = 'approved'\n GROUP BY transaction.currencyTypeID\n ", $project->get_id()); $db->query($q); unset($rows); while ($row = $db->row()) { $rows[] = $row; } $TPL["total_expenses_transactions_approved"] = page::money_print($rows); if ($project->get_id()) { $defaults["projectID"] = $project->get_id(); $defaults["showFinances"] = true; if (!$project->have_perm(PERM_READ_WRITE)) { $defaults["personID"] = $current_user->get_id(); } $rtn = timeSheet::get_list($defaults); $TPL["timeSheetListRows"] = $rtn["rows"]; $TPL["timeSheetListExtra"] = $rtn["extra"]; } if ($project->have_perm(PERM_READ_WRITE)) { include_template("templates/projectFormM.tpl"); } else { include_template("templates/projectViewM.tpl"); }