本文整理汇总了PHP中execMethod函数的典型用法代码示例。如果您正苦于以下问题:PHP execMethod函数的具体用法?PHP execMethod怎么用?PHP execMethod使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了execMethod函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
function index()
{
$GLOBALS['phpgw']->xslttpl->add_file(array('user', 'nextmatchs', 'search_field'));
$account_info = $this->bo->read();
$content = array();
foreach ($account_info as $entry) {
if ($entry['grants']) {
$link_training = $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 'hrm.uiuser.training', 'user_id' => $entry['account_id']));
$text_training = lang('training');
$lang_training_user_text = lang('Training profile');
} else {
$link_training = '';
$text_training = '';
$lang_training_user_text = '';
}
$content[] = array('first_name' => $entry['account_firstname'], 'last_name' => $entry['account_lastname'], 'link_training' => $link_training, 'link_view' => $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 'hrm.uiuser.view', ' user_id' => $entry['account_id'])), 'lang_view_user_text' => lang('view the user'), 'lang_training_user_text' => $lang_training_user_text, 'lang_edit_user_text' => lang('edit the user'), 'text_view' => lang('view'), 'text_edit' => lang('edit'), 'text_training' => $text_training);
}
//_debug_array($content);
$table_header[] = array('sort_last_name' => $this->nextmatchs->show_sort_order(array('sort' => $this->sort, 'var' => 'account_lastname', 'order' => $this->order, 'extra' => array('menuaction' => 'hrm.uiuser.index', 'query' => $this->query, 'allrows' => $this->allrows))), 'lang_last_name' => lang('Last name'), 'sort_first_name' => $this->nextmatchs->show_sort_order(array('sort' => $this->sort, 'var' => 'account_firstname', 'order' => $this->order, 'extra' => array('menuaction' => 'hrm.uiuser.index', 'query' => $this->query, 'allrows' => $this->allrows))), 'lang_first_name' => lang('First name'), 'lang_training' => lang('training'), 'lang_edit' => lang('edit'), 'lang_view' => lang('view'));
if (!$this->allrows) {
$record_limit = $GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];
} else {
$record_limit = $this->bo->total_records;
}
$link_data = array('menuaction' => 'hrm.uiuser.index', 'sort' => $this->sort, 'order' => $this->order, 'query' => $this->query);
$data = array('menu' => execMethod('hrm.menu.links'), 'allow_allrows' => true, 'allrows' => $this->allrows, 'start_record' => $this->start, 'record_limit' => $record_limit, 'num_records' => count($account_info), 'all_records' => $this->bo->total_records, 'link_url' => $GLOBALS['phpgw']->link('/index.php', $link_data), 'img_path' => $GLOBALS['phpgw']->common->get_image_path('phpgwapi', 'default'), 'lang_searchfield_categorytext' => lang('Enter the search string. To show all entries, empty this field and press the SUBMIT button again'), 'lang_searchbutton_categorytext' => lang('Submit the search string'), 'query' => $this->query, 'lang_search' => lang('search'), 'table_header' => $table_header, 'values' => $content);
$appname = lang('user');
$function_msg = lang('list user');
$GLOBALS['phpgw_info']['flags']['app_header'] = lang('hrm') . ' - ' . $appname . ': ' . $function_msg;
$GLOBALS['phpgw']->xslttpl->set_var('phpgw', array('list' => $data));
$this->save_sessiondata();
}
示例2: read
/**
* Get list of contacts to notify at location item
*
* @param array $data location_id and location_item_id
* @return array content.
*/
public function read($data = array())
{
if (!isset($data['location_id']) || !isset($data['location_item_id']) || !$data['location_item_id']) {
return array();
}
$location_id = (int) $data['location_id'];
$location_item_id = $data['location_item_id'];
// in case of bigint
$sql = "SELECT phpgw_notification.id, phpgw_notification.contact_id,phpgw_notification.user_id," . " phpgw_notification.is_active,phpgw_notification.entry_date,phpgw_notification.notification_method," . " first_name, last_name" . " FROM phpgw_notification" . " {$this->_join} phpgw_contact_person ON phpgw_notification.contact_id = phpgw_contact_person.person_id" . " WHERE location_id = {$location_id} AND location_item_id = '{$location_item_id}'";
$this->_db->query($sql, __LINE__, __FILE__);
$values = array();
$dateformat = $GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
$lang_yes = lang('yes');
$lang_no = lang('no');
while ($this->_db->next_record()) {
$values[] = array('id' => $this->_db->f('id'), 'location_id' => $location_id, 'location_item_id' => $location_item_id, 'contact_id' => $this->_db->f('contact_id'), 'is_active' => $this->_db->f('is_active'), 'notification_method' => $this->_db->f('notification_method', true), 'user_id' => $this->_db->f('user_id'), 'entry_date' => $GLOBALS['phpgw']->common->show_date($this->_db->f('entry_date'), $dateformat), 'first_name' => $this->_db->f('first_name', true), 'last_name' => $this->_db->f('last_name', true));
}
$contacts = CreateObject('phpgwapi.contacts');
$socommon = CreateObject('property.socommon');
foreach ($values as &$entry) {
$comms = execMethod('addressbook.boaddressbook.get_comm_contact_data', $entry['contact_id']);
$entry['email'] = $comms[$entry['contact_id']]['work email'];
$entry['sms'] = $comms[$entry['contact_id']]['mobile (cell) phone'];
$entry['is_active_text'] = $entry['is_active'] ? $lang_yes : $lang_no;
$sql = "SELECT account_id FROM phpgw_accounts WHERE person_id = " . (int) $entry['contact_id'];
$this->_db->query($sql, __LINE__, __FILE__);
if ($this->_db->next_record()) {
$account_id = $this->_db->f('account_id');
$prefs = $socommon->create_preferences('property', $account_id);
$entry['email'] = isset($entry['email']) && $entry['email'] ? $entry['email'] : $prefs['email'];
$entry['sms'] = isset($entry['sms']) && $entry['sms'] ? $entry['sms'] : $prefs['cellphone'];
}
}
return $values;
}
示例3: get_buildings_on_property
function get_buildings_on_property($user_role, $parent_location_code, $level)
{
$children = execMethod('property.solocation.get_children', $parent_location_code);
foreach ($children as &$entry) {
$entry['id'] = "{$parent_location_code}-{$entry['id']}";
}
return $children;
/*
// Property level
if ($level == 1)
{
$property_location_code = $location_code;
}
// Building level
else if ($level > 1)
{
$split_loc_code_array = explode('-', $location_code);
$property_location_code = $split_loc_code_array[0];
}
if ($user_role)
{
$criteria = array();
$criteria['location_code'] = $property_location_code;
$criteria['field_name'] = 'loc2_name';
$criteria['child_level'] = '2';
$buildings_on_property = execMethod('property.solocation.get_children', $criteria);
}
else
{
$buildings_on_property = execMethod('property.solocation.get_children', $property_location_code);
}
return $buildings_on_property;
*/
}
示例4: item_expanded
function item_expanded($id)
{
static $navbar_state;
if (!isset($navbar_state)) {
$navbar_state = execMethod('phpgwapi.template_portico.retrieve_local', 'navbar_config');
}
return isset($navbar_state[$id]);
}
示例5: purge_log
public function purge_log()
{
if ($GLOBALS['phpgw']->acl->check('error_log_access', 1, 'admin')) {
$GLOBALS['phpgw']->redirect_link('/index.php');
}
execMethod('admin.bolog.purge_log', phpgw::get_var('account_id', 'int'));
$GLOBALS['phpgw']->redirect_link('index.php', array('menuaction', 'admin.uilog.list_log'));
}
示例6: links
function links()
{
if (!isset($GLOBALS['phpgw_info']['user']['preferences']['sms']['horisontal_menus']) || $GLOBALS['phpgw_info']['user']['preferences']['sms']['horisontal_menus'] == 'no') {
return;
}
$GLOBALS['phpgw']->xslttpl->add_file(array('menu'));
$menu_brutto = execMethod('sms.menu.get_menu');
$selection = explode('::', $GLOBALS['phpgw_info']['flags']['menu_selection']);
$level = 0;
$menu['navigation'] = $this->get_sub_menu($menu_brutto['navigation'], $selection, $level);
return $menu;
}
示例7: parse_navbar
/**
* Parse navigation bar
*
* @param boolean $force
*/
function parse_navbar($force = False)
{
// we hack the template root here as this is the template set of last resort
$tpl = CreateObject('phpgwapi.Template', dirname(__FILE__), "remove");
$tpl->set_file('navbar', 'navbar.tpl');
$tpl->set_block('navbar', 'app', 'apps');
$navbar = execMethod('phpgwapi.menu.get', 'navbar');
prepare_navbar($navbar);
foreach ($navbar as $app => $app_data) {
if ($app == 'logout') {
if (isset($GLOBALS['phpgw_info']['user']['apps']['manual'])) {
$tpl->set_var(array('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')", 'text' => lang('help'), 'icon' => $GLOBALS['phpgw']->common->image('manual', 'navbar')));
}
$tpl->parse('apps', 'app', true);
}
$tpl->set_var(array('url' => $app_data['url'], 'text' => $app_data['text'], 'icon' => $GLOBALS['phpgw']->common->image($app_data['image'][0], $app_data['image'][1])));
$tpl->parse('apps', 'app', true);
}
// Maybe we should create a common function in the phpgw_accounts_shared.inc.php file
// to get rid of duplicate code.
if (!isset($GLOBALS['phpgw_info']['user']['lastpasswd_change']) || $GLOBALS['phpgw_info']['user']['lastpasswd_change'] == 0) {
$api_messages = lang('You are required to change your password during your first login') . '<br> Click this image on the navbar: <img src="' . $GLOBALS['phpgw']->common->image('preferences', 'navbar') . '">';
} else {
if ($GLOBALS['phpgw_info']['user']['lastpasswd_change'] < time() - 86400 * 30) {
$api_messages = lang('it has been more then %1 days since you changed your password', 30);
}
}
// This is gonna change
if (isset($cd)) {
$var['messages'] = "<div class=\"warn\">{$api_messages}<br>\n" . checkcode($cd) . "</div>\n";
}
if (isset($GLOBALS['phpgw_info']['flags']['app_header'])) {
$var['current_app_header'] = $GLOBALS['phpgw_info']['flags']['app_header'];
} else {
$tpl->set_block('navbar', 'app_header', 'app_header');
$var['app_header'] = '';
}
$tpl->set_var($var);
$tpl->pfp('out', 'navbar');
// If the application has a header include, we now include it
if ((!isset($GLOBALS['phpgw_info']['flags']['noappheader']) || !$GLOBALS['phpgw_info']['flags']['noappheader']) && isset($_GET['menuaction'])) {
list($app, $class, $method) = explode('.', $_GET['menuaction']);
if (is_array($GLOBALS[$class]->public_functions) && isset($GLOBALS[$class]->public_functions['header'])) {
$GLOBALS[$class]->header();
}
}
$GLOBALS['phpgw']->template->set_root(PHPGW_APP_TPL);
$GLOBALS['phpgw']->hooks->process('after_navbar');
unset($GLOBALS['phpgw_info']['navbar']);
}
示例8: execute
public function execute()
{
$orders = array();
$sql = "SELECT DISTINCT fm_workorder.id as order_id" . " FROM fm_workorder " . " {$this->join} fm_workorder_budget ON fm_workorder.id = fm_workorder_budget.order_id" . " WHERE continuous = 1" . " ORDER BY fm_workorder.id";
$this->db->query($sql, __LINE__, __FILE__);
$_order_budget = array();
while ($this->db->next_record()) {
$orders[] = $this->db->f('order_id');
}
foreach ($orders as $order_id) {
phpgwapi_cache::system_clear('property', "budget_order_{$order_id}");
execMethod('property.soworkorder.get_budget', $order_id);
}
$count_orders = count($orders);
$this->receipt['message'][] = array('msg' => "Rekalkulert budsjett for {$count_orders} løpende bestillinger");
}
示例9: __construct
public function __construct($location_id, $debug = false)
{
$location_id = (int) $location_id;
set_time_limit(10000);
//Set the time limit for this request
$this->account = (int) $GLOBALS['phpgw_info']['user']['account_id'];
$this->db =& $GLOBALS['phpgw']->db;
$this->join = $this->db->join;
if ($location_id && !($category = execMethod('property.soadmin_entity.get_single_category', $location_id))) {
throw new Exception("Not a valid location for {$location_id}");
}
if ($debug) {
$this->debug = true;
}
$this->is_eav = !!$category['is_eav'];
$this->location_id = $location_id;
$this->entity_id = $category['entity_id'];
$this->cat_id = $category['id'];
if ($this->is_eav) {
$this->table = 'fm_bim_item';
$sql = "SELECT fm_bim_type.id FROM fm_bim_type WHERE location_id = {$location_id}";
$this->db->query($sql, __LINE__, __FILE__);
$this->db->next_record();
$this->bim_type_id = $this->db->f('id');
$custom = createObject('property.custom_fields');
$attributes = $custom->find2($location_id, 0, '', 'ASC', 'attrib_sort', true, true);
$this->metadata['id'] = array('primary_key' => true);
$this->metadata['location_id'] = array('primary_key' => true);
$this->metadata['model'] = array();
$this->metadata['p_location_id'] = array();
$this->metadata['p_id'] = array();
$this->metadata['location_code'] = array();
$this->metadata['loc1'] = array();
$this->metadata['address'] = array();
$this->metadata['entry_date'] = array();
$this->metadata['user_id'] = array();
foreach ($attributes as $attribute) {
$this->metadata[$attribute['column_name']] = array();
}
} else {
$this->table = "fm_entity_{$category['entity_id']}_{$category['id']}";
$this->metadata = $this->db->metadata($this->table);
}
}
示例10: populate
protected function populate(int $unit_id, &$unit)
{
$location_code = $this->unmarshal($this->db->f('location_code', true), 'string');
// We get the data from the property module
$data = execMethod('property.bolocation.read_single', array('location_code' => $location_code, 'extra' => array('view' => true)));
$level = -1;
$names = array();
$levelFound = false;
for ($i = 1; !$levelFound; $i++) {
$loc_name = 'loc' . $i . '_name';
if (array_key_exists($loc_name, $data)) {
$level = $i;
$names[$level] = $data[$loc_name];
} else {
$levelFound = true;
}
}
$gab_id = '';
$gabinfos = execMethod('property.sogab.read', array('location_code' => $location_code, 'allrows' => true));
if ($gabinfos != null && is_array($gabinfos) && count($gabinfos) == 1) {
$gabinfo = array_shift($gabinfos);
$gab_id = $gabinfo['gab_id'];
}
$location = new rental_property_location($location_code, rental_uicommon::get_nicely_formatted_gab_id($gab_id), $level, $names);
$location->set_address_1($data['street_name'] . ' ' . $data['street_number']);
foreach ($data['attributes'] as $attributes) {
switch ($attributes['column_name']) {
case 'area_gross':
$location->set_area_gros($attributes['value']);
break;
case 'area_net':
$location->set_area_net($attributes['value']);
break;
case 'bruttoareal':
$location->set_area_gros($attributes['value']);
break;
case 'nettoareal':
$location->set_area_net($attributes['value']);
break;
}
}
return new rental_unit($this->unmarshal($this->db->f('id', true), 'int'), $this->unmarshal($this->db->f('composite_id', true), 'int'), $location);
}
示例11: index
function index()
{
$GLOBALS['phpgw_info']['flags']['xslt_app'] = true;
if (!$this->acl->check($this->acl_location, PHPGW_ACL_READ, 'sms')) {
$this->bocommon->no_access();
return;
}
$GLOBALS['phpgw']->xslttpl->add_file(array('poll', 'nextmatchs', 'search_field'));
$receipt = $GLOBALS['phpgw']->session->appsession('session_data', 'sms_poll_receipt');
$GLOBALS['phpgw']->session->appsession('session_data', 'sms_poll_receipt', '');
$poll_info = $this->bo->read();
foreach ($poll_info as $entry) {
if ($this->bocommon->check_perms($entry['grants'], PHPGW_ACL_DELETE)) {
$link_delete = $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 'sms.uipoll.delete', 'poll_id' => $entry['id']));
$text_delete = lang('delete');
$lang_delete_text = lang('delete the poll code');
}
if ($entry['enable'] == 1) {
$status = lang('enabled');
} else {
$status = lang('disabled');
}
$content[] = array('code' => $entry['code'], 'title' => $entry['title'], 'status' => $status, 'user' => $GLOBALS['phpgw']->accounts->id2name($entry['uid']), 'link_edit' => $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 'sms.uipoll.edit', 'poll_id' => $entry['id'])), 'link_delete' => $link_delete, 'link_view' => $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 'sms.uipoll.view', 'poll_id' => $entry['id'])), 'lang_view_config_text' => lang('view the config'), 'lang_edit_config_text' => lang('manage the poll code'), 'text_view' => lang('view'), 'text_edit' => lang('edit'), 'text_delete' => $text_delete, 'lang_delete_text' => $lang_delete_text);
unset($link_delete);
unset($text_delete);
unset($lang_delete_text);
}
$table_header[] = array('sort_code' => $this->nextmatchs->show_sort_order(array('sort' => $this->sort, 'var' => 'poll_code', 'order' => $this->order, 'extra' => array('menuaction' => 'sms.uipoll.index', 'query' => $this->query, 'cat_id' => $this->cat_id, 'allrows' => $this->allrows))), 'lang_code' => lang('code'), 'lang_delete' => lang('delete'), 'lang_edit' => lang('edit'), 'lang_view' => lang('view'), 'lang_user' => lang('user'), 'lang_title' => lang('title'), 'lang_status' => lang('status'));
if (!$this->allrows) {
$record_limit = $GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];
} else {
$record_limit = $this->bo->total_records;
}
$link_data = array('menuaction' => 'sms.uipoll.index', 'sort' => $this->sort, 'order' => $this->order, 'cat_id' => $this->cat_id, 'filter' => $this->filter, 'query' => $this->query);
$table_add[] = array('lang_add' => lang('add'), 'lang_add_statustext' => lang('add a poll'), 'add_action' => $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 'sms.uipoll.add')));
$msgbox_data = $GLOBALS['phpgw']->common->msgbox_data($receipt);
$data = array('msgbox_data' => $GLOBALS['phpgw']->common->msgbox($msgbox_data), 'menu' => execMethod('sms.menu.links'), 'allow_allrows' => true, 'allrows' => $this->allrows, 'start_record' => $this->start, 'record_limit' => $record_limit, 'num_records' => count($poll_info), 'all_records' => $this->bo->total_records, 'link_url' => $GLOBALS['phpgw']->link('/index.php', $link_data), 'img_path' => $GLOBALS['phpgw']->common->get_image_path('phpgwapi', 'default'), 'lang_searchfield_statustext' => lang('Enter the search string. To show all entries, empty this field and press the SUBMIT button again'), 'lang_searchbutton_statustext' => lang('Submit the search string'), 'query' => $this->query, 'lang_search' => lang('search'), 'table_header' => $table_header, 'table_add' => $table_add, 'values' => $content);
$appname = lang('polls');
$function_msg = lang('list SMS polls');
$GLOBALS['phpgw_info']['flags']['app_header'] = lang('sms') . ' - ' . $appname . ': ' . $function_msg;
$GLOBALS['phpgw']->xslttpl->set_var('phpgw', array('list' => $data));
$this->save_sessiondata();
}
示例12: index
function index()
{
$GLOBALS['phpgw']->xslttpl->add_file(array('place', 'nextmatchs', 'menu', 'search_field'));
$place_info = $this->bo->read();
while (is_array($place_info) && (list(, $entry) = each($place_info))) {
$content[] = array('name' => $entry['name'], 'link_edit' => $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 'hrm.uiplace.edit', 'place_id' => $entry['id'])), 'link_delete' => $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 'hrm.uiplace.delete', 'place_id' => $entry['id'])), 'link_view' => $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 'hrm.uiplace.view', 'place_id' => $entry['id'])), 'lang_view_place_text' => lang('view the place'), 'lang_edit_place_text' => lang('edit the place'), 'text_view' => lang('view'), 'text_edit' => lang('edit'), 'text_delete' => lang('delete'), 'lang_delete_place_text' => lang('delete the place'));
}
//_debug_array($content);
$table_header[] = array('sort_name' => $this->nextmatchs->show_sort_order(array('sort' => $this->sort, 'var' => 'name', 'order' => $this->order, 'extra' => array('menuaction' => 'hrm.uiplace.index', 'query' => $this->query, 'cat_id' => $this->cat_id, 'allrows' => $this->allrows))), 'lang_delete' => lang('delete'), 'lang_edit' => lang('edit'), 'lang_view' => lang('view'));
if (!$this->allrows) {
$record_limit = $GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];
} else {
$record_limit = $this->bo->total_records;
}
$link_data = array('menuaction' => 'hrm.uiplace.index', 'sort' => $this->sort, 'order' => $this->order, 'cat_id' => $this->cat_id, 'filter' => $this->filter, 'query' => $this->query);
$table_add[] = array('lang_add' => lang('add'), 'lang_add_statustext' => lang('add a place'), 'add_action' => $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 'hrm.uiplace.edit')));
$msgbox_data = $this->bocommon->msgbox_data($receipt);
$data = array('msgbox_data' => $GLOBALS['phpgw']->common->msgbox($msgbox_data), 'menu' => execMethod('hrm.menu.links'), 'allow_allrows' => true, 'allrows' => $this->allrows, 'start_record' => $this->start, 'record_limit' => $record_limit, 'num_records' => count($place_info), 'all_records' => $this->bo->total_records, 'link_url' => $GLOBALS['phpgw']->link('/index.php', $link_data), 'img_path' => $GLOBALS['phpgw']->common->get_image_path('phpgwapi', 'default'), 'lang_searchfield_statustext' => lang('Enter the search string. To show all entries, empty this field and press the SUBMIT button again'), 'lang_searchbutton_statustext' => lang('Submit the search string'), 'query' => $this->query, 'lang_search' => lang('search'), 'table_header' => $table_header, 'table_add' => $table_add, 'values' => $content);
$appname = lang('place');
$function_msg = lang('list place');
$GLOBALS['phpgw_info']['flags']['app_header'] = lang('hrm') . ' - ' . $appname . ': ' . $function_msg;
$GLOBALS['phpgw']->xslttpl->set_var('phpgw', array('list' => $data));
$this->save_sessiondata();
}
示例13: forward
/**
* forward voucher to other persons
*
*/
public function forward()
{
$GLOBALS['phpgw_info']['flags']['noframework'] = true;
$user_lid = phpgw::get_var('user_lid', 'string', 'GET', 'all');
$voucher_id = phpgw::get_var('voucher_id', 'int', 'GET');
$redirect = false;
$role_check = array('is_janitor' => lang('janitor'), 'is_supervisor' => lang('supervisor'), 'is_budget_responsible' => lang('b - responsible'));
$approve = $this->bo->get_approve_role();
$values = phpgw::get_var('values');
$receipt = array();
if (isset($values['save'])) {
if ($GLOBALS['phpgw']->session->is_repost()) {
$receipt['error'][] = array('msg' => lang('repost'));
}
if (!$approve) {
$receipt['error'][] = array('msg' => lang('you are not approved for this task'));
}
if (!$receipt['error']) {
$values['voucher_id'] = $voucher_id;
$receipt = $this->bo->forward($values);
if (!$receipt['error']) {
execMethod('property.soworkorder.close_orders', phpgw::get_var('orders'));
$redirect = true;
}
}
}
$voucher = $this->bo->read_single_voucher($voucher_id);
$orders = array();
$_orders = array();
foreach ($voucher as $line) {
if ($line['order_id']) {
$_orders[] = $line['order_id'];
}
}
$_orders = array_unique($_orders);
foreach ($_orders as $_order) {
$orders[] = array('id' => $_order);
}
$approved_list = array();
$approved_list[] = array('role' => $role_check['is_janitor'], 'role_sign' => 'oppsynsmannid', 'initials' => $line['janitor'] ? $line['janitor'] : '', 'date' => $line['oppsynsigndato'] ? $GLOBALS['phpgw']->common->show_date(strtotime($line['oppsynsigndato'])) : '', 'user_list' => !$line['oppsynsigndato'] ? array('options_user' => $this->bocommon->get_user_list_right(32, isset($line['janitor']) ? $line['janitor'] : '', '.invoice')) : '');
$approved_list[] = array('role' => $role_check['is_supervisor'], 'role_sign' => 'saksbehandlerid', 'initials' => $line['supervisor'] ? $line['supervisor'] : '', 'date' => $line['saksigndato'] ? $GLOBALS['phpgw']->common->show_date(strtotime($line['saksigndato'])) : '', 'user_list' => !$line['saksigndato'] ? array('options_user' => $this->bocommon->get_user_list_right(64, isset($line['supervisor']) ? $line['supervisor'] : '', '.invoice')) : '');
$approved_list[] = array('role' => $role_check['is_budget_responsible'], 'role_sign' => 'budsjettansvarligid', 'initials' => $line['budget_responsible'] ? $line['budget_responsible'] : '', 'date' => $line['budsjettsigndato'] ? $GLOBALS['phpgw']->common->show_date(strtotime($line['budsjettsigndato'])) : '', 'user_list' => !$line['budsjettsigndato'] ? array('options_user' => $this->bocommon->get_user_list_right(128, isset($line['budget_responsible']) ? $line['budget_responsible'] : '', '.invoice')) : '');
$my_initials = $GLOBALS['phpgw_info']['user']['account_lid'];
foreach ($approve as &$_approve) {
if ($_approve['id'] == 'is_janitor' && $my_initials == $line['janitor'] && $line['oppsynsigndato']) {
$_approve['selected'] = 1;
$sign_orig = 'is_janitor';
} else {
if ($_approve['id'] == 'is_supervisor' && $my_initials == $line['supervisor'] && $line['saksigndato']) {
$_approve['selected'] = 1;
$sign_orig = 'is_supervisor';
} else {
if ($_approve['id'] == 'is_budget_responsible' && $my_initials == $line['budget_responsible'] && $line['budsjettsigndato']) {
$_approve['selected'] = 1;
$sign_orig = 'is_budget_responsible';
}
}
}
}
unset($_approve);
$approve_list = array();
foreach ($approve as $_approve) {
if ($_approve['id'] == 'is_janitor') {
if ($my_initials == $line['janitor'] && $line['oppsynsigndato'] || !$line['oppsynsigndato']) {
$approve_list[] = $_approve;
}
}
if ($_approve['id'] == 'is_supervisor') {
if ($my_initials == $line['supervisor'] && $line['saksigndato'] || !$line['saksigndato']) {
$approve_list[] = $_approve;
}
}
if ($_approve['id'] == 'is_budget_responsible') {
if ($my_initials == $line['budget_responsible'] && $line['budsjettsigndato'] || !$line['budsjettsigndato']) {
$approve_list[] = $_approve;
}
}
}
$data = array('redirect' => $redirect ? $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 'property.uiinvoice.index', 'user_lid' => $user_lid)) : null, 'msgbox_data' => $GLOBALS['phpgw']->common->msgbox($GLOBALS['phpgw']->common->msgbox_data($receipt)), 'from_name' => $GLOBALS['phpgw_info']['user']['fullname'], 'form_action' => $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 'property.uiinvoice.forward', 'user_lid' => $user_lid, 'voucher_id' => $voucher_id)), 'approve_list' => $approve_list, 'approved_list' => $approved_list, 'sign_orig' => $sign_orig, 'my_initials' => $my_initials, 'project_group_data' => $project_group_data, 'orders' => $orders, 'value_amount' => $line['amount'], 'value_currency' => $line['currency'], 'value_process_log' => isset($values['process_log']) && $values['process_log'] ? $values['process_log'] : $line['process_log']);
$GLOBALS['phpgw']->xslttpl->add_file('invoice');
$GLOBALS['phpgw']->xslttpl->set_var('phpgw', array('forward' => $data));
}
示例14: edit_favorite
public function edit_favorite()
{
if ($activity_id = phpgw::get_var('id')) {
$activity = $this->so->get_single($activity_id);
if (isset($GLOBALS['phpgw_info']['user']['preferences']['logistic']['menu_favorites']) && $GLOBALS['phpgw_info']['user']['preferences']['logistic']['menu_favorites']) {
$menu_favorites = $GLOBALS['phpgw_info']['user']['preferences']['logistic']['menu_favorites'];
} else {
$menu_favorites = array();
}
if (isset($menu_favorites['activity'][$activity_id])) {
unset($menu_favorites['activity'][$activity_id]);
} else {
$menu_favorites['activity'][$activity_id] = $activity->get_name();
}
$GLOBALS['phpgw']->preferences->account_id = $GLOBALS['phpgw_info']['user']['account_id'];
$GLOBALS['phpgw']->preferences->read();
$GLOBALS['phpgw']->preferences->add('logistic', 'menu_favorites', $menu_favorites, 'user');
$GLOBALS['phpgw']->preferences->save_repository();
execMethod('phpgwapi.menu.clear');
}
$GLOBALS['phpgw']->redirect_link('/index.php', array('menuaction' => 'logistic.uiactivity.index'));
}
示例15: array
<?php
$GLOBALS['phpgw_info'] = array();
$GLOBALS['phpgw_info']['flags'] = array('noheader' => true, 'nonavbar' => false, 'currentapp' => 'home', 'enable_network_class' => true, 'enable_contacts_class' => true, 'enable_nextmatchs_class' => true);
include_once '../header.inc.php';
// Start-------------------------------------------------
phpgw::import_class('phpgwapi.yui');
$GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/yahoo/examples/treeview/assets/css/folders/tree.css');
phpgwapi_yui::load_widget('treeview');
phpgwapi_yui::load_widget('cookie');
$GLOBALS['phpgw']->js->validate_file('yahoo', 'test.menu', 'property');
$currentapp = $GLOBALS['phpgw_info']['flags']['currentapp'];
$applications = array();
$mapping = array(0 => array('name' => 'first_element_is_dummy'));
$exclude = array('home', 'preferences', 'about', 'logout');
$navbar = execMethod('phpgwapi.menu.get', 'navbar');
$i = 1;
foreach ($navbar as $app => $app_data) {
if (in_array($app, $exclude)) {
continue;
}
$applications[] = array('value' => array('id' => $i, 'app' => $app, 'label' => $app_data['text'], 'href' => str_replace('&', '&', $app_data['url'])), 'children' => array());
$mapping[$i] = array('id' => $i, 'name' => $app, 'expanded' => false, 'highlight' => true, 'is_leaf' => false);
$i++;
}
$applications = json_encode($applications);
$mapping = json_encode($mapping);
$html = <<<HTML
\t\t<div id="MenutreeDiv1"></div>
\t\t<script type="text/javascript">
\t\t var apps = {$applications};