📄 load.inc
字号:
<?php/** * @copyright Intermesh 2004 * @author Merijn Schering <mschering@intermesh.nl> * @version $Revision: 1.54 $ $Date: 2006/04/10 13:21:11 $ * * 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. */$show_period = isset($_POST['show_period']) ? $_POST['show_period'] : 'all';$load_user_id = isset($_POST['load_user_id']) ? $_POST['load_user_id'] : $GO_SECURITY->user_id;$load_type = isset($_POST['load_type']) ? $_POST['load_type'] : 'project';$print = (isset($_POST['print']) && $_POST['print'] == 'true') ? true : false;$project_id = isset($_POST['project_id']) ? $_POST['project_id'] : '0';$time = get_time();$this_day = date("j", $time);$this_year = date("Y", $time);$this_month = date("m", $time);$month = isset($_POST['month']) ? $_POST['month'] : $this_month;$year = isset($_POST['year']) ? $_POST['year'] : $this_year;$module_url = isset($projects_module) ? $projects_module['url'] : $GO_MODULES->url;if (isset($_REQUEST['delete_hours'])){ if ($working_hours = $projects->get_working_hours($_REQUEST['delete_hours'])) { if($_project = $projects->get_project($working_hours['project_id'])) { if ($GO_SECURITY->has_permission($GO_SECURITY->user_id, $_project['acl_write'])) { $projects->delete_hours($_REQUEST['delete_hours']); }else { $feedback = $strAccessDenied; } } }}if ($project_id== 0 && $ab_module){ $load_id = isset($_POST['load_id']['value']) ? $_POST['load_id']['value'] : '0'; $load_type = isset($_POST['load_id']['type']) ? $_POST['load_id']['type'] : 'contact'; }else{ $load_id=$project_id; $load_type='project';}$load_user_id = isset($_REQUEST['load_user_id']['value']) ? $_REQUEST['load_user_id']['value'] : 0;if (!$print){ $container->add_html_element(new html_element('h3', $pm_load_type.':')); $table = new table(); if ($project_id ==0 && $ab_module) { $select = new object_select($load_type, 'projects_form', 'load_id', $load_id, array('contact','company','project')); $row = new table_row(); $row->add_cell(new table_cell($select->get_link($strRelatedTo).':')); $row->add_cell(new table_cell($select->get_field())); $table->add_row($row); } if ($GO_MODULES->write_permission) { $select = new object_select('user', 'projects_form', 'load_user_id', $load_user_id); $row = new table_row(); $row->add_cell(new table_cell($select->get_link($pm_employee).':')); $row->add_cell(new table_cell($select->get_field())); $table->add_row($row); }else { $row = new table_row(); $checkbox = new checkbox('load_user_id', 'load_user_id', $GO_SECURITY->user_id, $pm_yours_only, $load_user_id); $cell = new table_cell($checkbox->get_html()); $cell->set_attribute('colspan','2'); $row->add_cell($cell); $table->add_row($row); } $container->add_html_element($table); $container->add_html_element(new html_element('h3', $pm_load_period.':')); $container->add_html_element(new input('hidden', 'delete_hours')); $container->add_html_element(new input('hidden', 'booking_id')); $container->add_html_element(new input('hidden', 'print')); $table = new table(); $radiogroup = new radiogroup('show_period', $show_period); $row = new table_row(); $cell = new table_cell($radiogroup->get_option(new radiobutton('all', 'all'), $pm_show_all)); $cell->set_attribute('colspan','2'); $row->add_cell($cell); $table->add_row($row); $row = new table_row(); $row->add_cell(new table_cell($radiogroup->get_option(new radiobutton('period', 'period'), $pm_show_period))); $date = date($_SESSION['GO_SESSION']['date_format'], $time); $start_date = isset($_POST['start_date']) ? $_POST['start_date'] : $date; $start_datepicker = new date_picker('start_date', $_SESSION['GO_SESSION']['date_format'], $start_date); $end_date = isset($_POST['end_date']) ? $_POST['end_date'] : $date; $end_datepicker = new date_picker('end_date', $_SESSION['GO_SESSION']['date_format'], $end_date); $row->add_cell(new table_cell($start_datepicker->get_html().' '.$pm_to.' '.$end_datepicker->get_html())); $table->add_row($row); $row = new table_row(); $row->add_cell(new table_cell($radiogroup->get_option(new radiobutton('month', 'month'), $pm_show_month))); $month_select = new select('month', $month); for ($i=1;$i<13;$i++) { $month_select->add_value($i, $i); } $year_select = new select('year',$year); for ($i=0;$i<10;$i++) { $value = $this_year - $i; $year_select->add_value($value,$value); } $cell = new table_cell(); $cell->add_html_element($month_select); $cell->add_html_element($year_select); $row->add_cell($cell); $table->add_row($row); $container->add_html_element($table); $container->add_html_element(new button($cmdOk, "javascript:_load();")); $container->add_html_element(new button($cmdPrint, "javascript:_print();")); if ($project_id>0) { $container->add_html_element(new button($cmdClose, "javascript:document.location='".$return_to."';")); }}if ($task=='load'){ switch($show_period) { case 'all': $start_time=0; $end_time=0; break; case 'period': $end_time = date_to_unixtime($_POST['end_date']); $start_time = date_to_unixtime($_POST['start_date']);//+86400; break; case 'month': $start_time = mktime(0,0,0,$month, 1, $year); $end_time = mktime(0,0,0,$month+1, 1, $year); break; } $load_project_id=0; switch($load_type) { case 'contact': //$ab = new addressbook(); $contact = $ab->get_contact($load_id); $link_id = $contact['link_id']; break; case 'project': $link_id=0; $load_project_id=$load_id; break; case 'company': $company = $ab->get_company($load_id); $link_id = $company['link_id']; break; default: $link_id=0; break; } if($link_id>0) { $links = $GO_LINKS->get_links($link_id, 5); }else { $links=false; } $projects->get_hours($start_time, $end_time, $load_user_id, $load_project_id, $links); $table = new datatable('hours'); $table->set_attribute('class','hours_table'); $table->set_attribute('cellpadding','3'); $table->add_column(new table_heading($GLOBALS['pm_starttime'])); $table->add_column(new table_heading($GLOBALS['pm_endtime'])); if ($load_user_id == 0) { $table->add_column(new table_heading($GLOBALS['pm_employee'])); } $table->add_column(new table_heading($GLOBALS['pm_project'])); $cell = new table_heading($GLOBALS['pm_hours']); $cell->set_attribute('style', 'text-align:center'); $table->add_column($cell); $cell = new table_heading($GLOBALS['pm_internal_fee']); $table->add_column($cell); $cell = new table_heading($GLOBALS['pm_external_fee']); $table->add_column($cell); $cell = new table_heading($GLOBALS['pm_breaktime']); $cell->set_attribute('style', 'text-align:right'); $table->add_column($cell); $cell = new table_heading($GLOBALS['pm_unit_value']); $cell->set_attribute('style', 'text-align:right'); $table->add_column($cell); $cell = new table_heading($GLOBALS['pm_units']); $cell->set_attribute('style', 'text-align:center'); $table->add_column($cell); $cell = new table_heading(' '); $table->add_column($cell); $last_date = ''; $total_days = 0; $total_seconds = 0; $int_total_fee = 0;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -