本文整理汇总了PHP中phpgw类的典型用法代码示例。如果您正苦于以下问题:PHP phpgw类的具体用法?PHP phpgw怎么用?PHP phpgw使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了phpgw类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($session = False)
{
$this->currentapp = $GLOBALS['phpgw_info']['flags']['currentapp'];
$this->so = createObject('phpgwapi.custom_fields');
if ($session) {
$this->read_sessiondata();
$this->use_session = True;
}
$start = phpgw::get_var('start', 'int');
$query = phpgw::get_var('query');
$sort = phpgw::get_var('sort');
$order = phpgw::get_var('order');
$filter = phpgw::get_var('filter');
$location = phpgw::get_var('location');
$allrows = phpgw::get_var('allrows', 'bool');
$appname = phpgw::get_var('appname');
if ($start) {
$this->start = $start;
} else {
$this->start = 0;
}
$this->query = $query;
$this->filter = $filter;
$this->sort = $sort;
$this->order = $order;
$this->location = $location;
$this->appname = $appname;
$this->allrows = $allrows;
}
开发者ID:HaakonME,项目名称:porticoestate,代码行数:29,代码来源:class.bo_custom.inc.php
示例2: list_history
public function list_history()
{
if ($GLOBALS['phpgw']->acl->check('access_log_access', 1, 'admin')) {
$GLOBALS['phpgw']->redirect_link('/index.php');
}
$bo = createobject('admin.boaccess_history');
$nextmatches = createobject('phpgwapi.nextmatchs');
$account_id = phpgw::get_var('account_id', 'int', 'REQUEST');
$start = phpgw::get_var('start', 'int', 'GET', 0);
$sort = phpgw::get_var('sort', 'int', 'POST', 0);
$order = phpgw::get_var('order', 'int', 'POST', 0);
$GLOBALS['phpgw_info']['flags']['app_header'] = lang('Admin') . ' - ' . lang('View access log');
$GLOBALS['phpgw_info']['flags']['menu_selection'] = 'admin::admin::access_log';
$GLOBALS['phpgw']->common->phpgw_header(true);
$t =& $GLOBALS['phpgw']->template;
$t->set_root(PHPGW_APP_TPL);
$t->set_file('accesslog', 'accesslog.tpl');
$t->set_block('accesslog', 'list');
$t->set_block('accesslog', 'row');
$t->set_block('accesslog', 'row_empty');
$total_records = $bo->total($account_id);
$var = array('nextmatchs_left' => $nextmatches->left('/index.php', $start, $total_records, '&menuaction=admin.uiaccess_history.list_history&account_id=' . $account_id), 'nextmatchs_right' => $nextmatches->right('/index.php', $start, $total_records, '&menuaction=admin.uiaccess_history.list_history&account_id=' . $account_id), 'showing' => $nextmatches->show_hits($total_records, $start), 'lang_loginid' => lang('LoginID'), 'lang_ip' => lang('IP'), 'lang_login' => lang('Login'), 'lang_logout' => lang('Logout'), 'lang_total' => lang('Total'));
if ($account_id) {
$var['link_return_to_view_account'] = '<a href="' . $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 'admin.uiaccounts.view', 'account_id' => $account_id)) . '">' . lang('Return to view account') . '</a>';
$var['lang_last_x_logins'] = lang('Last %1 logins for %2', $total_records, $GLOBALS['phpgw']->common->grab_owner_name($account_id));
} else {
$var['lang_last_x_logins'] = lang('Last %1 logins', $total_records);
}
$t->set_var($var);
$records = $bo->list_history($account_id, $start, $order, $sort);
if (is_array($records)) {
foreach ($records as &$record) {
$nextmatches->template_alternate_row_class($t);
$var = array('row_loginid' => $record['loginid'], 'row_ip' => $record['ip'], 'row_li' => $record['li'], 'row_lo' => $record['account_id'] ? $record['lo'] : '<b>' . lang($record['sessionid']) . '</b>', 'row_total' => $record['lo'] ? $record['total'] : ' ');
$t->set_var($var);
$t->fp('rows_access', 'row', true);
}
}
if (!$total_records && $account_id) {
$nextmatches->template_alternate_row_class($t);
$t->set_var('row_message', lang('No login history exists for this user'));
$t->fp('rows_access', 'row_empty', true);
}
$loggedout = $bo->return_logged_out($account_id);
if ($total_records) {
$percent = round($loggedout / $total_records * 100);
} else {
$percent = '0';
}
$var = array('footer_total' => lang('Total records') . ': ' . $total_records);
if ($account_id) {
$var['lang_percent'] = lang('Percent this user has logged out') . ': ' . $percent . '%';
} else {
$var['lang_percent'] = lang('Percent of users that logged out') . ': ' . $percent . '%';
}
// create the menu on the left, if needed
$var['rows'] = createObject('admin.uimenuclass')->createHTMLCode('view_account');
$t->set_var($var);
$t->pfp('out', 'list');
}
开发者ID:HaakonME,项目名称:porticoestate,代码行数:60,代码来源:class.uiaccess_history.inc.php
示例3: setUp
/**
* Prepare the environment for the test suite to run
*
* @return void
*/
public function setUp()
{
$GLOBALS['phpgw_info']['flags'] = array('currentapp' => 'login', 'login' => true, 'noapi' => false, 'noheader' => true);
$header = realpath(PHPGW_API_UNIT_TEST_PATH . '/../../..') . '/header.inc.php';
include_once $header;
self::$sessionid = $GLOBALS['phpgw']->session->create(self::$login, '', false);
$GLOBALS['phpgw_info']['user']['account_id'] = 7;
phpgw::import_class('bim.sobim');
phpgw::import_class('bim.sobimitem');
phpgw::import_class('bim.sobimtype');
phpgw::import_class('bim.sobimmodel');
phpgw::import_class('bim.sovfs');
phpgw::import_class('bim.bobimmodel');
phpgw::import_class('bim.sobim_converter');
phpgw::import_class('bim.bobimitem');
phpgw::import_class('bim.uibim');
phpgw::import_class('bim.bimmodelinformation');
phpgw::import_class('bim.sobimmodelinformation');
$this->db =& $GLOBALS['phpgw']->db;
$this->loadXmlVariables();
$this->addDummyModel();
$this->addTestTypes();
$this->removeTestItems();
$this->addTestItems();
}
开发者ID:HaakonME,项目名称:porticoestate,代码行数:30,代码来源:PropertyBimTestSuite.php
示例4: edit
public function edit()
{
$id = intval(phpgw::get_var('id', 'GET'));
if ($id) {
$person = $this->bo->read_single($id);
$person['id'] = $id;
$person['contactpersons_link'] = self::link(array('menuaction' => 'booking.uicontactperson.index'));
$person['edit_link'] = self::link(array('menuaction' => 'booking.uicontactperson.edit', 'id' => $person['id']));
} else {
$person = array();
}
$errors = array();
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$person = array_merge($person, extract_values($_POST, array('ssn', 'name', 'homepage', 'phone', 'email', 'description')));
$errors = $this->bo->validate($person);
if (!$errors) {
if ($id) {
$receipt = $this->bo->update($person);
} else {
$receipt = $this->bo->add($person);
}
$this->redirect(array('menuaction' => $this->module . '.uicontactperson.show', 'id' => $receipt['id']));
}
}
$this->flash_form_errors($errors);
self::add_stylesheet('phpgwapi/js/yahoo/assets/skins/sam/skin.css');
self::add_javascript('yahoo', 'yahoo/yahoo-dom-event', 'yahoo-dom-event.js');
self::add_javascript('yahoo', 'yahoo/element', 'element-min.js');
self::add_javascript('yahoo', 'yahoo/dom', 'dom-min.js');
self::add_javascript('yahoo', 'yahoo/container', 'container_core-min.js');
self::add_javascript('yahoo', 'yahoo/editor', 'simpleeditor-min.js');
self::add_template_file("contactperson_fields");
self::render_template('contactperson_edit', array('person' => $person));
}
开发者ID:HaakonME,项目名称:porticoestate,代码行数:34,代码来源:class.uicontactperson.inc.php
示例5: index
/**
* @param mixed $data
* If $data is an array - then the process is run as cron - and will look for $data['function'] to
* determine which custom class to load
*/
function index($data = '')
{
if (!isset($GLOBALS['phpgw_info']['user']['apps']['admin'])) {
return;
}
if (is_array($data)) {
$function = $data['function'];
} else {
$data = unserialize(urldecode(phpgw::get_var('data')));
$data = phpgw::clean_value($data);
if (!isset($data['function'])) {
$function = phpgw::get_var('function');
} else {
$function = $data['function'];
}
}
// prevent path traversal
if (preg_match('/\\.\\./', $function)) {
return;
}
$file = PHPGW_SERVER_ROOT . "/property/inc/cron/{$GLOBALS['phpgw_info']['user']['domain']}/{$function}.php";
if (is_file($file)) {
require_once $file;
$custom = new $function();
$custom->pre_run($data);
} else {
echo "no such file: path_to_phpgw_server_root/property/inc/cron/{$GLOBALS['phpgw_info']['user']['domain']}/{$function}.php";
}
}
开发者ID:HaakonME,项目名称:porticoestate,代码行数:34,代码来源:class.custom_functions.inc.php
示例6: __construct
function __construct($session = false)
{
$this->so = CreateObject('sms.soautoreply');
$this->bocommon = CreateObject('sms.bocommon');
if ($session) {
$this->read_sessiondata();
$this->use_session = true;
}
$start = phpgw::get_var('start', 'int', 'REQUEST', 0);
$query = phpgw::get_var('query');
$sort = phpgw::get_var('sort');
$order = phpgw::get_var('order');
$filter = phpgw::get_var('filter', 'int');
$cat_id = phpgw::get_var('cat_id', 'int');
$allrows = phpgw::get_var('allrows', 'bool');
$this->start = $start ? $start : 0;
if (array_key_exists('query', $_POST) || array_key_exists('query', $_GET)) {
$this->query = $query;
}
if (array_key_exists('filter', $_POST) || array_key_exists('filter', $_GET)) {
$this->filter = $filter;
}
if (array_key_exists('sort', $_POST) || array_key_exists('sort', $_GET)) {
$this->sort = $sort;
}
if (array_key_exists('order', $_POST) || array_key_exists('order', $_GET)) {
$this->order = $order;
}
if (array_key_exists('cat_id', $_POST) || array_key_exists('cat_id', $_GET)) {
$this->cat_id = $cat_id;
}
if ($allrows) {
$this->allrows = $allrows;
}
}
开发者ID:HaakonME,项目名称:porticoestate,代码行数:35,代码来源:class.boautoreply.inc.php
示例7: addfiles
public function addfiles()
{
$GLOBALS['phpgw_info']['flags']['xslt_app'] = false;
$GLOBALS['phpgw_info']['flags']['noframework'] = true;
$GLOBALS['phpgw_info']['flags']['nofooter'] = true;
$acl =& $GLOBALS['phpgw']->acl;
$acl_add = $acl->check($this->acl_location, PHPGW_ACL_ADD, 'manual');
$acl_edit = $acl->check($this->acl_location, PHPGW_ACL_EDIT, 'manual');
$cat_id = phpgw::get_var('id', 'int');
$check = phpgw::get_var('check', 'bool');
$fileuploader = CreateObject('property.fileuploader');
if (!$acl_add && !$acl_edit) {
$GLOBALS['phpgw']->common->phpgw_exit();
}
if (!$cat_id) {
$GLOBALS['phpgw']->common->phpgw_exit();
}
$test = false;
if ($test) {
if (!empty($_FILES)) {
$tempFile = $_FILES['Filedata']['tmp_name'];
$targetPath = "{$GLOBALS['phpgw_info']['server']['temp_dir']}/";
$targetFile = str_replace('//', '/', $targetPath) . $_FILES['Filedata']['name'];
move_uploaded_file($tempFile, $targetFile);
echo str_replace($GLOBALS['phpgw_info']['server']['temp_dir'], '', $targetFile);
}
$GLOBALS['phpgw']->common->phpgw_exit();
}
if ($check) {
$fileuploader->check($cat_id, '/manual');
} else {
$fileuploader->upload($cat_id, '/manual');
}
}
开发者ID:HaakonME,项目名称:porticoestate,代码行数:34,代码来源:class.bodocuments.inc.php
示例8: check_form_values
/**
* Check form values
*/
function check_form_values()
{
$errors = '';
$domains = phpgw::get_var('domains', 'string', 'POST');
if (!is_array($domains)) {
$domains = array();
}
foreach ($domains as $k => $v) {
$deletedomain = phpgw::get_var('deletedomain', 'string', 'POST');
if (isset($deletedomain[$k])) {
continue;
}
if (!$_POST['settings'][$k]['config_pass']) {
$errors .= '<br>' . lang("You didn't enter a config password for domain %1", $v);
}
}
$setting = phpgw::get_var('setting', 'string', 'POST');
if (!$setting['HEADER_ADMIN_PASSWORD']) {
$errors .= '<br>' . lang("You didn't enter a header admin password");
}
if ($errors) {
$GLOBALS['phpgw_setup']->html->show_header('Error', True);
echo $errors;
exit;
}
}
开发者ID:HaakonME,项目名称:porticoestate,代码行数:29,代码来源:manageheader.php
示例9: edit
public function edit()
{
$id = intval(phpgw::get_var('id', 'GET'));
$activity = $this->bo->read_single($id);
$parent_activity = $this->bo->read_single($activity['parent_id']);
$activities = $this->bo->fetch_activities();
$activities = $activities['results'];
$activity['id'] = $id;
$activity['activities_link'] = self::link(array('menuaction' => 'booking.uiactivity.index'));
$activity['building_link'] = self::link(array('menuaction' => 'booking.uibuilding.index'));
$errors = array();
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
if ($_POST['parent_id'] == '0') {
$_POST['parent_id'] = null;
}
$activity = array_merge($activity, extract_values($_POST, array('name', 'active', 'description', 'parent_id')));
$errors = $this->bo->validate($activity);
if (!$errors) {
$receipt = $this->bo->update($activity);
$this->redirect(array('menuaction' => 'booking.uiactivity.index'));
}
}
$this->flash_form_errors($errors);
$activity['cancel_link'] = self::link(array('menuaction' => 'booking.uiactivity.index'));
self::render_template('activity_edit', array('activity' => $activity, 'parent' => $parent_activity, 'activities' => $activities));
}
开发者ID:HaakonME,项目名称:porticoestate,代码行数:26,代码来源:class.uiactivity.inc.php
示例10: __construct
public function __construct($session = false)
{
$this->so = CreateObject('admin.soconfig');
if ($session) {
$this->read_sessiondata();
$this->use_session = true;
}
$start = phpgw::get_var('start', 'int', 'REQUEST', 0);
$query = phpgw::get_var('query');
$sort = phpgw::get_var('sort');
$order = phpgw::get_var('order');
$filter = phpgw::get_var('filter', 'int');
$allrows = phpgw::get_var('allrows', 'bool');
$location_id = phpgw::get_var('location_id', 'int', 'REQUEST', 0);
$this->start = $start ? $start : 0;
$this->location_id = $location_id ? $location_id : 0;
$this->so->set_location($this->location_id);
if (array_key_exists('query', $_POST) || array_key_exists('query', $_GET)) {
$this->query = $query;
}
if (array_key_exists('filter', $_POST) || array_key_exists('filter', $_GET)) {
$this->filter = $filter;
}
if (array_key_exists('sort', $_POST) || array_key_exists('sort', $_GET)) {
$this->sort = $sort;
}
if (array_key_exists('order', $_POST) || array_key_exists('order', $_GET)) {
$this->order = $order;
}
if ($allrows) {
$this->allrows = $allrows;
}
}
开发者ID:HaakonME,项目名称:porticoestate,代码行数:33,代码来源:class.boconfig.inc.php
示例11: __construct
function __construct($session = false)
{
$this->so = CreateObject('property.sojasper');
$this->grants =& $this->so->grants;
if ($session) {
$this->read_sessiondata();
$this->use_session = true;
}
$start = phpgw::get_var('start', 'int', 'REQUEST', 0);
$query = phpgw::get_var('query');
$sort = phpgw::get_var('sort');
$order = phpgw::get_var('order');
$filter = phpgw::get_var('filter', 'int');
$cat_id = phpgw::get_var('cat_id', 'int');
$allrows = phpgw::get_var('allrows', 'bool');
$app = phpgw::get_var('app');
$this->start = $start ? $start : 0;
$this->query = isset($_REQUEST['query']) ? $query : $this->query;
$this->sort = isset($_REQUEST['sort']) ? $sort : $this->sort;
$this->order = isset($_REQUEST['order']) ? $order : $this->order;
$this->cat_id = isset($_REQUEST['cat_id']) ? $cat_id : $this->cat_id;
$this->user_id = isset($_REQUEST['user_id']) ? $user_id : $this->user_id;
$this->allrows = isset($allrows) && $allrows ? $allrows : '';
$this->app = isset($_REQUEST['app']) ? $app : $this->app;
}
开发者ID:HaakonME,项目名称:porticoestate,代码行数:25,代码来源:class.bojasper.inc.php
示例12: edit
public function edit()
{
date_default_timezone_set("Europe/Oslo");
$date = new DateTime(phpgw::get_var('date'));
$system_message = array();
$system_message['building_id'] = intval(phpgw::get_var('building_id', 'GET'));
$system_message['building_name'] = phpgw::get_var('building_name', 'GET');
$system_message['cancel_link'] = self::link(array('menuaction' => $this->module . '.uisearch.index'));
$system_message['created'] = $date->format('Y-m-d H:m');
$errors = array();
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$system_message = array_merge($system_message, extract_values($_POST, array('time', 'title', 'message', 'name', 'phone', 'email')));
if ($system_message['message'] == '') {
$errors['system_message'] = lang('Missing title');
} elseif ($system_message['title'] == '') {
$errors['system_message'] = lang('Missing message');
} elseif ($system_message['name'] == '') {
$errors['system_message'] = lang('Missing name');
}
if (!$errors) {
$system_message['title'] = $system_message['building_name'] . " - " . $system . $system_message['title'];
$receipt = $this->bo->add($system_message);
$this->redirect(array('menuaction' => $this->module . '.uibuilding.show.index', 'id' => $system_message['building_id']));
}
}
$this->flash_form_errors($errors);
$this->use_yui_editor();
self::render_template('system_message', array('system_message' => $system_message));
}
开发者ID:HaakonME,项目名称:porticoestate,代码行数:29,代码来源:class.uisystem_message.inc.php
示例13: get_schedule
public function get_schedule($id, $module)
{
$date = new DateTime(phpgw::get_var('date'));
// Make sure $from is a monday
if ($date->format('w') != 1) {
$date->modify('last monday');
}
$prev_date = clone $date;
$next_date = clone $date;
$prev_date->modify('-1 week');
$next_date->modify('+1 week');
$building = $this->read_single($id);
$building['buildings_link'] = self::link(array('menuaction' => $module . '.index'));
$building['building_link'] = self::link(array('menuaction' => $module . '.show', 'id' => $building['id']));
$building['date'] = $date->format('Y-m-d');
$building['week'] = intval($date->format('W'));
$building['year'] = intval($date->format('Y'));
$building['prev_link'] = self::link(array('menuaction' => $module . '.schedule', 'id' => $building['id'], 'date' => $prev_date->format('Y-m-d')));
$building['next_link'] = self::link(array('menuaction' => $module . '.schedule', 'id' => $building['id'], 'date' => $next_date->format('Y-m-d')));
for ($i = 0; $i < 7; $i++) {
$building['days'][] = array('label' => sprintf('%s<br/>%s %s', lang($date->format('l')), lang($date->format('M')), $date->format('d')), 'key' => $date->format('D'));
$date->modify('+1 day');
}
return $building;
}
开发者ID:HaakonME,项目名称:porticoestate,代码行数:25,代码来源:class.bobuilding.inc.php
示例14: parse_navbar
function parse_navbar($force = False)
{
$navbar = array();
$navbar = execMethod('phpgwapi.menu.get', 'navbar');
$user = $GLOBALS['phpgw']->accounts->get($GLOBALS['phpgw_info']['user']['id']);
$var = array('home_url' => $GLOBALS['phpgw']->link('/home.php'), 'home_text' => lang('home'), 'home_icon' => 'icon icon-home', 'about_url' => $GLOBALS['phpgw']->link('/about.php', array('app' => $GLOBALS['phpgw_info']['flags']['currentapp'])), 'about_text' => lang('about'), 'logout_url' => $GLOBALS['phpgw']->link('/logout.php'), 'logout_text' => lang('logout'), 'user_fullname' => $user->__toString());
if ($GLOBALS['phpgw']->acl->check('run', PHPGW_ACL_READ, 'preferences')) {
$var['preferences_url'] = $GLOBALS['phpgw']->link('/preferences/index.php');
$var['preferences_text'] = lang('preferences');
}
if (isset($GLOBALS['phpgw_info']['user']['apps']['manual'])) {
$var['help_url'] = "javascript:openwindow('" . $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 'manual.uimanual.help', 'app' => $GLOBALS['phpgw_info']['flags']['currentapp'], 'section' => isset($GLOBALS['phpgw_info']['apps']['manual']['section']) ? $GLOBALS['phpgw_info']['apps']['manual']['section'] : '', 'referer' => phpgw::get_var('menuaction'))) . "','700','600')";
$var['help_text'] = lang('help');
$var['help_icon'] = 'icon icon-help';
}
if (isset($GLOBALS['phpgw_info']['user']['apps']['admin'])) {
$var['debug_url'] = "javascript:openwindow('" . $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 'property.uidebug_json.index')) . "','','')";
$var['debug_text'] = lang('debug');
$var['debug_icon'] = 'icon icon-debug';
}
$GLOBALS['phpgw']->template->set_root(PHPGW_TEMPLATE_DIR);
$GLOBALS['phpgw']->template->set_file('navbar', 'navbar.tpl');
$flags =& $GLOBALS['phpgw_info']['flags'];
$var['current_app_title'] = isset($flags['app_header']) ? $flags['app_header'] : lang($GLOBALS['phpgw_info']['flags']['currentapp']);
$flags['menu_selection'] = isset($flags['menu_selection']) ? $flags['menu_selection'] : '';
$GLOBALS['phpgw']->template->set_var($var);
$GLOBALS['phpgw']->template->pfp('out', 'navbar');
register_shutdown_function('parse_footer_end');
}
开发者ID:HaakonME,项目名称:porticoestate,代码行数:29,代码来源:navbar.inc.php
示例15: check_logoutcode
/**
* Check logout error code
*
* @param integer $code Error code
* @return string Error message
*/
function check_logoutcode($code)
{
switch ($code) {
case 1:
return lang('You have been successfully logged out');
case 2:
return lang('Sorry, your login has expired');
case 5:
return lang('Bad login or password');
case 20:
return lang('Cannot find the mapping ! (please advice your adminstrator)');
case 21:
return lang('you had inactive mapping to %1 account', phpgw::get_var('phpgw_account', 'string', 'GET', ''));
case 22:
$GLOBALS['phpgw']->session->phpgw_setcookie('sessionid');
$GLOBALS['phpgw']->session->phpgw_setcookie('kp3');
$GLOBALS['phpgw']->session->phpgw_setcookie('domain');
return lang('you seemed to have an active session elsewhere for the domain "%1", now set to expired - please try again', phpgw::get_var('domain', 'string', 'COOKIE'));
case 99:
return lang('Blocked, too many attempts');
case 10:
$GLOBALS['phpgw']->session->phpgw_setcookie('sessionid');
$GLOBALS['phpgw']->session->phpgw_setcookie('kp3');
$GLOBALS['phpgw']->session->phpgw_setcookie('domain');
// fix for bug php4 expired sessions bug
if ($GLOBALS['phpgw_info']['server']['sessions_type'] == 'php') {
$GLOBALS['phpgw']->session->phpgw_setcookie('phpgwsessid');
}
return lang('Your session could not be verified.');
default:
return ' ';
}
}
开发者ID:HaakonME,项目名称:porticoestate,代码行数:39,代码来源:login.php
示例16: pre_run
function pre_run($data = '')
{
$cron = false;
$dry_run = false;
if (isset($data['enabled']) && $data['enabled'] == 1) {
$confirm = true;
$execute = true;
$cron = true;
if ($data['suffix']) {
$this->suffix = $data['suffix'];
}
if ($data['dir']) {
$this->dir = $data['dir'];
}
} else {
$confirm = phpgw::get_var('confirm', 'bool', 'POST');
$execute = true;
//phpgw::get_var('execute', 'bool', 'GET');
if (phpgw::get_var('dir', 'string', 'GET')) {
$this->dir = urldecode(phpgw::get_var('dir', 'string', 'GET'));
}
if (phpgw::get_var('suffix', 'string', 'GET')) {
$this->suffix = phpgw::get_var('suffix', 'string', 'GET');
}
}
if (!$execute) {
$dry_run = true;
}
if ($confirm) {
$this->execute($dry_run, $cron);
} else {
$this->confirm($execute = false);
}
}
开发者ID:HaakonME,项目名称:porticoestate,代码行数:34,代码来源:import_from_scanner.php
示例17: query
public function query()
{
// YUI variables for paging and sorting
$start_index = phpgw::get_var('startIndex', 'int');
$num_of_objects = phpgw::get_var('results', 'int', 'GET', 10);
$sort_field = phpgw::get_var('sort');
$sort_ascending = phpgw::get_var('dir') == 'desc' ? false : true;
// Form variables
$search_for = phpgw::get_var('query');
$search_type = phpgw::get_var('search_option');
// Create an empty result set
$result_objects = array();
$result_count = 0;
// TODO: access control
$composite_id = phpgw::get_var('composite_id');
$filters = array('composite_id' => $composite_id);
$result_objects = rental_sounit::get_instance()->get($start_index, $num_of_objects, $sort_field, $sort_ascending, $search_for, $search_type, $filters);
$result_count = rental_sounit::get_instance()->get_count($search_for, $search_type, $filters);
$editable = phpgw::get_var('editable') == 'true' ? true : false;
//Serialize the documents found
$rows = array();
foreach ($result_objects as $result) {
if (isset($result)) {
if ($result->has_permission(PHPGW_ACL_READ)) {
$rows[] = $result->serialize();
}
}
}
//Add context menu columns (actions and labels)
array_walk($rows, array($this, 'add_actions'), array($composite_id, $editable));
//Build a YUI result from the data
//
$result_data = array('results' => $rows, 'total_records' => count($rows));
return $this->yui_results($result_data, 'total_records', 'results');
}
开发者ID:HaakonME,项目名称:porticoestate,代码行数:35,代码来源:class.uiunit.inc.php
示例18: pre_run
function pre_run($data = array())
{
if (isset($data['enabled']) && $data['enabled'] == 1) {
$confirm = true;
$cron = true;
$this->cron = true;
} else {
$confirm = phpgw::get_var('confirm', 'bool', 'POST');
$execute = phpgw::get_var('execute', 'bool', 'GET');
}
if (isset($data['debug']) && $data['debug']) {
$this->debug = true;
} else {
$this->debug = phpgw::get_var('debug', 'bool');
}
if ($confirm) {
$this->execute($data);
$this->cron_log($cron);
// initiated from ui
if (!$cron) {
$this->confirm($execute = false);
}
} else {
$this->confirm($execute = false);
}
}
开发者ID:HaakonME,项目名称:porticoestate,代码行数:26,代码来源:class.cron_parent.inc.php
示例19: __construct
function __construct($session = false)
{
// $this->so = CreateObject('property.soifc');
$this->bocommon = createObject('property.bocommon');
$this->custom = createObject('property.custom_fields');
$this->acl_location = '.ifc';
if ($session) {
$this->read_sessiondata();
$this->use_session = true;
}
$start = phpgw::get_var('start', 'int', 'REQUEST', 0);
$query = phpgw::get_var('query');
$sort = phpgw::get_var('sort');
$order = phpgw::get_var('order');
$filter = phpgw::get_var('filter', 'int');
$cat_id = phpgw::get_var('cat_id', 'int');
$allrows = phpgw::get_var('allrows', 'bool');
if ($start) {
$this->start = $start;
} else {
$this->start = 0;
}
if (array_key_exists('query', $_POST) || array_key_exists('query', $_GET)) {
$this->query = $query;
}
if (array_key_exists('filter', $_POST) || array_key_exists('filter', $_GET)) {
$this->filter = $filter;
}
if (array_key_exists('sort', $_POST) || array_key_exists('sort', $_GET)) {
$this->sort = $sort;
}
if (array_key_exists('order', $_POST) || array_key_exists('order', $_GET)) {
$this->order = $order;
}
if (array_key_exists('cat_id', $_POST) || array_key_exists('cat_id', $_GET)) {
$this->cat_id = $cat_id;
}
if ($allrows) {
$this->allrows = $allrows;
}
switch ($GLOBALS['phpgw_info']['server']['db_type']) {
case 'mssql':
$this->dateformat = "M d Y";
$this->datetimeformat = "M d Y g:iA";
break;
case 'mysql':
$this->dateformat = "Y-m-d";
$this->datetimeformat = "Y-m-d G:i:s";
break;
case 'pgsql':
$this->dateformat = "Y-m-d";
$this->datetimeformat = "Y-m-d G:i:s";
break;
case 'postgres':
$this->dateformat = "Y-m-d";
$this->datetimeformat = "Y-m-d G:i:s";
break;
}
}
开发者ID:HaakonME,项目名称:porticoestate,代码行数:59,代码来源:class.boifc.inc.php
示例20: check_app
/**
* Get application name
*
* @return string Application name
*/
function check_app()
{
$app = phpgw::get_var('appname', 'string', 'GET', '');
if (!$app || $app == 'preferences') {
return 'common';
}
return $app;
}
开发者ID:HaakonME,项目名称:porticoestate,代码行数:13,代码来源:preferences.php
注:本文中的phpgw类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论