public function index() { if (phpgw::get_var('phpgw_return_as') == 'json') { return $this->index_json(); } self::add_javascript('booking', 'booking', 'datatable.js'); phpgwapi_yui::load_widget('datatable'); phpgwapi_yui::load_widget('paginator'); // if($_SESSION['showall']) // { // $active_botton = lang('Show only active'); // }else{ // $active_botton = lang('Show all'); // } $data = array('form' => array('toolbar' => array('item' => array(array('type' => 'link', 'value' => lang('New Root Permission'), 'href' => $this->generate_link('add')), array('type' => 'text', 'name' => 'query'), array('type' => 'submit', 'name' => 'search', 'value' => lang('Search'))))), 'datatable' => array('source' => $this->generate_link('index', array('phpgw_return_as' => 'json')), 'field' => array(array('key' => 'subject_name', 'label' => lang('User'), 'sortable' => true), array('key' => 'role', 'label' => lang('Role'), 'sortable' => true), array('key' => 'actions', 'label' => lang('Actions'), 'sortable' => false, 'formatter' => 'YAHOO.booking.' . sprintf('formatGenericLink(\'%s\')', lang('delete')))))); if (!$this->bo->allow_delete()) { unset($data['datatable']['field'][2]); //Delete action } if (!$this->bo->allow_create()) { unset($data['form']['toolbar']['item'][0]); //New button } self::render_template('datatable', $data); }
public function index() { if (!$this->acl_read) { $this->bocommon->no_access(); return; } if (phpgw::get_var('phpgw_return_as') == 'json') { return $this->query(); } self::add_javascript('phpgwapi', 'yahoo', 'datatable.js'); phpgwapi_yui::load_widget('datatable'); phpgwapi_yui::load_widget('paginator'); $categories = $this->_get_categories(); $data = array('datatable_name' => lang('condition survey'), 'form' => array('toolbar' => array('item' => array(array('type' => 'filter', 'name' => 'cat_id', 'text' => lang('category') . ':', 'list' => $categories), array('type' => 'text', 'text' => lang('search'), 'name' => 'query'), array('type' => 'submit', 'name' => 'search', 'value' => lang('Search')), array('type' => 'link', 'value' => lang('new'), 'href' => self::link(array('menuaction' => 'property.uicondition_survey.add')), 'class' => 'new_item'), array('type' => 'link', 'value' => lang('download'), 'href' => 'javascript:window.open("' . self::link(array('menuaction' => 'property.uicondition_survey.download', 'export' => true, 'allrows' => true)) . '","window")', 'class' => 'new_item'), array('type' => 'link', 'value' => $_SESSION['allrows'] ? lang('Show only active') : lang('Show all'), 'href' => self::link(array('menuaction' => 'property.uicondition_survey.index', 'allrows' => true)))))), 'datatable' => array('source' => self::link(array('menuaction' => 'property.uicondition_survey.index', 'phpgw_return_as' => 'json')), 'editor_action' => 'property.uicondition_survey.edit_survey_title', 'field' => array(array('key' => 'id', 'label' => lang('ID'), 'sortable' => true, 'formatter' => 'YAHOO.portico.formatLink'), array('key' => 'address', 'label' => lang('buildingname'), 'sortable' => true), array('key' => 'vendor', 'label' => lang('vendor'), 'sortable' => true), array('key' => 'year', 'label' => lang('year'), 'sortable' => true), array('key' => 'multiplier', 'label' => lang('multiplier'), 'sortable' => false), array('key' => 'cnt', 'label' => lang('count'), 'sortable' => false), array('key' => 'link', 'hidden' => true)))); $parameters = array('parameter' => array(array('name' => 'id', 'source' => 'id'))); $data['datatable']['actions'][] = array('my_name' => 'view_survey', 'text' => lang('view'), 'action' => $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 'property.uicondition_survey.view')), 'parameters' => json_encode($parameters)); $data['datatable']['actions'][] = array('my_name' => 'edit_survey', 'text' => lang('edit'), 'action' => $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 'property.uicondition_survey.edit')), 'parameters' => json_encode($parameters)); $data['datatable']['actions'][] = array('my_name' => 'import_survey', 'text' => lang('import'), 'action' => $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 'property.uicondition_survey.import')), 'parameters' => json_encode($parameters)); if ($GLOBALS['phpgw']->acl->check('.admin', PHPGW_ACL_DELETE, 'property')) { $data['datatable']['actions'][] = array('my_name' => 'delete_imported_records', 'text' => lang('delete imported records'), 'confirm_msg' => lang('do you really want to delete this entry') . '?', 'action' => $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 'property.uicondition_survey.delete_imported_records')), 'parameters' => json_encode($parameters)); } if ($GLOBALS['phpgw']->acl->check('.admin', PHPGW_ACL_DELETE, 'property')) { $data['datatable']['actions'][] = array('my_name' => 'delete_survey', 'text' => lang('delete'), 'confirm_msg' => lang('do you really want to delete this entry') . '?', 'action' => $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 'property.uicondition_survey.delete')), 'parameters' => json_encode($parameters)); } self::render_template_xsl('datatable_common', $data); }
public function index() { if (phpgw::get_var('phpgw_return_as') == 'json') { return $this->index_json(); } if (extract_values($_GET, array('sessionShowAll')) && !$_SESSION['ActiveSession']) { $this->bo->set_active_session(); } if (extract_values($_GET, array('unsetShowAll')) && $_SESSION['ActiveSession']) { $this->bo->actUnSet(); } self::add_javascript('booking', 'booking', 'datatable.js'); phpgwapi_yui::load_widget('datatable'); phpgwapi_yui::load_widget('paginator'); phpgwapi_yui::load_widget('treeview'); $sessionLink = $this->link(array('menuaction' => 'booking.uiaudience.index', 'sessionShowAll' => 'activate')); $data = array('form' => array('toolbar' => array('item' => array(array('type' => 'link', 'value' => lang('New Audience group'), 'href' => self::link(array('menuaction' => 'booking.uiaudience.add'))), array('type' => 'text', 'name' => 'query'), array('type' => 'submit', 'name' => 'search', 'value' => lang('Search')), array('type' => 'link', 'value' => $_SESSION['showall'] ? lang('Show only active') : lang('Show all'), 'href' => self::link(array('menuaction' => 'booking.uiaudience.active')))))), 'datatable' => array('source' => self::link(array('menuaction' => 'booking.uiaudience.index', 'phpgw_return_as' => 'json')), 'field' => array(array('key' => 'sort', 'label' => lang('Order')), array('key' => 'name', 'label' => lang('Target Audience'), 'formatter' => 'YAHOO.booking.formatLink'), array('key' => 'description', 'label' => lang('Description')), array('key' => 'link', 'hidden' => true)))); if (!$this->bo->allow_create()) { //Remove new button unset($data['form']['toolbar']['item'][0]); } if (!$this->bo->allow_write()) { //Remove link to edit unset($data['datatable']['field'][0]['formatter']); unset($data['datatable']['field'][2]); } self::render_template('datatable', $data); }
function __construct() { $GLOBALS['phpgw']->js->validate_file('core', 'formatdate', 'phpgwapi'); $GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/yahoo/calendar/assets/skins/sam/calendar.css'); $namespace = phpgwapi_yui::load_widget('calendar'); $this->init($namespace); }
public function __construct() { self::set_active_menu('rental'); self::add_stylesheet('phpgwapi/js/yahoo/calendar/assets/skins/sam/calendar.css'); self::add_stylesheet('phpgwapi/js/yahoo/autocomplete/assets/skins/sam/autocomplete.css'); self::add_stylesheet('phpgwapi/js/yahoo/datatable/assets/skins/sam/datatable.css'); self::add_stylesheet('phpgwapi/js/yahoo/container/assets/skins/sam/container.css'); self::add_stylesheet('phpgwapi/js/yahoo/paginator/assets/skins/sam/paginator.css'); self::add_stylesheet('phpgwapi/js/yahoo/treeview/assets/skins/sam/treeview.css'); self::add_stylesheet('rental/templates/base/css/base.css'); self::add_javascript('rental', 'rental', 'common.js'); $this->tmpl_search_path = array(); array_push($this->tmpl_search_path, PHPGW_SERVER_ROOT . '/phpgwapi/templates/base'); array_push($this->tmpl_search_path, PHPGW_SERVER_ROOT . '/phpgwapi/templates/' . $GLOBALS['phpgw_info']['server']['template_set']); array_push($this->tmpl_search_path, PHPGW_SERVER_ROOT . '/' . $GLOBALS['phpgw_info']['flags']['currentapp'] . '/templates/base'); phpgwapi_yui::load_widget('datatable'); phpgwapi_yui::load_widget('paginator'); phpgwapi_yui::load_widget('menu'); phpgwapi_yui::load_widget('calendar'); phpgwapi_yui::load_widget('autocomplete'); phpgwapi_yui::load_widget('animation'); $dateFormat = $GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']; $this->acl =& $GLOBALS['phpgw']->acl; $this->locations =& $GLOBALS['phpgw']->locations; $this->type_of_user = array(MANAGER => $this->isManager(), EXECUTIVE_OFFICER => $this->isExecutiveOfficer(), ADMINISTRATOR => $this->isAdministrator()); $GLOBALS['phpgw_info']['flags']['app_header'] = lang($GLOBALS['phpgw_info']['flags']['currentapp']); }
function __construct() { $GLOBALS['phpgw_info']['flags']['noframework'] = true; $GLOBALS['phpgw_info']['flags']['headonly'] = true; $GLOBALS['phpgw_info']['flags']['xslt_app'] = true; $this->bo = CreateObject('property.bolookup', true); $this->start = $this->bo->start; $this->query = $this->bo->query; $this->sort = $this->bo->sort; $this->order = $this->bo->order; $this->filter = $this->bo->filter; $this->cat_id = $this->bo->cat_id; $this->part_of_town_id = $this->bo->part_of_town_id; $this->district_id = $this->bo->district_id; phpgwapi_yui::load_widget('tabview'); phpgwapi_yui::load_widget('dragdrop'); phpgwapi_yui::load_widget('datatable'); phpgwapi_yui::load_widget('menu'); phpgwapi_yui::load_widget('connection'); phpgwapi_yui::load_widget('loader'); phpgwapi_yui::load_widget('tabview'); phpgwapi_yui::load_widget('paginator'); phpgwapi_yui::load_widget('animation'); if (!isset($GLOBALS['phpgw']->css) || !is_object($GLOBALS['phpgw']->css)) { $GLOBALS['phpgw']->css = createObject('phpgwapi.css'); } // Prepare CSS Style $GLOBALS['phpgw']->css->validate_file('datatable'); $GLOBALS['phpgw']->css->validate_file('property'); $GLOBALS['phpgw']->css->add_external_file('property/templates/base/css/property.css'); $GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/yahoo/datatable/assets/skins/sam/datatable.css'); $GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/yahoo/container/assets/skins/sam/container.css'); $GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/yahoo/paginator/assets/skins/sam/paginator.css'); }
public function index() { if (phpgw::get_var('phpgw_return_as') == 'json') { return $this->index_json(); } self::add_javascript('booking', 'booking', 'datatable.js'); phpgwapi_yui::load_widget('datatable'); phpgwapi_yui::load_widget('paginator'); $data = array('form' => array('toolbar' => array('item' => array(array('type' => 'link', 'value' => lang('New organization'), 'href' => self::link(array('menuaction' => 'booking.uiorganization.add'))), array('type' => 'text', 'name' => 'query'), array('type' => 'submit', 'name' => 'search', 'value' => lang('Search')), array('type' => 'link', 'value' => $_SESSION['showall'] ? lang('Show only active') : lang('Show all'), 'href' => self::link(array('menuaction' => $this->url_prefix . '.toggle_show_inactive')))))), 'datatable' => array('source' => self::link(array('menuaction' => 'booking.uiorganization.index', 'phpgw_return_as' => 'json')), 'field' => array(array('key' => 'name', 'label' => lang('Organization'), 'formatter' => 'YAHOO.booking.formatLink'), array('key' => 'shortname', 'label' => lang('Organization shortname')), array('key' => 'customer_number', 'label' => lang('Customer number')), array('key' => 'organization_number', 'label' => lang('Organization number')), array('key' => 'primary_contact_name', 'label' => lang('Admin 1')), array('key' => 'phone', 'label' => lang('Phone')), array('key' => 'email', 'label' => lang('Email')), array('key' => 'active', 'label' => lang('Active')), array('key' => 'link', 'hidden' => true)))); self::render_template('datatable', $data); }
public function index() { if (phpgw::get_var('phpgw_return_as') == 'json') { return $this->index_json(); } self::add_javascript('booking', 'booking', 'datatable.js'); phpgwapi_yui::load_widget('datatable'); phpgwapi_yui::load_widget('paginator'); $data = array('form' => array('toolbar' => array('item' => array(array('type' => 'link', 'value' => lang('New event'), 'href' => self::link(array('menuaction' => 'booking.uievent.add'))), array('type' => 'filter', 'name' => 'buildings', 'text' => lang('Building') . ':', 'list' => $this->bo->so->get_buildings()), array('type' => 'filter', 'name' => 'activities', 'text' => lang('Activity') . ':', 'list' => $this->bo->so->get_activities_main_level()), array('type' => 'text', 'name' => 'query'), array('type' => 'submit', 'name' => 'search', 'value' => lang('Search')), array('type' => 'link', 'value' => $_SESSION['showall'] ? lang('Show only active') : lang('Show all'), 'href' => self::link(array('menuaction' => $this->url_prefix . '.toggle_show_inactive')))))), 'datatable' => array('source' => self::link(array('menuaction' => 'booking.uievent.index', 'phpgw_return_as' => 'json')), 'field' => array(array('key' => 'id', 'label' => lang('ID'), 'formatter' => 'YAHOO.booking.formatLink'), array('key' => 'description', 'label' => lang('Event')), array('key' => 'activity_name', 'label' => lang('Activity')), array('key' => 'customer_organization_name', 'label' => lang('Organization')), array('key' => 'contact_name', 'label' => lang('Contact')), array('key' => 'building_name', 'label' => lang('Building')), array('key' => 'from_', 'label' => lang('From')), array('key' => 'to_', 'label' => lang('To')), array('key' => 'active', 'label' => lang('Active')), array('key' => 'link', 'hidden' => true)))); self::render_template('datatable', $data); }
public function index() { if (phpgw::get_var('phpgw_return_as') == 'json') { return $this->index_json(); } self::add_javascript('booking', 'booking', 'datatable.js'); phpgwapi_yui::load_widget('datatable'); phpgwapi_yui::load_widget('paginator'); $data = array('form' => array('toolbar' => array('item' => array(array('type' => 'link', 'value' => lang('New contact'), 'href' => self::link(array('menuaction' => 'booking.uicontactperson.edit'))), array('type' => 'text', 'name' => 'query'), array('type' => 'submit', 'name' => 'search', 'value' => lang('Search'))))), 'datatable' => array('source' => self::link(array('menuaction' => 'booking.uicontactperson.index', 'phpgw_return_as' => 'json')), 'field' => array(array('key' => 'name', 'label' => lang('First name'), 'formatter' => 'YAHOO.booking.formatLink'), array('key' => 'surname', 'label' => lang('Surname')), array('key' => 'organization', 'label' => lang('Organization')), array('key' => 'phone', 'label' => lang('Phone')), array('key' => 'mail', 'label' => lang('Email')), array('key' => 'link', 'hidden' => true)))); self::render_template('datatable', $data); }
public function index() { if (phpgw::get_var('phpgw_return_as') == 'json') { return $this->index_json(); } self::add_javascript('booking', 'booking', 'datatable.js'); phpgwapi_yui::load_widget('datatable'); phpgwapi_yui::load_widget('paginator'); $data = array('form' => array('toolbar' => array('item' => array(array('type' => 'text', 'name' => 'query'), array('type' => 'submit', 'name' => 'search', 'value' => lang('Search'))))), 'datatable' => array('source' => $this->link_to('index', array('phpgw_return_as' => 'json')), 'sorted_by' => array('key' => 'id', 'dir' => 'desc'), 'field' => array(array('key' => 'id', 'label' => lang('ID'), 'formatter' => 'YAHOO.booking.formatLink'), array('key' => 'type', 'label' => lang('Type')), array('key' => 'total_items', 'label' => lang('Total Items')), array('key' => 'total_cost', 'label' => lang('Total Cost')), array('key' => 'created_on', 'label' => lang('Created')), array('key' => 'created_by_name', 'label' => lang('Created by')), array('key' => 'download', 'label' => lang('Actions'), 'formatter' => 'YAHOO.booking.formatGenericLink()', 'sortable' => false), array('key' => 'upload', 'label' => lang('Export'), 'formatter' => 'YAHOO.booking.formatGenericLink()', 'sortable' => false), array('key' => 'log', 'label' => lang('Logfile'), 'formatter' => 'YAHOO.booking.formatGenericLink()', 'sortable' => false), array('key' => 'link', 'hidden' => true)))); $this->render_template('datatable', $data); }
public function index() { if (phpgw::get_var('phpgw_return_as') == 'json') { return $this->index_json(); } self::add_javascript('booking', 'booking', 'datatable.js'); phpgwapi_yui::load_widget('datatable'); phpgwapi_yui::load_widget('paginator'); $data = array('form' => array('toolbar' => array('item' => array(array('type' => 'text', 'name' => 'query'), array('type' => 'submit', 'name' => 'search', 'value' => lang('Search')), array('type' => 'link', 'value' => $_SESSION['showall'] ? lang('Show only active') : lang('Show all'), 'href' => self::link(array('menuaction' => $this->url_prefix . '.toggle_show_inactive')))))), 'datatable' => array('source' => self::link(array('menuaction' => 'booking.uimassbooking.index', 'phpgw_return_as' => 'json')), 'field' => array(array('key' => 'name', 'label' => lang('Building'), 'formatter' => 'YAHOO.booking.formatLink'), array('key' => 'street', 'label' => lang('Street')), array('key' => 'zip_code', 'label' => lang('Zip code')), array('key' => 'city', 'label' => lang('Postal City')), array('key' => 'district', 'label' => lang('District')), array('key' => 'link', 'hidden' => true)))); self::render_template('datatable', $data); }
public function regulations() { if (phpgw::get_var('phpgw_return_as') == 'json') { return $this->regulations_json(); } self::add_javascript('booking', 'booking', 'datatable.js'); phpgwapi_yui::load_widget('datatable'); phpgwapi_yui::load_widget('paginator'); $data = array('form' => array('toolbar' => array('item' => array(array('type' => 'text', 'name' => 'query'), array('type' => 'submit', 'name' => 'search', 'value' => lang('Search'))))), 'datatable' => array('source' => $this->link_to('regulations', array('phpgw_return_as' => 'json')), 'field' => array(array('key' => 'name', 'label' => lang('Name'), 'formatter' => 'YAHOO.booking.formatLink'), array('key' => 'link', 'hidden' => true)))); self::render_template('datatable', $data); }
public function index() { if (phpgw::get_var('phpgw_return_as') == 'json') { return $this->index_json(); } $GLOBALS['phpgw_info']['apps']['manual']['section'] = 'booking_manual'; self::add_javascript('booking', 'booking', 'datatable.js'); phpgwapi_yui::load_widget('datatable'); phpgwapi_yui::load_widget('paginator'); $data = array('form' => array('toolbar' => array('item' => array(array('type' => 'filter', 'name' => 'status', 'text' => lang('Status') . ':', 'list' => array(array('id' => '', 'name' => lang('All')), array('id' => 'NEW', 'name' => lang('NEW')), array('id' => 'PENDING', 'name' => lang('PENDING')), array('id' => 'REJECTED', 'name' => lang('REJECTED')), array('id' => 'ACCEPTED', 'name' => lang('ACCEPTED')))), array('type' => 'autocomplete', 'name' => 'building', 'ui' => 'building', 'text' => lang('Building') . ':'), array('type' => 'text', 'name' => 'query'), array('type' => 'submit', 'name' => 'search', 'value' => lang('Search')), array('type' => 'link', 'value' => $this->show_all_dashboard_applications() ? lang('Show only applications assigned to me') : lang('Show all applications'), 'href' => self::link(array('menuaction' => $this->url_prefix . '.toggle_show_all_dashboard_applications')))))), 'datatable' => array('source' => self::link(array('menuaction' => 'booking.uidashboard.index', 'phpgw_return_as' => 'json')), 'field' => array(array('key' => 'id', 'label' => lang('ID'), 'formatter' => 'YAHOO.booking.formatLink'), array('key' => 'status', 'label' => lang('Status')), array('key' => 'created', 'label' => lang('Created')), array('key' => 'modified', 'label' => lang('Last modified')), array('key' => 'what', 'label' => lang('What')), array('key' => 'activity_name', 'label' => lang('Activity')), array('key' => 'contact_name', 'label' => lang('Contact')), array('key' => 'case_officer_name', 'label' => lang('Case Officer')), array('key' => 'link', 'hidden' => true)))); self::render_template('datatable', $data); }
public function __construct($currentapp = '', $yui = '') { $GLOBALS['phpgw_info']['server']['no_jscombine'] = true; // start: to be removed phpgw::import_class('phpgwapi.yui'); phpgwapi_yui::load_widget('dragdrop'); phpgwapi_yui::load_widget('datatable'); phpgwapi_yui::load_widget('history'); phpgwapi_yui::load_widget('paginator'); phpgwapi_yui::load_widget('menu'); phpgwapi_yui::load_widget('calendar'); phpgwapi_yui::load_widget('autocomplete'); phpgwapi_yui::load_widget('animation'); //end: to be removed $yui = isset($yui) && $yui == 'yui3' ? 'yui3' : 'yahoo'; $currentapp = $currentapp ? $currentapp : $GLOBALS['phpgw_info']['flags']['currentapp']; $this->tmpl_search_path = array(); array_push($this->tmpl_search_path, PHPGW_SERVER_ROOT . '/phpgwapi/templates/base'); array_push($this->tmpl_search_path, PHPGW_SERVER_ROOT . '/phpgwapi/templates/' . $GLOBALS['phpgw_info']['server']['template_set']); array_push($this->tmpl_search_path, PHPGW_SERVER_ROOT . '/' . $currentapp . '/templates/base'); array_push($this->tmpl_search_path, PHPGW_SERVER_ROOT . '/' . $currentapp . '/templates/' . $GLOBALS['phpgw_info']['server']['template_set']); if ($yui == 'yui3') { self::add_javascript('phpgwapi', 'yui3', 'yui/yui-min.js'); } self::add_javascript('phpgwapi', $yui, 'common.js'); phpgwapi_jquery::load_widget('core'); self::add_javascript('phpgwapi', "jquery", 'common.js'); $this->url_prefix = str_replace('_', '.', get_class($this)); $this->dateFormat = $GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']; $this->acl =& $GLOBALS['phpgw']->acl; $this->locations =& $GLOBALS['phpgw']->locations; $GLOBALS['phpgw_info']['flags']['app_header'] = lang($currentapp); self::add_javascript('phpgwapi', 'DataTables', 'media/js/jquery.dataTables.min.js'); self::add_javascript('phpgwapi', 'DataTables', 'extensions/Responsive/js/dataTables.responsive.js'); self::add_javascript('phpgwapi', 'DataTables', 'extensions/ColVis/js/dataTables.colVis.min.js'); self::add_javascript('phpgwapi', 'DataTables', 'extensions/TableTools/js/dataTables.tableTools.js'); self::add_javascript('phpgwapi', 'jquery', 'editable/jquery.jeditable.js'); self::add_javascript('phpgwapi', 'jquery', 'editable/jquery.dataTables.editable.js'); $GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/DataTables/media/css/jquery.dataTables.css'); $GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/DataTables/extensions/Responsive/css/dataTables.responsive.css'); $GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/DataTables/extensions/ColVis/css/dataTables.colVis.min.css'); $GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/DataTables/extensions/ColVis/css/dataTables.colvis.jqueryui.css'); $GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/DataTables/extensions/TableTools/css/dataTables.tableTools.css'); //pop up script self::add_javascript('phpgwapi', 'tinybox2', 'packed.js'); $GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/tinybox2/style.css'); if (phpgw::get_var('nonavbar')) { // $GLOBALS['phpgw_info']['flags']['nonavbar'] = true; $GLOBALS['phpgw_info']['flags']['noframework'] = true; // $GLOBALS['phpgw_info']['flags']['headonly']=true; } }
public function index() { if (phpgw::get_var('phpgw_return_as') == 'json') { return $this->index_json(); } $config = CreateObject('phpgwapi.config', 'booking'); $config->read(); self::add_javascript('booking', 'booking', 'account_code_set.js'); self::add_javascript('booking', 'booking', 'datatable.js'); phpgwapi_yui::load_widget('datatable'); phpgwapi_yui::load_widget('paginator'); $data = array('form' => array('toolbar' => array('item' => array(array('type' => 'text', 'name' => 'query'), array('type' => 'submit', 'name' => 'search', 'value' => lang('Search')), array('type' => 'link', 'value' => $_SESSION['showall'] ? lang('Show only active') : lang('Show all'), 'href' => self::link(array('menuaction' => $this->url_prefix . '.toggle_show_inactive'))))))); $data['datatable']['source'][] = $this->link_to('index', array('phpgw_return_as' => 'json')); $data['datatable']['field'][] = array('key' => 'name', 'label' => lang('Name'), 'formatter' => 'YAHOO.booking.formatLink'); if (isset($config->config_data['dim_3'])) { $data['datatable']['field'][] = array('key' => 'object_number', 'label' => $config->config_data['dim_3']); } if (isset($config->config_data['dim_1'])) { $data['datatable']['field'][] = array('key' => 'responsible_code', 'label' => $config->config_data['dim_1']); } if (isset($config->config_data['article'])) { $data['datatable']['field'][] = array('key' => 'article', 'label' => lang('Article')); } if (isset($config->config_data['dim_2'])) { $data['datatable']['field'][] = array('key' => 'service', 'label' => $config->config_data['dim_2']); } if (isset($config->config_data['dim_4'])) { $data['datatable']['field'][] = array('key' => 'dim_4', 'label' => $config->config_data['dim_4']); } if (isset($config->config_data['dim_5'])) { $data['datatable']['field'][] = array('key' => 'project_number', 'label' => $config->config_data['dim_5']); } if (isset($config->config_data['dim_value_1'])) { $data['datatable']['field'][] = array('key' => 'unit_number', 'label' => $config->config_data['dim_value_1']); } if (isset($config->config_data['dim_value_4'])) { $data['datatable']['field'][] = array('key' => 'dim_value_4', 'label' => $config->config_data['dim_value_4']); } if (isset($config->config_data['dim_value_5'])) { $data['datatable']['field'][] = array('key' => 'dim_value_5', 'label' => $config->config_data['dim_value_5']); } if ($config->config_data['external_format'] != 'KOMMFAKT') { $data['datatable']['field'][] = array('key' => 'unit_prefix', 'label' => lang('Unit prefix')); } $data['datatable']['field'][] = array('key' => 'link', 'hidden' => true); if ($this->bo->allow_create()) { array_unshift($data['form']['toolbar']['item'], array('type' => 'link', 'value' => lang('New Account Codes'), 'href' => $this->link_to('add'))); } self::render_template('datatable', $data); }
public function index() { if (phpgw::get_var('phpgw_return_as') == 'json') { return $this->index_json(); } if (phpgw::get_var('export')) { return $this->export(); } self::add_javascript('booking', 'booking', 'completed_reservation.js'); self::add_javascript('booking', 'booking', 'datatable.js'); phpgwapi_yui::load_widget('datatable'); phpgwapi_yui::load_widget('paginator'); $data = array('form' => array('toolbar' => array('item' => array(array('type' => 'autocomplete', 'name' => 'building', 'ui' => 'building', 'text' => lang('Building') . ':', 'onItemSelect' => 'updateBuildingFilter', 'onClearSelection' => 'clearBuildingFilter'), array('type' => 'autocomplete', 'name' => 'season', 'ui' => 'season', 'text' => lang('Season') . ':', 'requestGenerator' => 'requestWithBuildingFilter'), array('type' => 'date-picker', 'name' => 'to', 'text' => lang('To') . ':'), array('type' => 'submit', 'name' => 'search', 'value' => lang('Search')), array('type' => 'link', 'value' => $_SESSION['show_all_completed_reservations'] ? lang('Show only unexported') : lang('Show all'), 'href' => $this->link_to('toggle_show_all_completed_reservations')))), 'list_actions' => array('item' => array(array('type' => 'submit', 'name' => 'export', 'value' => lang('Export') . '...')))), 'datatable' => array('source' => $this->link_to('index', array('phpgw_return_as' => 'json')), 'sorted_by' => array('key' => 'id', 'dir' => 'desc'), 'field' => array(array('key' => 'id', 'label' => lang('ID'), 'formatter' => 'YAHOO.booking.formatLink'), array('key' => 'reservation_type', 'label' => lang('Res. Type'), 'formatter' => 'YAHOO.booking.formatGenericLink()'), array('key' => 'event_id', 'label' => lang('Event id')), array('key' => 'description', 'label' => lang('Description')), array('key' => 'building_name', 'label' => lang('Building')), array('key' => 'organization_name', 'label' => lang('Organization')), array('key' => 'contact_name', 'label' => lang('Contact')), array('key' => 'customer_type', 'label' => lang('Cust. Type')), array('key' => 'customer_identifier', 'label' => lang('Customer ID'), 'sortable' => false), array('key' => 'from_', 'label' => lang('From')), array('key' => 'to_', 'label' => lang('To')), array('key' => 'cost', 'label' => lang('Cost')), array('key' => 'exported', 'label' => lang('Exported'), 'formatter' => 'YAHOO.booking.formatGenericLink()'), array('key' => 'export_file_id', 'label' => lang('Export File'), 'formatter' => 'YAHOO.booking.formatGenericLink()'), array('key' => 'invoice_file_order_id', 'label' => lang('Order id')), array('key' => 'link', 'hidden' => true)))); $data['filters'] = $this->export_filters; self::render_template('datatable', $data); }
public function index() { if (phpgw::get_var('phpgw_return_as') == 'json') { return $this->index_json(); } self::add_javascript('booking', 'booking', 'allocation_list.js'); self::add_javascript('booking', 'booking', 'datatable.js'); phpgwapi_yui::load_widget('datatable'); phpgwapi_yui::load_widget('paginator'); $data = array('form' => array('toolbar' => array('item' => array(array('type' => 'autocomplete', 'name' => 'building', 'ui' => 'building', 'text' => lang('Building') . ':', 'onItemSelect' => 'updateBuildingFilter', 'onClearSelection' => 'clearBuildingFilter'), array('type' => 'autocomplete', 'name' => 'season', 'ui' => 'season', 'text' => lang('Season') . ':', 'requestGenerator' => 'requestWithBuildingFilter'), array('type' => 'filter', 'name' => 'organizations', 'text' => lang('Organization') . ':', 'list' => $this->bo->so->get_organizations()), array('type' => 'text', 'name' => 'query'), array('type' => 'submit', 'name' => 'search', 'value' => lang('Search')), array('type' => 'link', 'value' => $_SESSION['showall'] ? lang('Show only active') : lang('Show all'), 'href' => self::link(array('menuaction' => $this->url_prefix . '.toggle_show_inactive')))))), 'datatable' => array('source' => self::link(array('menuaction' => 'booking.uibooking.index', 'phpgw_return_as' => 'json')), 'field' => array(array('key' => 'activity_name', 'label' => lang('Activity'), 'formatter' => 'YAHOO.booking.formatLink'), array('key' => 'group_name', 'label' => lang('Group')), array('key' => 'building_name', 'label' => lang('Building')), array('key' => 'season_name', 'label' => lang('Season')), array('key' => 'from_', 'label' => lang('From')), array('key' => 'to_', 'label' => lang('To')), array('key' => 'cost', 'label' => lang('Cost')), array('key' => 'link', 'hidden' => true)))); if ($this->bo->allow_create()) { array_unshift($data['form']['toolbar']['item'], array('type' => 'link', 'value' => lang('New booking'), 'href' => self::link(array('menuaction' => 'booking.uibooking.add')))); } $data['filters'] = $this->export_filters; self::render_template('datatable', $data); }
public function index() { if (phpgw::get_var('phpgw_return_as') == 'json') { return $this->index_json(); } self::add_javascript('booking', 'booking', 'datatable.js'); phpgwapi_yui::load_widget('datatable'); phpgwapi_yui::load_widget('paginator'); // if($_SESSION['showall']) // { // $active_botton = lang('Show only active'); // }else{ // $active_botton = lang('Show all'); // } $data = array('form' => array('toolbar' => array('item' => array(array('type' => 'text', 'name' => 'query'), array('type' => 'submit', 'name' => 'search', 'value' => lang('Search'))))), 'datatable' => array('source' => self::link(array('menuaction' => 'booking.uidocumentation.index', 'phpgw_return_as' => 'json')), 'field' => array(array('key' => 'name', 'label' => lang('Document Name'), 'formatter' => 'YAHOO.booking.formatLink'), array('key' => 'description', 'label' => lang('Description')), array('key' => 'category', 'label' => lang('Category')), array('key' => 'actions', 'label' => lang('Actions'), 'formatter' => 'YAHOO.booking.' . sprintf('formatGenericLink(\'%s\', \'%s\')', lang('edit'), lang('delete'))), array('key' => 'link', 'hidden' => true)))); array_unshift($data['form']['toolbar']['item'], array('type' => 'link', 'value' => lang('New document'), 'href' => self::link(array('menuaction' => $this->module . '.uidocumentation.add')))); self::render_template('datatable', $data); }
public function index() { $config = CreateObject('phpgwapi.config', 'frontend'); $config->read(); $doc_types = isset($config->config_data['document_frontend_cat']) && $config->config_data['document_frontend_cat'] ? $config->config_data['document_frontend_cat'] : array(); $allrows = true; $sodocument = CreateObject('property.sodocument'); $document_list = array(); $total_records = 0; if ($this->location_code) { foreach ($doc_types as $doc_type) { if ($doc_type) { $document_list = array_merge($document_list, $sodocument->read_at_location(array('start' => $this->start, 'query' => $this->query, 'sort' => $this->sort, 'order' => $this->order, 'filter' => $this->filter, 'location_code' => $this->location_code, 'doc_type' => $doc_type, 'allrows' => $allrows))); } $total_records = $total_records + $sodocument->total_records; } } //----------------------------------------------datatable settings-------- $valid_types = isset($config->config_data['document_valid_types']) && $config->config_data['document_valid_types'] ? str_replace(',', '|', $config->config_data['document_valid_types']) : ''; $content = array(); if ($valid_types) { foreach ($document_list as $entry) { if (!preg_match("/({$valid_types})\$/i", $entry['document_name'])) { continue; } $content[] = array('document_id' => $entry['document_id'], 'document_name' => $entry['document_name'], 'link' => $entry['link'], 'title' => $entry['title'], 'doc_type' => $entry['doc_type'], 'document_date' => $GLOBALS['phpgw']->common->show_date($entry['document_date'], $GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'])); } } $datavalues[0] = array('name' => "0", 'values' => json_encode($content), 'total_records' => count($content), 'edit_action' => json_encode($GLOBALS['phpgw']->link('/index.php', array('menuaction' => 'property.uidocument.view_file'))), 'is_paginator' => 1, 'footer' => 0); $myColumnDefs[0] = array('name' => "0", 'values' => json_encode(array(array('key' => 'document_name', 'label' => lang('filename'), 'sortable' => true, 'resizeable' => true, 'formatter' => 'YAHOO.widget.DataTable.formatLink'), array('key' => 'document_id', 'label' => lang('filename'), 'sortable' => false, 'hidden' => true), array('key' => 'title', 'label' => lang('name'), 'sortable' => true, 'resizeable' => true), array('key' => 'doc_type', 'label' => 'Type', 'sortable' => true, 'resizeable' => true), array('key' => 'document_date', 'label' => lang('date'), 'sortable' => true, 'resizeable' => true)))); //----------------------------------------------datatable settings-------- $datatable = array('property_js' => json_encode($GLOBALS['phpgw_info']['server']['webserver_url'] . "/property/js/yahoo/property2.js"), 'datatable' => $datavalues, 'myColumnDefs' => $myColumnDefs); $data = array('header' => $this->header_state, 'tabs' => $this->tabs, 'drawings' => array('datatable' => $datatable)); $GLOBALS['phpgw']->xslttpl->set_var('phpgw', array('app_data' => $data)); $GLOBALS['phpgw']->xslttpl->add_file(array('frontend', 'drawings')); $GLOBALS['phpgw']->js->validate_file('yahoo', 'drawing.list', 'frontend'); phpgwapi_yui::load_widget('dragdrop'); phpgwapi_yui::load_widget('datatable'); phpgwapi_yui::load_widget('connection'); phpgwapi_yui::load_widget('loader'); phpgwapi_yui::load_widget('paginator'); $GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/yahoo/datatable/assets/skins/sam/datatable.css'); $GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/yahoo/paginator/assets/skins/sam/paginator.css'); }
public function index() { if (phpgw::get_var('phpgw_return_as') == 'json') { return $this->index_json(); } if (phpgw::get_var('generate_files')) { $this->generate_files(); } self::add_javascript('booking', 'booking', 'datatable.js'); phpgwapi_yui::load_widget('datatable'); phpgwapi_yui::load_widget('paginator'); $data = array('form' => array('toolbar' => array('item' => array(array('type' => 'date-picker', 'name' => 'to', 'text' => lang('To') . ':'), array('type' => 'submit', 'name' => 'search', 'value' => lang('Search'))))), 'datatable' => array('source' => $this->link_to('index', array('phpgw_return_as' => 'json')), 'sorted_by' => array('key' => 'id', 'dir' => 'desc'), 'field' => array(array('key' => 'id', 'label' => lang('ID'), 'formatter' => 'YAHOO.booking.formatLink'), array('key' => 'building_id', 'label' => lang('Building'), 'formatter' => 'YAHOO.booking.formatGenericLink()'), array('key' => 'season_id', 'label' => lang('Season'), 'formatter' => 'YAHOO.booking.formatGenericLink()'), array('key' => 'from_', 'label' => lang('From')), array('key' => 'to_', 'label' => lang('To')), array('key' => 'created_on', 'label' => lang('Created')), array('key' => 'created_by_name', 'label' => lang('Created by')), array('key' => 'total_items', 'label' => lang('Total Items')), array('key' => 'total_cost', 'label' => lang('Total Cost')), array('key' => 'internal', 'label' => lang('Int. invoice file'), 'formatter' => 'YAHOO.booking.formatGenericLink()', 'sortable' => false), array('key' => 'external', 'label' => lang('Ext. invoice file'), 'formatter' => 'YAHOO.booking.formatGenericLink()', 'sortable' => false), array('key' => 'link', 'hidden' => true)))); if ($GLOBALS['phpgw']->acl->check('run', phpgwapi_acl::READ, 'admin') || $GLOBALS['phpgw']->acl->check('admin', phpgwapi_acl::ADD, 'booking') || $this->bo->has_role(booking_sopermission::ROLE_MANAGER)) { $data['form']['list_actions'] = array('item' => array(array('type' => 'submit', 'name' => 'generate_files', 'value' => lang('Generate files') . '...'))); } $filters_to = strtotime(extract_values($_GET, array("filter_to"))); $data['filters'] = date("Y-m-d", $filters_to); $this->render_template('datatable', $data); }
public function index() { if (phpgw::get_var('phpgw_return_as') == 'json') { return $this->query(); } self::add_javascript('phpgwapi', 'yahoo', 'datatable.js'); phpgwapi_yui::load_widget('datatable'); phpgwapi_yui::load_widget('paginator'); // Sigurd: START as categories $cats = CreateObject('phpgwapi.categories', -1, 'controller', '.control'); $cats->supress_info = true; $control_areas = $cats->formatted_xslt_list(array('format' => 'filter', 'selected' => '', 'globals' => true, 'use_acl' => $this->_category_acl)); array_unshift($control_areas['cat_list'], array('cat_id' => '', 'name' => lang('select value'))); $control_areas_array2 = array(); foreach ($control_areas['cat_list'] as $cat_list) { $control_areas_array2[] = array('id' => $cat_list['cat_id'], 'name' => $cat_list['name']); } // END as categories $data = array('datatable_name' => 'Prosedyrer', 'form' => array('toolbar' => array('item' => array(array('type' => 'filter', 'name' => 'control_areas', 'text' => lang('Control_area') . ':', 'list' => $control_areas_array2), array('type' => 'text', 'text' => lang('search'), 'name' => 'query'), array('type' => 'submit', 'name' => 'search', 'value' => lang('Search')), array('type' => 'link', 'value' => lang('t_new_procedure'), 'href' => self::link(array('menuaction' => 'controller.uiprocedure.add')), 'class' => 'new_item')))), 'datatable' => array('source' => self::link(array('menuaction' => 'controller.uiprocedure.index', 'phpgw_return_as' => 'json')), 'field' => array(array('key' => 'id', 'label' => lang('ID'), 'sortable' => true, 'formatter' => 'YAHOO.portico.formatLink'), array('key' => 'title', 'label' => lang('Procedure title'), 'sortable' => true), array('key' => 'purpose', 'label' => lang('Procedure purpose'), 'sortable' => false), array('key' => 'control_area', 'label' => lang('Control area'), 'sortable' => false), array('key' => 'revision_date', 'label' => lang('Procedure revision date'), 'sortable' => true), array('key' => 'link', 'hidden' => true)))); self::render_template_xsl(array('datatable_common'), $data); }
public function index() { $show_all = phpgw::get_var('show_all') || false; $activities = $this->bo->so->read(array('sort' => 'name', 'dir' => 'ASC')); $children = array(); foreach ($activities['results'] as $activity) { if (!array_key_exists($activity['id'], $children)) { $children[$activity['id']] = array(); } if (!array_key_exists($activity['parent_id'], $children)) { $children[$activity['parent_id']] = array(); } $children[$activity['parent_id']][] = $activity; } $treedata = json_encode($this->treeitem($children, null, $show_all)); phpgwapi_yui::load_widget('treeview'); $links = array('show_inactive' => self::link(array('menuaction' => 'booking.uiactivity.index', 'show_all' => 'true')), 'hide_inactive' => self::link(array('menuaction' => 'booking.uiactivity.index', 'show_all' => ''))); if ($this->bo->allow_create()) { $links['add'] = self::link(array('menuaction' => 'booking.uiactivity.add')); } self::render_template('activities', array('treedata' => $treedata, 'links' => $links, 'show_all' => $show_all)); }
/** * Create tabs * * @param array $tabs With ($id,$tab) pairs * @param integer $selection array key of selected tab * @param boolean $lang Translate label? * * @return string html snippet for creating tabs in a modern browser */ public function create_tabs($tabs, $selection, $lang = false) { phpgw::import_class('phpgwapi.yui'); if ($lang) { foreach ($tabs as &$tab) { $tab = lang($tab); } } $html = phpgwapi_yui::tabview_generate($tabs, $selection); $output = <<<HTML \t\t\t<div class="yui-navset"> \t\t\t\t{$html} \t\t\t</div> HTML; return $output; }
public function index() { if (phpgw::get_var('phpgw_return_as') == 'json') { return $this->query(); } self::add_javascript('phpgwapi', 'yahoo', 'datatable.js'); phpgwapi_yui::load_widget('datatable'); phpgwapi_yui::load_widget('paginator'); $user_array = $this->get_user_array(); $data = array('datatable_name' => lang('Activity') . ' :: ' . lang('allocation'), 'form' => array('toolbar' => array('item' => array(array('type' => 'filter', 'name' => 'user', 'text' => lang('Responsible user') . ':', 'list' => $user_array), array('type' => 'text', 'text' => lang('search'), 'name' => 'query'), array('type' => 'submit', 'name' => 'search', 'value' => lang('Search'))))), 'datatable' => array('source' => self::link(array('menuaction' => 'logistic.uirequirement_resource_allocation.index', 'phpgw_return_as' => 'json')), 'field' => array(array('key' => 'id', 'label' => lang('Id'), 'sortable' => true), array('key' => 'resource_type', 'label' => lang('Resource type'), 'sortable' => true), array('key' => 'requirement_id', 'label' => lang('Requirememnt id'), 'sortable' => true), array('key' => 'location_id', 'label' => lang('Location id'), 'sortable' => true), array('key' => 'resource_id', 'label' => lang('Resource id'), 'sortable' => true), array('key' => 'delete_link', 'label' => lang('Delete'), 'sortable' => true)))); self::render_template_xsl(array('datatable_common'), $data); }
function summary() { $GLOBALS['phpgw_info']['flags']['menu_selection'] .= '::summary'; if (!$this->acl_read) { $this->bocommon->no_access(); return; } $datatable = array(); if (phpgw::get_var('phpgw_return_as') != 'json') { $datatable['menu'] = $this->bocommon->get_menu(); $datatable['config']['base_url'] = $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 'property.uilocation.summary', 'district_id' => $this->district_id, 'part_of_town_id' => $this->part_of_town_id, 'filter' => $this->filter, 'summary' => true)); $datatable['config']['base_java_url'] = "menuaction:'property.uilocation.summary'," . "district_id:'{$this->district_id}'," . "part_of_town_id:'{$this->part_of_town_id}'," . "filter: '{$this->filter}'," . "summary: true"; $datatable['config']['allow_allrows'] = true; $link_data = array('menuaction' => 'property.uilocation.summary', 'district_id' => $this->district_id, 'part_of_town_id' => $this->part_of_town_id, 'filter' => $this->filter, 'summary' => true); $link_download = array('menuaction' => 'property.uilocation.download', 'district_id' => $this->district_id, 'part_of_town_id' => $this->part_of_town_id, 'filter' => $this->filter, 'summary' => true); $values_combo_box[0] = $this->bocommon->select_district_list('filter', $this->district_id); $default_value = array('id' => '', 'name' => lang('no district')); array_unshift($values_combo_box[0], $default_value); $values_combo_box[1] = $this->bocommon->select_part_of_town('filter', $this->part_of_town_id, $this->district_id); $default_value = array('id' => '', 'name' => lang('no part of town')); array_unshift($values_combo_box[1], $default_value); if (isset($GLOBALS['phpgw_info']['user']['preferences']['property']['property_filter']) && $GLOBALS['phpgw_info']['user']['preferences']['property']['property_filter'] == 'owner') { $owner_list = $this->bo->get_owner_list('filter', $this->filter); } else { $owner_list = $this->bo->get_owner_type_list('filter', $this->filter); } $values_combo_box[2] = $owner_list; $default_value = array('id' => '', 'name' => lang('show all')); array_unshift($values_combo_box[2], $default_value); $datatable['actions']['form'] = array(array('action' => $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 'property.uilocation.summary', 'district_id' => $this->district_id, 'part_of_town_id' => $this->part_of_town_id, 'filter' => $this->filter, 'summary' => true)), 'fields' => array('field' => array(array('id' => 'btn_district_id', 'name' => 'district_id', 'value' => lang('district'), 'type' => 'button', 'style' => 'filter', 'tab_index' => 1), array('id' => 'btn_part_of_town_id', 'name' => 'part_of_town_id', 'value' => lang('part of town'), 'type' => 'button', 'style' => 'filter', 'tab_index' => 2), array('id' => 'btn_owner_id', 'name' => 'owner_id', 'value' => lang('owner'), 'type' => 'button', 'style' => 'filter', 'tab_index' => 3), array('type' => 'button', 'id' => 'btn_export', 'value' => lang('download'), 'tab_index' => 4)), 'hidden_value' => array(array('id' => 'values_combo_box_0', 'value' => $this->bocommon->select2String($values_combo_box[0])), array('id' => 'values_combo_box_1', 'value' => $this->bocommon->select2String($values_combo_box[1])), array('id' => 'values_combo_box_2', 'value' => $this->bocommon->select2String($values_combo_box[2])))))); // $dry_run = true; } $summary_list = $this->bo->read_summary(); $uicols = $this->bo->uicols; $j = 0; $count_uicols_name = count($uicols['name']); if (isset($summary_list) and is_array($summary_list)) { foreach ($summary_list as $summary_entry) { for ($k = 0; $k < $count_uicols_name; $k++) { if ($uicols['input_type'][$k] != 'hidden') { $datatable['rows']['row'][$j]['column'][$k]['name'] = $uicols['name'][$k]; $datatable['rows']['row'][$j]['column'][$k]['value'] = $summary_entry[$uicols['name'][$k]]; } } $j++; } } $datatable['rowactions']['action'] = array(); for ($i = 0; $i < $count_uicols_name; $i++) { if ($uicols['input_type'][$i] != 'hidden') { $datatable['headers']['header'][$i]['formatter'] = $uicols['formatter'][$i] == '' ? '""' : $uicols['formatter'][$i]; $datatable['headers']['header'][$i]['name'] = $uicols['name'][$i]; $datatable['headers']['header'][$i]['text'] = $uicols['descr'][$i]; $datatable['headers']['header'][$i]['visible'] = true; $datatable['headers']['header'][$i]['sortable'] = false; } } //path for property.js $property_js = "/property/js/yahoo/property.js"; if (!isset($GLOBALS['phpgw_info']['server']['no_jscombine']) || !$GLOBALS['phpgw_info']['server']['no_jscombine']) { $cachedir = urlencode($GLOBALS['phpgw_info']['server']['temp_dir']); $property_js = "/phpgwapi/inc/combine.php?cachedir={$cachedir}&type=javascript&files=" . str_replace('/', '--', ltrim($property_js, '/')); } $datatable['property_js'] = $GLOBALS['phpgw_info']['server']['webserver_url'] . $property_js; // Pagination and sort values $datatable['pagination']['records_start'] = (int) $this->bo->start; $datatable['pagination']['records_limit'] = $GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs']; $datatable['pagination']['records_returned'] = count($summary_list); $datatable['pagination']['records_total'] = $this->bo->total_records; $appname = lang('Summary'); $function_msg = lang('List') . ' ' . lang($this->role); //-- BEGIN----------------------------- JSON CODE ------------------------------ //values for Pagination $json = array('recordsReturned' => $datatable['pagination']['records_returned'], 'totalRecords' => (int) $datatable['pagination']['records_total'], 'startIndex' => $datatable['pagination']['records_start'], 'sort' => $datatable['sorting']['order'], 'dir' => $datatable['sorting']['sort'], 'records' => array()); // values for datatable if (isset($datatable['rows']['row']) && is_array($datatable['rows']['row'])) { foreach ($datatable['rows']['row'] as $row) { $json_row = array(); foreach ($row['column'] as $column) { if (isset($column['format']) && $column['format'] == "link" && $column['java_link'] == true) { $json_row[$column['name']] = "<a href='#' id='{$column['link']}' onclick='javascript:filter_data(this.id);'>{$column['value']}</a>"; } else { if (isset($column['format']) && $column['format'] == "link") { $json_row[$column['name']] = "<a href='{$column['link']}'>{$column['value']}</a>"; } else { $json_row[$column['name']] = $column['value']; } } } $json['records'][] = $json_row; } } // 'part of town' depended on the selected 'district' $opt_cb_depend = $this->bocommon->select_part_of_town('filter', $this->part_of_town_id, $this->district_id); $default_value = array('id' => '', 'name' => '!no part of town'); array_unshift($opt_cb_depend, $default_value); $json['hidden']['dependent'][] = array('id' => $this->part_of_town_id, 'value' => $this->bocommon->select2String($opt_cb_depend)); // right in datatable if (isset($datatable['rowactions']['action']) && is_array($datatable['rowactions']['action'])) { $json['rights'] = $datatable['rowactions']['action']; } if (phpgw::get_var('phpgw_return_as') == 'json') { return $json; } $datatable['json_data'] = json_encode($json); //-------------------- JSON CODE ---------------------- // Prepare template variables and process XSLT $template_vars = array(); $template_vars['datatable'] = $datatable; $GLOBALS['phpgw']->xslttpl->add_file(array('datatable')); $GLOBALS['phpgw']->xslttpl->set_var('phpgw', $template_vars); phpgwapi_yui::load_widget('dragdrop'); phpgwapi_yui::load_widget('datatable'); phpgwapi_yui::load_widget('menu'); phpgwapi_yui::load_widget('connection'); phpgwapi_yui::load_widget('loader'); phpgwapi_yui::load_widget('tabview'); phpgwapi_yui::load_widget('paginator'); phpgwapi_yui::load_widget('animation'); if (!isset($GLOBALS['phpgw']->css) || !is_object($GLOBALS['phpgw']->css)) { $GLOBALS['phpgw']->css = createObject('phpgwapi.css'); } $GLOBALS['phpgw']->css->validate_file('datatable'); $GLOBALS['phpgw']->css->validate_file('property'); $GLOBALS['phpgw']->css->add_external_file('property/templates/base/css/property.css'); $GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/yahoo/datatable/assets/skins/sam/datatable.css'); $GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/yahoo/paginator/assets/skins/sam/paginator.css'); $GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/yahoo/container/assets/skins/sam/container.css'); $GLOBALS['phpgw_info']['flags']['app_header'] = lang('property') . ' - ' . $appname . ': ' . $function_msg; $GLOBALS['phpgw']->js->validate_file('yahoo', 'location.summary', 'property'); }
$tpl = CreateObject('phpgwapi.Template', dirname(__FILE__), "remove"); $tpl->set_file(array('head' => 'head.tpl')); $tpl->set_block('head', 'theme_stylesheet', 'theme_stylesheets'); $app = $GLOBALS['phpgw_info']['flags']['currentapp']; $theme_styles = array(); if (!isset($GLOBALS['phpgw_info']['flags']['noframework'])) { phpgwapi_yui::load_widget('dragdrop'); phpgwapi_yui::load_widget('element'); phpgwapi_yui::load_widget('container'); phpgwapi_yui::load_widget('connection'); phpgwapi_yui::load_widget('resize'); phpgwapi_yui::load_widget('layout'); $javascripts = array("/phpgwapi/js/json/json.js", "/phpgwapi/templates/portico/js/base.js"); $theme_styles = array("{$GLOBALS['phpgw_info']['server']['webserver_url']}/phpgwapi/templates/simple/css/base.css", "{$GLOBALS['phpgw_info']['server']['webserver_url']}/phpgwapi/js/yahoo/reset-fonts-grids/reset-fonts-grids.css", "{$GLOBALS['phpgw_info']['server']['webserver_url']}/phpgwapi/js/yahoo/menu/assets/skins/sam/menu.css", "{$GLOBALS['phpgw_info']['server']['webserver_url']}/phpgwapi/js/yahoo/button/assets/skins/sam/button.css", "{$GLOBALS['phpgw_info']['server']['webserver_url']}/phpgwapi/js/yahoo/tabview/assets/skins/sam/tabview.css", "{$GLOBALS['phpgw_info']['server']['webserver_url']}/phpgwapi/js/yahoo/resize/assets/skins/sam/resize.css", "{$GLOBALS['phpgw_info']['server']['webserver_url']}/phpgwapi/js/yahoo/layout/assets/skins/sam/layout.css"); } phpgwapi_yui::load_widget('button'); if (file_exists(PHPGW_SERVER_ROOT . '/phpgwapi/templates/simple/css/' . $GLOBALS['phpgw_info']['user']['preferences']['common']['theme'] . '.css')) { $theme_styles[] = "{$GLOBALS['phpgw_info']['server']['webserver_url']}/phpgwapi/templates/simple/css/{$GLOBALS['phpgw_info']['user']['preferences']['common']['theme']}.css"; } else { $theme_styles[] = "{$GLOBALS['phpgw_info']['server']['webserver_url']}/phpgwapi/templates/simple/css/simple.css"; $GLOBALS['phpgw_info']['user']['preferences']['common']['theme'] = 'simple'; } if (file_exists(PHPGW_SERVER_ROOT . "/{$app}/templates/base/css/base.css")) { $theme_styles[] = "{$GLOBALS['phpgw_info']['server']['webserver_url']}/{$app}/templates/base/css/base.css"; } if (file_exists(PHPGW_SERVER_ROOT . "/{$app}/templates/simple/css/base.css")) { $theme_styles[] = "{$GLOBALS['phpgw_info']['server']['webserver_url']}/{$app}/templates/simple/css/base.css"; } if (file_exists(PHPGW_SERVER_ROOT . "/{$app}/templates/simple/css/{$GLOBALS['phpgw_info']['user']['preferences']['common']['theme']}.css")) { $theme_styles[] = "{$GLOBALS['phpgw_info']['server']['webserver_url']}/{$app}/templates/simple/css/{$GLOBALS['phpgw_info']['user']['preferences']['common']['theme']}.css"; }
public function reporting() { $acl_location = '.demo_location'; if (!$this->acl_read) { $this->bocommon->no_access(); return; } $type = phpgw::get_var('type', 'string', 'GET', 'deposition'); $GLOBALS['phpgw_info']['flags']['menu_selection'] .= "::{$type}"; $values = phpgw::get_var('values'); $receipt = array(); if ($values) { // _debug_array($values);die(); if (isset($values['export_reconciliation']) && $values['export_reconciliation']) { if (!isset($values['periods'])) { $type = 'reconciliation'; $receipt['error'][] = array('msg' => lang('missing values')); } else { $this->bo->export_historical_transactions_at_periods($values['periods']); } } else { if (isset($values['export_deposition']) && $values['export_deposition']) { if (!isset($values['deposition'])) { $type = 'deposition'; $receipt['error'][] = array('msg' => lang('nothing to do')); } else { $this->bo->export_deposition(); } } } } $tab_info = array('deposition' => array('label' => lang('deposition'), 'link' => '#deposition'), 'reconciliation' => array('label' => lang('reconciliation'), 'link' => '#reconciliation')); phpgwapi_yui::tabview_setup('reporting_tabview'); $msgbox_data = isset($receipt) ? $GLOBALS['phpgw']->common->msgbox_data($receipt) : ''; $data = array('msgbox_data' => $GLOBALS['phpgw']->common->msgbox($msgbox_data), 'form_action' => $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 'property.uiinvoice.reporting')), 'accounting_periods' => array('options' => $this->bo->get_historical_accounting_periods()), 'tabs' => phpgwapi_yui::tabview_generate($tab_info, $type)); $function_msg = lang('reporting'); $appname = lang('invoice'); $GLOBALS['phpgw_info']['flags']['app_header'] = lang('property') . ' - ' . $appname . ': ' . $function_msg; $GLOBALS['phpgw']->xslttpl->add_file(array('invoice_reporting', 'attributes_form')); $GLOBALS['phpgw']->xslttpl->set_var('phpgw', array('reporting' => $data)); }
public function view_resource_allocation() { $activity_id = phpgw::get_var('activity_id'); $activity = $this->so->get_single($activity_id); $data = array('form' => array('toolbar' => array('item' => array(array('type' => 'text', 'text' => lang('search'), 'name' => 'query'), array('type' => 'submit', 'name' => 'search', 'value' => lang('Search'))))), 'datatable' => array('source' => self::link(array('menuaction' => 'logistic.uirequirement.index', 'activity_id' => $activity_id, 'phpgw_return_as' => 'json')), 'field' => array(array('key' => 'id', 'label' => lang('Id'), 'sortable' => true), array('key' => 'start_date', 'label' => lang('Start date'), 'sortable' => false), array('key' => 'end_date', 'label' => lang('End date'), 'sortable' => false), array('key' => 'no_of_items', 'label' => lang('Num required'), 'sortable' => false), array('key' => 'allocated', 'label' => lang('Num allocated'), 'sortable' => false), array('key' => 'location_label', 'label' => lang('Resource type'), 'sortable' => false), array('key' => 'criterias', 'label' => lang('Criterias'), 'sortable' => false), array('key' => 'link', 'hidden' => true), array('key' => 'id', 'className' => 'requirement_id', 'hidden' => true), array('key' => 'status', 'label' => lang('Status requirement'), 'sortable' => false)))); if ($this->acl_add) { $data['datatable']['field'][] = array('key' => 'alloc_link', 'label' => lang('Allocate resources'), 'sortable' => false); } if ($this->acl_add) { $data['datatable']['field'][] = array('key' => 'edit_requirement_link', 'label' => lang('Edit requirement'), 'sortable' => false); } if ($this->acl_delete) { $data['datatable']['field'][] = array('key' => 'delete_requirement_link', 'label' => lang('Delete requirement'), 'sortable' => false); } phpgwapi_yui::load_widget('datatable'); phpgwapi_yui::load_widget('paginator'); phpgwapi_jquery::load_widget('core'); $tabs = $this->make_tab_menu($activity_id); $data['tabs'] = $GLOBALS['phpgw']->common->create_tabs($tabs, 1); $data['view'] = 'requirement_overview'; $data['activity'] = $activity; $data['breadcrumb'] = $this->_get_breadcrumb($activity_id, 'logistic.uiactivity.view_resource_allocation', 'activity_id'); $data['acl_add'] = $this->acl_add; self::add_javascript('logistic', 'logistic', 'resource_allocation.js'); self::add_javascript('logistic', 'logistic', 'requirement_overview.js'); self::add_javascript('logistic', 'logistic', 'requirement.js'); self::add_javascript('phpgwapi', 'tinybox2', 'packed.js'); $GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/tinybox2/style.css'); self::render_template_xsl(array('activity/view_activity_item', 'requirement/requirement_overview', 'activity/activity_tabs'), $data); }
function view() { $custom_id = phpgw::get_var('custom_id', 'int', 'GET'); $datatable = array(); if (phpgw::get_var('phpgw_return_as') != 'json') { $datatable['menu'] = $this->bocommon->get_menu(); $datatable['config']['base_url'] = $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 'property.uicustom.view', 'sort' => $this->sort, 'order' => $this->order, 'custom_id' => $custom_id, 'filter' => $this->filter, 'query' => $this->query)); $datatable['config']['base_java_url'] = "menuaction:'property.uicustom.view'," . "sort:'{$this->sort}'," . "order:'{$this->order}'," . "custom_id:'{$custom_id}'," . "filter:'{$this->filter}'," . "query:'{$this->query}'"; $link_data = array('menuaction' => 'property.uicustom.view', 'sort' => $this->sort, 'order' => $this->order, 'custom_id' => $custom_id, 'filter' => $this->filter, 'query' => $this->query); $datatable['config']['allow_allrows'] = true; $datatable['actions']['form'] = array(array('action' => $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 'property.uicustom.view', 'sort' => $this->sort, 'order' => $this->order, 'custom_id' => $custom_id, 'filter' => $this->filter, 'query' => $this->query)), 'fields' => array('field' => array('type' => 'button', 'id' => 'btn_export', 'value' => lang('download'), 'tab_index' => 1)))); } //_debug_array($custom_id);die; $list = $this->bo->read_custom($custom_id); $uicols = $this->bo->uicols; $j = 0; $count_uicols_name = count($uicols); if (isset($list) and is_array($list)) { foreach ($list as $list_entry) { for ($k = 0; $k < $count_uicols_name; $k++) { $datatable['rows']['row'][$j]['column'][$k]['name'] = $uicols[$k]['name']; $datatable['rows']['row'][$j]['column'][$k]['value'] = $list_entry[$uicols[$k]['name']]; } $j++; } $datatable['rowactions']['action'] = array(); } //_debug_array($datatable);die; for ($i = 0; $i < $count_uicols_name; $i++) { if ($uicols['input_type'][$i] != 'hidden') { $datatable['headers']['header'][$i]['formatter'] = $uicols[$i]['formatter'] == '' ? '""' : $uicols[$i]['formatter']; $datatable['headers']['header'][$i]['name'] = $uicols[$i]['name']; $datatable['headers']['header'][$i]['text'] = $uicols[$i]['descr']; $datatable['headers']['header'][$i]['visible'] = true; $datatable['headers']['header'][$i]['sortable'] = false; } } $link_download = array('menuaction' => 'property.uicustom.download', 'sort' => $this->sort, 'order' => $this->order, 'filter' => $this->filter, 'query' => $this->query, 'custom_id' => $custom_id, 'allrows' => $this->allrows); //path for property.js $property_js = "/property/js/yahoo/property.js"; if (!isset($GLOBALS['phpgw_info']['server']['no_jscombine']) || !$GLOBALS['phpgw_info']['server']['no_jscombine']) { $cachedir = urlencode($GLOBALS['phpgw_info']['server']['temp_dir']); $property_js = "/phpgwapi/inc/combine.php?cachedir={$cachedir}&type=javascript&files=" . str_replace('/', '--', ltrim($property_js, '/')); } $datatable['property_js'] = $GLOBALS['phpgw_info']['server']['webserver_url'] . $property_js; // Pagination and sort values $datatable['pagination']['records_start'] = (int) $this->bo->start; $datatable['pagination']['records_limit'] = $GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs']; $datatable['pagination']['records_returned'] = count($list); $datatable['pagination']['records_total'] = $this->bo->total_records; $appname = lang('documents'); $function_msg = lang('list documents'); //_debug_array($datatable['headers']['header']);die; if (phpgw::get_var("start") == "" && phpgw::get_var("order", 'string') == "") { $datatable['sorting']['order'] = $datatable['headers']['header'][0]['name']; // name key Column in myColumnDef $datatable['sorting']['sort'] = 'asc'; // ASC / DESC } else { $datatable['sorting']['order'] = null; // name of column of Database $datatable['sorting']['sort'] = null; // ASC / DESC } phpgwapi_yui::load_widget('dragdrop'); phpgwapi_yui::load_widget('datatable'); phpgwapi_yui::load_widget('menu'); phpgwapi_yui::load_widget('connection'); phpgwapi_yui::load_widget('loader'); phpgwapi_yui::load_widget('tabview'); phpgwapi_yui::load_widget('paginator'); phpgwapi_yui::load_widget('animation'); //-- BEGIN----------------------------- JSON CODE ------------------------------ //values for Pagination $json = array('recordsReturned' => $datatable['pagination']['records_returned'], 'totalRecords' => (int) $datatable['pagination']['records_total'], 'startIndex' => $datatable['pagination']['records_start'], 'sort' => $datatable['sorting']['order'], 'dir' => $datatable['sorting']['sort'], 'records' => array()); // values for datatable if (isset($datatable['rows']['row']) && is_array($datatable['rows']['row'])) { foreach ($datatable['rows']['row'] as $row) { $json_row = array(); foreach ($row['column'] as $column) { if (isset($column['format']) && $column['format'] == "link" && $column['java_link'] == true) { $json_row[$column['name']] = "<a href='#' id='" . $column['link'] . "' onclick='javascript:filter_data(this.id);'>" . $column['value'] . "</a>"; } else { if (isset($column['format']) && $column['format'] == "link") { $json_row[$column['name']] = "<a href='" . $column['link'] . "'>" . $column['value'] . "</a>"; } else { $json_row[$column['name']] = $column['value']; } } } $json['records'][] = $json_row; } } // right in datatable if (isset($datatable['rowactions']['action']) && is_array($datatable['rowactions']['action'])) { $json['rights'] = $datatable['rowactions']['action']; } if (phpgw::get_var('phpgw_return_as') == 'json') { return $json; } $datatable['json_data'] = json_encode($json); //-------------------- JSON CODE ---------------------- $template_vars = array(); $template_vars['datatable'] = $datatable; $GLOBALS['phpgw']->xslttpl->add_file(array('datatable')); $GLOBALS['phpgw']->xslttpl->set_var('phpgw', $template_vars); if (!isset($GLOBALS['phpgw']->css) || !is_object($GLOBALS['phpgw']->css)) { $GLOBALS['phpgw']->css = createObject('phpgwapi.css'); } $GLOBALS['phpgw']->css->validate_file('datatable'); $GLOBALS['phpgw']->css->validate_file('property'); $GLOBALS['phpgw']->css->add_external_file('property/templates/base/css/property.css'); $GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/yahoo/datatable/assets/skins/sam/datatable.css'); $GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/yahoo/paginator/assets/skins/sam/paginator.css'); $GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/yahoo/container/assets/skins/sam/container.css'); $GLOBALS['phpgw_info']['flags']['app_header'] = lang('property') . ' - ' . $appname . ': ' . $function_msg; $GLOBALS['phpgw']->js->validate_file('yahoo', 'custom.view', 'property'); //$this->save_sessiondata(); }
public function index() { $GLOBALS['phpgw_info']['apps']['manual']['section'] = 'helpdesk.index'; $this->insert_links_on_header_state(); $bo = CreateObject('property.botts'); $dry_run = false; $second_display = phpgw::get_var('second_display', 'bool'); $datatable = array(); if (phpgw::get_var('phpgw_return_as') != 'json') { $datatable['config']['allow_allrows'] = true; $datatable['config']['base_java_url'] = "menuaction:'frontend.uihelpdesk.index'," . "second_display:1," . "sort: '{$this->sort}'," . "order: '{$this->order}'," . "cat_id:'{$this->cat_id}'," . "status_id: '{$this->status_id}'," . "user_id: '{$this->user_id}'," . "query: '{$this->query}'," . "district_id: '{$this->district_id}'," . "start_date: '{$start_date}'," . "end_date: '{$end_date}'," . "allrows:'{$this->allrows}'"; $this->bocommon = CreateObject('property.bocommon', true); $values_combo_box = array(0 => array('id' => 'all', 'name' => lang("All"), 'selected' => 'selected'), 1 => array('id' => 'X', 'name' => lang("Closed")), 2 => array('id' => 'O', 'name' => lang("Open"))); $datatable['actions']['form'] = array(array('action' => $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 'frontend.uihelpdesk.index', 'second_display' => $second_display, 'status' => $this->status)), 'fields' => array('field' => array(array('type' => 'button', 'id' => 'btn_new', 'value' => lang('new_ticket'), 'tab_index' => 3), array('id' => 'btn_status_id', 'name' => 'status_id', 'value' => lang('Status'), 'type' => 'button', 'style' => 'filter', 'tab_index' => 2)), 'hidden_value' => array(array('id' => 'values_combo_box', 'value' => $this->bocommon->select2String($values_combo_box)))))); $dry_run = true; } if (isset($this->location_code) && $this->location_code != '') { $bo->location_code = $this->location_code; //to make sure the list select "All" not only the open ones if (phpgw::get_var("status_id") == "") { $bo->status_id = 'all'; } $ticket_list = $bo->read('', '', '', $dry_run); } else { $ticket_list = null; } $uicols = array(); $uicols['name'][] = 'id'; $uicols['descr'][] = lang('id'); $uicols['name'][] = 'subject'; $uicols['descr'][] = lang('subject'); $uicols['name'][] = 'entry_date'; $uicols['descr'][] = lang('entry_date'); $uicols['name'][] = 'status'; $uicols['descr'][] = lang('status'); $uicols['name'][] = 'user'; $uicols['descr'][] = lang('user'); $count_uicols_name = count($uicols['name']); if (is_array($ticket_list)) { $status['X'] = array('status' => lang('closed')); $status['O'] = array('status' => isset($bo->config->config_data['tts_lang_open']) && $bo->config->config_data['tts_lang_open'] ? $bo->config->config_data['tts_lang_open'] : lang('Open')); $custom_status = $bo->get_custom_status(); foreach ($custom_status as $custom) { $status["C{$custom['id']}"] = array('status' => $custom['name']); } $j = 0; foreach ($ticket_list as $ticket) { for ($k = 0; $k < $count_uicols_name; $k++) { if ($uicols['name'][$k] == 'status' && array_key_exists($ticket[$uicols['name'][$k]], $status)) { $datatable['rows']['row'][$j]['column'][$k]['name'] = $uicols['name'][$k]; $datatable['rows']['row'][$j]['column'][$k]['value'] = $status[$ticket[$uicols['name'][$k]]]['status']; } else { $datatable['rows']['row'][$j]['column'][$k]['name'] = $uicols['name'][$k]; $datatable['rows']['row'][$j]['column'][$k]['value'] = $ticket[$uicols['name'][$k]]; } } $j++; } } $parameters = array('parameter' => array(array('name' => 'id', 'source' => 'id'))); $datatable['rowactions']['action'][] = array('my_name' => 'view', 'statustext' => lang('view the ticket'), 'text' => lang('view'), 'action' => $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 'frontend.uihelpdesk.view')), 'parameters' => $parameters); $link = $GLOBALS['phpgw']->link('/index.php', array('menuaction' => 'frontend.uihelpdesk.view')); $datatable['exchange_values'] = "document.location = '{$link}&id=' + data.getData().id;"; unset($parameters); for ($i = 0; $i < $count_uicols_name; $i++) { $datatable['headers']['header'][$i]['formatter'] = !isset($uicols['formatter'][$i]) || $uicols['formatter'][$i] == '' ? '""' : $uicols['formatter'][$i]; $datatable['headers']['header'][$i]['name'] = $uicols['name'][$i]; $datatable['headers']['header'][$i]['text'] = $uicols['descr'][$i]; $datatable['headers']['header'][$i]['visible'] = true; $datatable['headers']['header'][$i]['sortable'] = false; if ($uicols['name'][$i] == 'id' || $uicols['name'][$i] == 'user' || $uicols['name'][$i] == 'entry_date') { $datatable['headers']['header'][$i]['sortable'] = true; $datatable['headers']['header'][$i]['sort_field'] = $uicols['name'][$i]; } if ($uicols['name'][$i] == 'id') { $datatable['headers']['header'][$i]['visible'] = false; } } //path for property.js $datatable['property_js'] = $GLOBALS['phpgw_info']['server']['webserver_url'] . "/property/js/yahoo/property.js"; // Pagination and sort values $datatable['pagination']['records_start'] = (int) $bo->start; $datatable['pagination']['records_limit'] = $GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs']; if ($dry_run) { $datatable['pagination']['records_returned'] = $GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs']; } else { $datatable['pagination']['records_returned'] = count($ticket_list); } $datatable['pagination']['records_total'] = $bo->total_records; $datatable['sorting']['order'] = phpgw::get_var('order', 'string'); // Column $appname = lang('helpdesk'); $function_msg = lang('list ticket'); if (phpgw::get_var("start") == "" && phpgw::get_var("order", 'string') == "") { $datatable['sorting']['order'] = 'entry_date'; // name key Column in myColumnDef $datatable['sorting']['sort'] = 'desc'; // ASC / DESC } else { $datatable['sorting']['order'] = phpgw::get_var('order', 'string'); // name of column of Database $datatable['sorting']['sort'] = phpgw::get_var('sort', 'string'); // ASC / DESC } //-- BEGIN----------------------------- JSON CODE ------------------------------ //values for Pagination $json = array('recordsReturned' => $datatable['pagination']['records_returned'], 'totalRecords' => (int) $datatable['pagination']['records_total'], 'startIndex' => $datatable['pagination']['records_start'], 'sort' => $datatable['sorting']['order'], 'dir' => $datatable['sorting']['sort'], 'records' => array()); // values for datatable if (is_array($datatable['rows']['row'])) { foreach ($datatable['rows']['row'] as $row) { $json_row = array(); foreach ($row['column'] as $column) { $json_row[$column['name']] = $column['value']; } $json['records'][] = $json_row; } } // right in datatable if (is_array($datatable['rowactions']['action'])) { $json['rights'] = $datatable['rowactions']['action']; } if (phpgw::get_var('phpgw_return_as') == 'json') { return $json; } $datatable['json_data'] = json_encode($json); //-------------------- JSON CODE ---------------------- // Prepare template variables and process XSLT if (!isset($GLOBALS['phpgw']->css) || !is_object($GLOBALS['phpgw']->css)) { $GLOBALS['phpgw']->css = createObject('phpgwapi.css'); } phpgwapi_yui::load_widget('dragdrop'); phpgwapi_yui::load_widget('datatable'); phpgwapi_yui::load_widget('menu'); phpgwapi_yui::load_widget('connection'); phpgwapi_yui::load_widget('loader'); phpgwapi_yui::load_widget('paginator'); // Prepare CSS Style $GLOBALS['phpgw']->css->validate_file('datatable'); $GLOBALS['phpgw']->css->validate_file('property'); $GLOBALS['phpgw']->css->add_external_file('property/templates/base/css/property.css'); $GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/yahoo/datatable/assets/skins/sam/datatable.css'); $GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/yahoo/paginator/assets/skins/sam/paginator.css'); $GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/yahoo/container/assets/skins/sam/container.css'); $GLOBALS['phpgw_info']['flags']['app_header'] = lang('frontend') . ' - ' . $appname . ': ' . $function_msg; $GLOBALS['phpgw']->css->add_external_file('property/js/tinybox2/style.css'); $GLOBALS['phpgw']->js->validate_file('tinybox2', 'packed', 'property'); $GLOBALS['phpgw']->js->validate_file('yahoo', 'helpdesk.list', 'frontend'); $msglog = phpgwapi_cache::session_get('frontend', 'msgbox'); phpgwapi_cache::session_clear('frontend', 'msgbox'); $data = array('header' => $this->header_state, 'tabs' => $this->tabs, 'helpdesk' => array('datatable' => $datatable, 'msgbox_data' => $GLOBALS['phpgw']->common->msgbox($GLOBALS['phpgw']->common->msgbox_data($msglog))), 'lightbox_name' => lang('add ticket')); $GLOBALS['phpgw']->xslttpl->add_file(array('frontend', 'helpdesk', 'datatable')); $GLOBALS['phpgw']->xslttpl->set_var('phpgw', array('app_data' => $data)); }