[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [12997] converting logistic
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [12997] converting logistic |
Date: |
Mon, 13 Apr 2015 17:37:06 +0000 |
Revision: 12997
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=12997
Author: sigurdne
Date: 2015-04-13 17:37:05 +0000 (Mon, 13 Apr 2015)
Log Message:
-----------
converting logistic
Modified Paths:
--------------
branches/dev-syncromind/logistic/inc/class.soactivity.inc.php
branches/dev-syncromind/logistic/inc/class.uiactivity.inc.php
branches/dev-syncromind/logistic/inc/class.uiproject.inc.php
branches/dev-syncromind/logistic/inc/class.uirequirement.inc.php
branches/dev-syncromind/logistic/inc/class.uirequirement_resource_allocation.inc.php
branches/dev-syncromind/logistic/inc/class.uiresource_type_requirement.inc.php
branches/dev-syncromind/logistic/js/logistic/requirement_overview.js
branches/dev-syncromind/logistic/templates/base/activity/activity_tabs.xsl
branches/dev-syncromind/logistic/templates/base/activity/add_activity_item.xsl
branches/dev-syncromind/logistic/templates/base/activity/view_activity_item.xsl
branches/dev-syncromind/logistic/templates/base/allocation/book_resources.xsl
branches/dev-syncromind/logistic/templates/base/css/base.css
branches/dev-syncromind/logistic/templates/base/project/project_item.xsl
branches/dev-syncromind/logistic/templates/base/project/resource_type_requirement_item.xsl
branches/dev-syncromind/logistic/templates/base/requirement/requirement_item.xsl
branches/dev-syncromind/logistic/templates/base/requirement/requirement_overview.xsl
branches/dev-syncromind/logistic/templates/base/requirement/requirement_tabs.xsl
branches/dev-syncromind/logistic/templates/base/requirement/requirement_values.xsl
Modified: branches/dev-syncromind/logistic/inc/class.soactivity.inc.php
===================================================================
--- branches/dev-syncromind/logistic/inc/class.soactivity.inc.php
2015-04-13 17:36:12 UTC (rev 12996)
+++ branches/dev-syncromind/logistic/inc/class.soactivity.inc.php
2015-04-13 17:37:05 UTC (rev 12997)
@@ -215,7 +215,7 @@
* @return array of objects. May return an empty
* array, never null. The array keys are the respective index
numbers.
*/
- public function get(int $start_index, int $num_of_objects,
string $sort_field, boolean $ascending, string $search_for, string
$search_type, array $filters, boolean $allrows)
+ public function get($start_index, $num_of_objects, $sort_field,
$ascending, $search_for, $search_type, $filters, $allrows)
{
if($sort_field == null || $sort_field == 'id' ||
$sort_field == '')
{
Modified: branches/dev-syncromind/logistic/inc/class.uiactivity.inc.php
===================================================================
--- branches/dev-syncromind/logistic/inc/class.uiactivity.inc.php
2015-04-13 17:36:12 UTC (rev 12996)
+++ branches/dev-syncromind/logistic/inc/class.uiactivity.inc.php
2015-04-13 17:37:05 UTC (rev 12997)
@@ -32,13 +32,13 @@
phpgw::import_class('logistic.sorequirement');
phpgw::import_class('logistic.sorequirement_resource_allocation');
- phpgw::import_class('phpgwapi.uicommon');
+ phpgw::import_class('phpgwapi.uicommon_jquery');
phpgw::import_class('logistic.soactivity');
phpgw::import_class('phpgwapi.jquery');
include_class('logistic', 'actvity');
- class logistic_uiactivity extends phpgwapi_uicommon
+ class logistic_uiactivity extends phpgwapi_uicommon_jquery
{
private $so;
private $so_project;
@@ -79,6 +79,7 @@
$this->acl_delete =
$GLOBALS['phpgw']->acl->check('.activity', PHPGW_ACL_DELETE, 'logistic');//8
$this->acl_manage =
$GLOBALS['phpgw']->acl->check('.activity', 16, 'logistic');//16
+
$GLOBALS['phpgw']->css->add_external_file('logistic/templates/base/css/base.css');
}
public function index()
@@ -88,10 +89,6 @@
return $this->query();
}
- self::add_javascript('phpgwapi', 'yahoo',
'datatable.js');
- phpgwapi_yui::load_widget('datatable');
- phpgwapi_yui::load_widget('paginator');
-
$project_array = $this->so_project->get_projects();
$user_array = $this->get_user_array();
@@ -110,16 +107,7 @@
'text' =>
lang('Responsible user') . ':',
'list' =>
$user_array,
),
- array('type' => 'text',
- 'text' =>
lang('search'),
- 'name' =>
'query'
- ),
array(
- 'type' =>
'submit',
- 'name' =>
'search',
- 'value' =>
lang('Search')
- ),
- array(
'type' =>
'link',
'value' =>
lang('Add activity'),
'href' =>
self::link(array('menuaction' => 'logistic.uiactivity.add')),
@@ -133,13 +121,9 @@
'field' => array(
array(
'key' => 'id',
- 'hidden' => true
- ),
- array(
- 'key' => 'id_link',
'label' => lang('Id'),
'sortable' => true,
- 'formatter' =>
'YAHOO.portico.formatLink'
+ 'formatter' =>
'JqueryPortico.formatLink'
),
array(
'key' => 'name',
@@ -262,21 +246,17 @@
);
- self::render_template_xsl(array('datatable_common'),
$data);
+ self::render_template_xsl(array('datatable_jquery'),
$data);
}
public function query()
{
- $params = array(
- 'start' => phpgw::get_var('startIndex', 'int',
'REQUEST', 0),
- 'results' => phpgw::get_var('results', 'int',
'REQUEST', null),
- 'query' => phpgw::get_var('query'),
- 'sort' => phpgw::get_var('sort'),
- 'dir' => phpgw::get_var('dir'),
- 'filters' => $filters
- );
+ $search = phpgw::get_var('search');
+ $order = phpgw::get_var('order');
+ $draw = phpgw::get_var('draw', 'int');
+ $columns = phpgw::get_var('columns');
- if
($GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'] > 0)
+
if($GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'] > 0)
{
$user_rows_per_page =
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];
}
@@ -285,15 +265,22 @@
$user_rows_per_page = 10;
}
- // YUI variables for paging and sorting
- $start_index = phpgw::get_var('startIndex', 'int');
- $num_of_objects = phpgw::get_var('results', 'int',
'GET', $user_rows_per_page);
- $sort_field = phpgw::get_var('sort');
- $sort_ascending = phpgw::get_var('dir') == 'desc' ?
false : true;
-
+ $params = array(
+ 'start' => phpgw::get_var('start', 'int',
'REQUEST', 0),
+ 'results' => phpgw::get_var('length', 'int',
'REQUEST', $user_rows_per_page),
+ 'query' => $search['value'],
+ 'order' =>
$columns[$order[0]['column']]['data'],
+ 'sort' => $order[0]['dir'],
+ 'allrows' => phpgw::get_var('length', 'int') ==
-1,
+ );
+
+ $start_index = $params['start'];
+ $num_of_objects = $params['results'] < 0 ? null :
$params['results'];
+ $sort_field = $params['order'];
+ $sort_ascending = $params['sort'] == 'desc' ? false :
true;
// Form variables
- $search_for = phpgw::get_var('query');
- $search_type = phpgw::get_var('search_option');
+ $search_for = $params['query'];
+ $search_type = phpgw::get_var('search_option');
// Create an empty result set
$result_objects = array();
@@ -398,23 +385,17 @@
$result_data['start'] = $params['start'];
$result_data['sort'] = $params['sort'];
$result_data['dir'] = $params['dir'];
+ $result_data['draw'] = $draw;
$editable = phpgw::get_var('editable') == 'true' ? true
: false;
if (!$export)
{
-
//Add action column to each row in result table
-/*
- array_walk(
-
$result_data['results'],
- array($this,
'_add_links'),
-
"logistic.uiactivity.view"
- );
-*/
+ array_walk(
$result_data['results'],array($this, '_add_links'),
"logistic.uiactivity.view");
}
- return $this->yui_results($result_data);
+ return $this->jquery_results($result_data);
}
public function add()
@@ -508,7 +489,7 @@
$data['projects'] = $projects;
}
- $this->use_yui_editor('description');
+ $this->rich_text_editor('description');
$GLOBALS['phpgw_info']['flags']['app_header'] =
lang('logistic') . '::' . lang('Add activity');
$GLOBALS['phpgw']->jqcal->add_listener('start_date',
'datetime');
@@ -536,11 +517,33 @@
$breadcrumb = $this->_get_breadcrumb(
$activity_id, 'logistic.uiactivity.view', 'id');
}
+ $datatable_def = array();
+
+ $datatable_def[] = array
+ (
+ 'container' =>
'datatable-container_0',
+ 'requestUrl' =>
json_encode(self::link(array('menuaction' => 'logistic.uiactivity.index',
'activity_id' => $activity_id, 'type' => 'children',
'phpgw_return_as'=>'json'))),
+ 'ColumnDefs' => array
+ (
+ array('key' => 'id',
'label'=>lang('id'), 'sortable'=>false),
+ array('key' => 'name',
'label'=>lang('name'), 'sortable'=>false),
+ array('key' => 'start_date',
'label'=>lang('start date'), 'sortable'=>false),
+ array('key' =>
'end_date','label'=>lang('end date'), 'sortable'=>false),
+ array('key' =>
'responsible_user_name','label'=>lang('responsible'), 'sortable'=>false),
+ array('key' =>
'status','label'=>lang('status'), 'sortable'=>false)
+ ),
+ 'data' => json_encode(array()),
+ 'config' => array(
+ array('disableFilter' => true),
+ array('disablePagination' => true)
+ )
+ );
$tabs = $this->make_tab_menu($activity_id);
$data = array
(
- 'tabs' =>
$GLOBALS['phpgw']->common->create_tabs($tabs, 0),
+ 'datatable_def' => $datatable_def,
+ 'tabs' =>
$GLOBALS['phpgw']->common->create_tabs($tabs, 'details'),
'view' => 'activity_details',
'activity' => $activity,
'breadcrumb' => $breadcrumb
@@ -552,7 +555,7 @@
$data['parent_activity'] = $parent_activity;
}
-
self::render_template_xsl(array('activity/view_activity_item',
'activity/activity_tabs'), $data);
+
self::render_template_xsl(array('activity/view_activity_item',
'activity/activity_tabs', 'datatable_inline'), $data);
}
public function save()
@@ -578,7 +581,7 @@
}
else
{
- $this->acl_edit($activity);
+ $this->edit($activity);
}
}
@@ -620,87 +623,22 @@
$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' => 'select',
- 'label' =>
lang('select'),
- 'sortable' => false,
- ),*/
- 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,
- ),
- )
- ),
- );
+ $ColumnDefs0 = 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' =>
'status','label'=>lang('Status requirement'), 'sortable'=>false)
+ );
if($this->acl_add)
{
- $data['datatable']['field'][] = array
+ $ColumnDefs0[] = array
(
'key' => 'alloc_link',
'label' => lang('Allocate
resources'),
@@ -709,7 +647,7 @@
}
if($this->acl_add)
{
- $data['datatable']['field'][] = array
+ $ColumnDefs0[] = array
(
'key' =>
'edit_requirement_link',
'label' => lang('Edit
requirement'),
@@ -719,7 +657,7 @@
if($this->acl_delete)
{
- $data['datatable']['field'][] = array
+ $ColumnDefs0[] = array
(
'key' =>
'delete_requirement_link',
'label' => lang('Delete
requirement'),
@@ -727,17 +665,57 @@
);
}
- phpgwapi_yui::load_widget('datatable');
- phpgwapi_yui::load_widget('paginator');
- phpgwapi_jquery::load_widget('core');
+ $datatable_def = array();
+ $datatable_def[] = array
+ (
+ 'container' =>
'datatable-container_0',
+ 'requestUrl' =>
json_encode(self::link(array('menuaction' => 'logistic.uirequirement.index',
'activity_id' => $activity_id, 'phpgw_return_as' => 'json'))),
+ 'ColumnDefs' => $ColumnDefs0,
+ 'data' => json_encode(array()),
+ 'config' => array(
+ array('disableFilter' => true),
+ array('disablePagination' => true)
+ )
+ );
+
+ $ColumnDefs1 = array
+ (
+ array('key' => 'id',
'label'=>lang('id'), 'sortable'=>true),
+ array('key' => 'fm_bim_item_name',
'label'=>'Navn på ressurs', 'sortable'=>true),
+ array('key' => 'resource_type_descr',
'label'=>lang('resource type descr'), 'sortable'=>true),
+ array('key' =>
'allocated_amount','label'=>lang('allocated amount'), 'sortable'=>false),
+ array('key' =>
'location_code','label'=>lang('location code'), 'sortable'=>true),
+ array('key' =>
'fm_bim_item_address','label'=>lang('address'), 'sortable'=>true),
+ array('key' =>
'delete_link','label'=>lang('delete'), 'sortable'=>false),
+ array('key' =>
'assign_job','label'=>lang('assign job'), 'sortable'=>false),
+ array('key' =>
'related','label'=>lang('related'), 'sortable'=>false),
+ array('key' =>
'status','label'=>lang('Status requirement'), 'sortable'=>false)
+ );
+
+ $datatable_def[] = array
+ (
+ 'container' =>
'datatable-container_1',
+ 'requestUrl' =>
"''",//json_encode(self::link(array('menuaction' =>
'logistic.uirequirement_resource_allocation.index', 'requirement_id' =>
$requirement_id, 'type' => "requirement_id", 'phpgw_return_as' => 'json'))),
+ 'ColumnDefs' => $ColumnDefs1,
+ 'data' => json_encode(array()),
+ 'config' => array(
+ array('disableFilter' => true),
+ array('disablePagination' => true)
+ )
+ );
+
$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;
+ $data = array
+ (
+ 'datatable_def' => $datatable_def,
+ 'tabs' =>
$GLOBALS['phpgw']->common->create_tabs($tabs, 'allocation'),
+ 'view' =>
'requirement_overview',
+ 'activity' => $activity,
+ 'breadcrumb' => $this->_get_breadcrumb(
$activity_id, 'logistic.uiactivity.view_resource_allocation', 'activity_id'),
+ 'acl_add' => $this->acl_add
+ );
self::add_javascript('logistic', 'logistic',
'resource_allocation.js');
self::add_javascript('logistic', 'logistic',
'requirement_overview.js');
@@ -746,7 +724,7 @@
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);
+
self::render_template_xsl(array('activity/view_activity_item',
'requirement/requirement_overview',
'activity/activity_tabs','datatable_inline'), $data);
}
private function get_user_array()
@@ -774,25 +752,35 @@
$activity = $this->so->get_single($activity_id);
- $tabs = array(
- array(
- 'label' => "1: " .
lang('Activity details'),
- 'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'logistic.uiactivity.view',
+ $tabs = array
+ (
+ 'details'=> array
+ (
+ 'label' => "1: " .
lang('Activity details'),
+ 'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'logistic.uiactivity.view',
'id' => $activity->get_id()))
- ), array(
- 'label' => "2: " .
lang('Requirement allocation'),
- 'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'logistic.uiactivity.view_resource_allocation',
+ ),
+ 'allocation' => array
+ (
+ 'label' => "2: " .
lang('Requirement allocation'),
+ 'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'logistic.uiactivity.view_resource_allocation',
'activity_id' => $activity->get_id()))
- ));
+ )
+ );
}
else
{
- $tabs = array(
- array(
- 'label' => "1: " .
lang('Activity details')
- ), array(
- 'label' => "2: " .
lang('Requirement allocation')
- ));
+ $tabs = array
+ (
+ 'details'=> array
+ (
+ 'label' => "1: " .
lang('Activity details')
+ ),
+ 'allocation' => array
+ (
+ 'label' => "2: " .
lang('Requirement allocation')
+ )
+ );
}
return $tabs;
Modified: branches/dev-syncromind/logistic/inc/class.uiproject.inc.php
===================================================================
--- branches/dev-syncromind/logistic/inc/class.uiproject.inc.php
2015-04-13 17:36:12 UTC (rev 12996)
+++ branches/dev-syncromind/logistic/inc/class.uiproject.inc.php
2015-04-13 17:37:05 UTC (rev 12997)
@@ -1,5 +1,4 @@
<?php
-
/**
* phpGroupWare - logistic: a part of a Facilities Management System.
*
@@ -27,27 +26,27 @@
* @subpackage logistic
* @version $Id$
*/
- phpgw::import_class('phpgwapi.uicommon');
+ phpgw::import_class('phpgwapi.uicommon_jquery');
phpgw::import_class('logistic.soproject');
phpgw::import_class('phpgwapi.jquery');
include_class('logistic', 'project');
- class logistic_uiproject extends phpgwapi_uicommon
+ class logistic_uiproject extends phpgwapi_uicommon_jquery
{
private $so;
public $public_functions = array(
- 'query'
=> true,
- 'index'
=> true,
- 'project_types'
=> true,
- 'view'
=> true,
- 'view_project_type' => true,
- 'edit_project_type' => true,
- 'edit_project_type_name' => true,
- 'add'
=> true,
- 'edit'
=> true,
- 'save'
=> true
+ 'query' => true,
+ 'index' => true,
+ 'project_types' => true,
+ 'view' => true,
+ 'view_project_type' => true,
+ 'edit_project_type' => true,
+ 'edit_project_type_name' => true,
+ 'add' => true,
+ 'edit' => true,
+ 'save' => true
);
public function __construct()
@@ -56,28 +55,25 @@
$this->so = CreateObject('logistic.soproject');
- $read = $GLOBALS['phpgw']->acl->check('.project',
PHPGW_ACL_READ, 'logistic');//1
- $add = $GLOBALS['phpgw']->acl->check('.project',
PHPGW_ACL_ADD, 'logistic');//2
- $edit = $GLOBALS['phpgw']->acl->check('.project',
PHPGW_ACL_EDIT, 'logistic');//4
- $delete = $GLOBALS['phpgw']->acl->check('.project',
PHPGW_ACL_DELETE, 'logistic');//8
+ $this->acl_read =
$GLOBALS['phpgw']->acl->check('.project', PHPGW_ACL_READ, 'logistic');//1
+ $this->acl_add =
$GLOBALS['phpgw']->acl->check('.project', PHPGW_ACL_ADD, 'logistic');//2
+ $this->acl_edit =
$GLOBALS['phpgw']->acl->check('.project', PHPGW_ACL_EDIT, 'logistic');//4
+ $this->acl_delete =
$GLOBALS['phpgw']->acl->check('.project', PHPGW_ACL_DELETE, 'logistic');//8
+ $this->acl_manage =
$GLOBALS['phpgw']->acl->check('.project', 16, 'logistic');//16
- $manage = $GLOBALS['phpgw']->acl->check('.project',
16, 'logistic');//16
+
$GLOBALS['phpgw']->css->add_external_file('logistic/templates/base/css/base.css');
$GLOBALS['phpgw_info']['flags']['menu_selection'] =
"logistic::project";
}
public function query()
{
- $params = array(
- 'start' => phpgw::get_var('startIndex', 'int',
'REQUEST', 0),
- 'results' => phpgw::get_var('results', 'int',
'REQUEST', null),
- 'query' => phpgw::get_var('query'),
- 'sort' => phpgw::get_var('sort'),
- 'dir' => phpgw::get_var('dir'),
- 'filters' => $filters
- );
+ $search = phpgw::get_var('search');
+ $order = phpgw::get_var('order');
+ $draw = phpgw::get_var('draw', 'int');
+ $columns = phpgw::get_var('columns');
- if
($GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'] > 0)
+
if($GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'] > 0)
{
$user_rows_per_page =
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];
}
@@ -85,173 +81,171 @@
{
$user_rows_per_page = 10;
}
- // YUI variables for paging and sorting
- $start_index = phpgw::get_var('startIndex', 'int');
- $num_of_objects = phpgw::get_var('results', 'int',
'GET', $user_rows_per_page);
- $sort_field = phpgw::get_var('sort');
- $sort_ascending = phpgw::get_var('dir') == 'desc' ?
false : true;
+
+ $params = array(
+ 'start' => phpgw::get_var('start', 'int',
'REQUEST', 0),
+ 'results' => phpgw::get_var('length', 'int',
'REQUEST', $user_rows_per_page),
+ 'query' => $search['value'],
+ 'order' =>
$columns[$order[0]['column']]['data'],
+ 'sort' => $order[0]['dir'],
+ 'allrows' => phpgw::get_var('length', 'int') ==
-1,
+ );
+
+ $start_index = $params['start'];
+ $num_of_objects = $params['results'] < 0 ? null :
$params['results'];
+ $sort_field = $params['order'];
+ $sort_ascending = $params['sort'] == 'desc' ? false :
true;
// Form variables
- $search_for = phpgw::get_var('query');
- $search_type = phpgw::get_var('search_option');
+ $search_for = $params['query'];
+ $search_type = phpgw::get_var('search_option');
// Create an empty result set
- $result_objects = array();
- $result_count = 0;
+ $result_objects = array();
+ $result_count = 0;
//Retrieve a project identifier and load corresponding
project
$project_id = phpgw::get_var('project_id');
- $exp_param = phpgw::get_var('export');
- $export = false;
- if (isset($exp_param))
+ $exp_param = phpgw::get_var('export');
+ $export = false;
+ if(isset($exp_param))
{
- $export = true;
- $num_of_objects = null;
+ $export = true;
+ $num_of_objects = null;
}
//Retrieve the type of query and perform type specific
logic
$query_type = phpgw::get_var('type');
//var_dump($query_type);
- switch ($query_type)
+ switch($query_type)
{
case 'project_type':
phpgwapi_cache::session_set('logistic',
'project_type_query', $search_for);
- $search_type = 'project_type';
- $result_objects =
$this->so->get($start_index, $num_of_objects, $sort_field, $sort_ascending,
$search_for, $search_type, $filters);
- $object_count =
$this->so->get_count($search_for, $search_type, $filters);
+ $search_type = 'project_type';
+ $result_objects =
$this->so->get($start_index, $num_of_objects, $sort_field, $sort_ascending,
$search_for, $search_type, $filters);
+ $object_count =
$this->so->get_count($search_for, $search_type, $filters);
break;
default: // ... all composites, filters (active
and vacant)
phpgwapi_cache::session_set('logistic',
'project_query', $search_for);
- $filters = array('project_type' =>
phpgw::get_var('project_type'));
- $result_objects =
$this->so->get($start_index, $num_of_objects, $sort_field, $sort_ascending,
$search_for, $search_type, $filters);
- $object_count =
$this->so->get_count($search_for, $search_type, $filters);
+ $filters =
array('project_type' => phpgw::get_var('project_type'));
+ $result_objects =
$this->so->get($start_index, $num_of_objects, $sort_field, $sort_ascending,
$search_for, $search_type, $filters);
+ $object_count =
$this->so->get_count($search_for, $search_type, $filters);
break;
}
//var_dump($result_objects);
//Create an empty row set
$rows = array();
- foreach ($result_objects as $result)
+ foreach($result_objects as $result)
{
- if (isset($result))
+ if(isset($result))
{
$project = $result->serialize();
-
- $href = self::link(array('menuaction'
=> 'logistic.uiactivity.edit', 'project_id' => $project['id']));
- $project['add_activity_link'] = "<a
class=\"btn-sm delete\" href=\"{$href}\">Legg til aktivitet</a>";
-
- $rows[] = $project;
+ $href
= self::link(array('menuaction' => 'logistic.uiactivity.edit',
'project_id' => $project['id']));
+ $project['add_activity_link'] = "<a
class=\"btn-sm delete\" href=\"{$href}\">Legg til aktivitet</a>";
+ $rows[] = $project;
}
}
// ... add result data
$result_data = array('results' => $rows);
- $result_data['total_records'] = $object_count;
- $result_data['start'] = $params['start'];
- $result_data['sort'] = $params['sort'];
- $result_data['dir'] = $params['dir'];
+ $result_data['total_records'] = $object_count;
+ $result_data['start'] =
$params['start'];
+ $result_data['sort'] =
$params['sort'];
+ $result_data['dir'] =
$params['dir'];
+ $result_data['draw'] = $draw;
$editable = phpgw::get_var('editable') == 'true' ? true
: false;
- if (!$export)
+ if(!$export)
{
//Add action column to each row in result table
- if ($search_type && $search_type ==
'project_type')
+ if($search_type && $search_type ==
'project_type')
{
array_walk(
-
$result_data['results'], array($this, '_add_links'),
"logistic.uiproject.view_project_type");
+ $result_data['results'], array($this,
'_add_links'), "logistic.uiproject.view_project_type");
}
else
{
array_walk(
-
$result_data['results'], array($this, '_add_links'), "logistic.uiproject.view");
+ $result_data['results'], array($this,
'_add_links'), "logistic.uiproject.view");
}
}
- return $this->yui_results($result_data);
+ return $this->jquery_results($result_data);
}
public function index()
{
- if (phpgw::get_var('phpgw_return_as') == 'json')
+ 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');
-
$project_type_array = $this->so->get_project_types();
$data = array(
- 'datatable_name' => lang('Overview
projects'),
- 'form' => array(
+ 'datatable_name' => lang('Overview projects'),
+ 'form' => array(
'toolbar' => array(
'item' => array(
- array('type' =>
'filter',
- 'name' =>
'project_type',
- 'text' =>
lang('Project_type') . ':',
- 'list' =>
$project_type_array,
+ array('type' =>
'filter',
+ 'name' =>
'project_type',
+ 'text' =>
lang('Project_type') . ':',
+ 'list' =>
$project_type_array,
),
- array('type' => 'text',
- 'text' =>
lang('search'),
- 'name' =>
'query'
- ),
+
array(
- 'type' =>
'submit',
- 'name' =>
'search',
- 'value' =>
lang('Search')
+ 'type' =>
'link',
+ 'value' =>
lang('t_new_project'),
+ 'href' =>
self::link(array('menuaction' => 'logistic.uiproject.add')),
+ 'class' =>
'new_item'
),
- array(
- 'type' =>
'link',
- 'value' =>
lang('t_new_project'),
- 'href' =>
self::link(array('menuaction' => 'logistic.uiproject.add')),
- 'class' =>
'new_item'
- ),
),
),
),
- 'datatable' => array(
+ 'datatable' => array(
'source' =>
self::link(array('menuaction' => 'logistic.uiproject.index', 'phpgw_return_as'
=> 'json')),
- 'field' => array(
+ 'allrows' => true,
+ 'editor_action' =>
self::link(array('menuaction' => 'logistic.uiproject.edit_project_name')),
+ 'field' => array(
array(
- 'key' => 'id',
- 'label' => lang('Id'),
- 'sortable' => true,
- 'formatter' =>
'YAHOO.portico.formatLink'
- ),
+ 'key' =>
'id',
+ 'label' =>
lang('Id'),
+ 'sortable' =>
true,
+ 'formatter' =>
'JqueryPortico.formatLink'
+ ),
array(
- 'key' => 'name',
- 'label' =>
lang('Project name'),
- 'sortable' => true
+ 'key' =>
'name',
+ 'label' =>
lang('Project name'),
+ 'sortable' => true
),
array(
- 'key' => 'description',
- 'label' =>
lang('Project description'),
- 'sortable' => false,
- 'editor' => 'new
YAHOO.widget.TextboxCellEditor({disableBtns:true})'
+ 'key' =>
'description',
+ 'label' =>
lang('Project description'),
+ 'sortable' =>
false,
+ 'editor' =>
false
),
array(
- 'key' =>
'project_type_label',
- 'label' =>
lang('Project type'),
- 'sortable' => false
+ 'key' =>
'project_type_label',
+ 'label' =>
lang('Project type'),
+ 'sortable' =>
false
),
array(
- 'key' => 'start_date',
- 'label' => lang('Start
date'),
- 'sortable' => false
+ 'key' =>
'start_date',
+ 'label' =>
lang('Start date'),
+ 'sortable' =>
false
),
array(
- 'key' => 'end_date',
- 'label' => lang('End
date'),
- 'sortable' => false
+ 'key' =>
'end_date',
+ 'label' =>
lang('End date'),
+ 'sortable' =>
false
),
array(
- 'key' =>
'add_activity_link',
- 'label' => lang('Add
activity'),
- 'sortable' => false
+ 'key' =>
'add_activity_link',
+ 'label' =>
lang('Add activity'),
+ 'sortable' =>
false
),
array(
- 'key' => 'link',
+ 'key' => 'link',
'hidden' => true
)
)
@@ -260,47 +254,43 @@
$parameters = array
(
- 'parameter' => array
+ 'parameter' => array
(
- array
+ array
(
- 'name' =>
'project_id',
- 'source' => 'id'
- ),
- )
- );
+ 'name' => 'project_id',
+ 'source' => 'id'
+ ),
+ )
+ );
$data['datatable']['actions'][] = array
+ (
+ 'my_name' => 'new_activity',
+ 'text' => lang('t_new_activity'),
+ 'action' =>
$GLOBALS['phpgw']->link('/index.php', array
(
- 'my_name' =>
'new_activity',
- 'text' =>
lang('t_new_activity'),
- 'action' =>
$GLOBALS['phpgw']->link('/index.php',array
- (
- 'menuaction' =>
'logistic.uiactivity.edit'
- )),
- 'parameters' =>
json_encode($parameters)
- );
+ 'menuaction' =>
'logistic.uiactivity.edit'
+ )),
+ 'parameters' => json_encode($parameters)
+ );
- self::render_template_xsl('datatable_common', $data);
+ self::render_template_xsl('datatable_jquery', $data);
}
public function project_types()
{
$GLOBALS['phpgw_info']['flags']['menu_selection'] =
"admin::logistic::project_types";
- if (phpgw::get_var('phpgw_return_as') == 'json')
+ 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');
-
$project_type_id = phpgw::get_var('id');
- $new_type = phpgw::get_var('new_type');
- $edit_type = phpgw::get_var('edit_type');
+ $new_type = phpgw::get_var('new_type');
+ $edit_type = phpgw::get_var('edit_type');
- if ($new_type || $edit_type)
+ if($new_type || $edit_type)
{
$GLOBALS['phpgw']->redirect_link('/index.php',
array('menuaction' => 'logistic.uiproject.edit_project_type'));
}
@@ -308,78 +298,82 @@
{
//list project types
$data = array(
- 'datatable_name' =>
lang('Overview project types'),
- 'form' => array(
+ 'datatable_name' => lang('Overview
project types'),
+ 'form' => array(
'toolbar' => array(
'item' => array(
- array('type' =>
'text',
- 'text'
=> lang('search'),
- 'name'
=> 'query'
+ array('type'
=> 'text',
+ 'text'
=> lang('search'),
+ 'name'
=> 'query'
),
array(
- 'type'
=> 'submit',
- 'name'
=> 'search',
- 'value'
=> lang('Search')
+ 'type'
=> 'submit',
+ 'name'
=> 'search',
+ 'value'
=> lang('Search')
),
array(
- 'type'
=> 'link',
- 'value'
=> lang('t_new_project_type'),
- 'href'
=> self::link(array('menuaction' => 'logistic.uiproject.project_types',
'new_type' => 'yes')),
- 'class'
=> 'new_item'
+ 'type'
=> 'link',
+ 'value'
=> lang('t_new_project_type'),
+ 'href'
=> self::link(array('menuaction' => 'logistic.uiproject.project_types',
+
'new_type' => 'yes')),
+ 'class'
=> 'new_item'
),
),
),
),
- 'datatable' => array(
- 'source' =>
self::link(array('menuaction' => 'logistic.uiproject.project_types',
'phpgw_return_as' => 'json', 'type' => 'project_type')),
- 'editor_action' =>
'logistic.uiproject.edit_project_type_name',
- 'field' => array(
+ 'datatable' => array(
+ 'source' =>
self::link(array('menuaction' => 'logistic.uiproject.project_types',
+ 'phpgw_return_as' =>
'json', 'type' => 'project_type')),
+ 'editor_action' =>
self::link(array('menuaction' => 'logistic.uiproject.edit_project_type_name')),
+ 'field' =>
array(
array(
- 'key' => 'id',
- 'label' =>
lang('Id'),
- 'sortable' =>
true,
- 'formatter' =>
'YAHOO.portico.formatLink'
+ 'key'
=> 'id',
+ 'label'
=> lang('Id'),
+ 'sortable'
=> true,
+ 'formatter'
=> 'JqueryPortico.formatLink'
),
array(
- 'key' => 'name',
- 'label' =>
lang('Project type name'),
- 'sortable' =>
false,
- 'editor' =>
'new YAHOO.widget.TextboxCellEditor({disableBtns:true})'
+ 'key'
=> 'name',
+ 'label'
=> lang('Project type name'),
+ 'sortable'
=> false,
+ 'editor'
=> true
),
array(
- 'key' => 'link',
+ 'key' =>
'link',
'hidden' => true
)
)
),
);
-
self::render_template_xsl(array('datatable_common'), $data);
+
self::render_template_xsl(array('datatable_jquery'), $data);
}
}
public function view()
{
$project_id = phpgw::get_var('id');
- if (isset($_POST['edit_project']))
+ if(isset($_POST['edit_project']))
{
- $GLOBALS['phpgw']->redirect_link('/index.php',
array('menuaction' => 'logistic.uiproject.edit', 'id' => $project_id));
+ $GLOBALS['phpgw']->redirect_link('/index.php',
array('menuaction' => 'logistic.uiproject.edit',
+ 'id' => $project_id));
}
- else if (isset($_POST['new_activity']))
+ else if(isset($_POST['new_activity']))
{
- $GLOBALS['phpgw']->redirect_link('/index.php',
array('menuaction' => 'logistic.uiactivity.edit', 'project_id' => $project_id));
+ $GLOBALS['phpgw']->redirect_link('/index.php',
array('menuaction' => 'logistic.uiactivity.edit',
+ 'project_id' => $project_id));
}
else
{
- if ($project_id && is_numeric($project_id))
+ if($project_id && is_numeric($project_id))
{
$project =
$this->so->get_single($project_id);
}
$data = array
(
- 'project' => $project,
- 'view' => 'view_project'
+ 'project' => $project,
+ 'view' => 'view_project'
);
$GLOBALS['phpgw_info']['flags']['app_header'] =
lang('logistic') . '::' . lang('Project');
@@ -389,20 +383,22 @@
public function view_project_type()
{
- $GLOBALS['phpgw_info']['flags']['menu_selection'] =
"admin::logistic::project_types";
- $project_type_id = phpgw::get_var('id');
- if (isset($_POST['edit_project_type']))
+ $GLOBALS['phpgw_info']['flags']['menu_selection']
= "admin::logistic::project_types";
+ $project_type_id
= phpgw::get_var('id');
+ if(isset($_POST['edit_project_type']))
{
- $GLOBALS['phpgw']->redirect_link('/index.php',
array('menuaction' => 'logistic.uiproject.edit_project_type', 'id' =>
$project_type_id));
+ $GLOBALS['phpgw']->redirect_link('/index.php',
array('menuaction' => 'logistic.uiproject.edit_project_type',
+ 'id' => $project_type_id));
}
else
{
- if ($project_type_id &&
is_numeric($project_type_id))
+ if($project_type_id &&
is_numeric($project_type_id))
{
- $objects = $this->so->get(null, null,
null, null, null, 'project_type', array('id' => $project_type_id));
- if (count($objects) > 0)
+ $objects = $this->so->get(null, null,
null, null, null, 'project_type', array(
+ 'id' => $project_type_id));
+ if(count($objects) > 0)
{
- $keys = array_keys($objects);
+ $keys = array_keys($objects);
$project = $objects[$keys[0]];
}
}
@@ -418,14 +414,15 @@
public function edit_project_type()
{
- $GLOBALS['phpgw_info']['flags']['menu_selection'] =
"admin::logistic::project_types";
- $project_type_id = phpgw::get_var('id');
- if ($project_type_id && is_numeric($project_type_id))
+ $GLOBALS['phpgw_info']['flags']['menu_selection']
= "admin::logistic::project_types";
+ $project_type_id
= phpgw::get_var('id');
+ if($project_type_id && is_numeric($project_type_id))
{
- $objects = $this->so->get(null, null, null,
null, null, 'project_type', array('id' => $project_type_id));
- if (count($objects) > 0)
+ $objects = $this->so->get(null, null, null,
null, null, 'project_type', array(
+ 'id' => $project_type_id));
+ if(count($objects) > 0)
{
- $keys = array_keys($objects);
+ $keys = array_keys($objects);
$project = $objects[$keys[0]];
}
}
@@ -433,10 +430,10 @@
{
$project = new logistic_project();
}
- if (isset($_POST['save_project_type']))
+ if(isset($_POST['save_project_type']))
{
$project_type_name = phpgw::get_var('title');
- if (!$project_type_id ||
is_null($project_type_id))
+ if(!$project_type_id ||
is_null($project_type_id))
{
$project_type_id =
$this->so->add_project_type($project_type_name);
}
@@ -444,18 +441,20 @@
{
$this->so->update_project_type($project_type_id, $project_type_name);
}
- $GLOBALS['phpgw']->redirect_link('/index.php',
array('menuaction' => 'logistic.uiproject.view_project_type', 'id' =>
$project_type_id));
+ $GLOBALS['phpgw']->redirect_link('/index.php',
array('menuaction' => 'logistic.uiproject.view_project_type',
+ 'id' => $project_type_id));
}
- else if (isset($_POST['cancel_project_type']))
+ else if(isset($_POST['cancel_project_type']))
{
- $GLOBALS['phpgw']->redirect_link('/index.php',
array('menuaction' => 'logistic.uiproject.view_project_type', 'id' =>
$project_type_id));
+ $GLOBALS['phpgw']->redirect_link('/index.php',
array('menuaction' => 'logistic.uiproject.view_project_type',
+ 'id' => $project_type_id));
}
else
{
$data = array
(
- 'project' => $project,
- 'editable' => true
+ 'project' => $project,
+ 'editable' => true
);
$GLOBALS['phpgw_info']['flags']['app_header'] =
lang('logistic') . '::' . lang('Project type');
@@ -466,12 +465,20 @@
public function edit_project_type_name()
{
$project_type_id = phpgw::get_var('id');
- if ($project_type_id && is_numeric($project_type_id))
+ $field_name = phpgw::get_var('field_name', 'string');
+
+ if(!$this->acl_edit)
{
- $objects = $this->so->get(null, null, null,
null, null, 'project_type', array('id' => $project_type_id));
- if (count($objects) > 0)
+ return lang('no access');
+ }
+
+ if($project_type_id && is_numeric($project_type_id))
+ {
+ $objects = $this->so->get(null, null, null,
null, null, 'project_type', array(
+ 'id' => $project_type_id));
+ if(count($objects) > 0)
{
- $keys = array_keys($objects);
+ $keys = array_keys($objects);
$project = $objects[$keys[0]];
}
}
@@ -494,7 +501,7 @@
public function edit($project = null)
{
$project_id = phpgw::get_var('id');
- if ($project_id && is_numeric($project_id))
+ if($project_id && is_numeric($project_id))
{
$project = $this->so->get_single($project_id);
}
@@ -502,42 +509,42 @@
{
if($project == null)
{
- $project = new logistic_project();
+ $project = new logistic_project();
}
}
$project_types = $this->so->get_project_types();
- foreach ($project_types as &$p_type)
+ foreach($project_types as &$p_type)
{
- if ($project->get_project_type_id() ==
$p_type['id'])
+ if($project->get_project_type_id() ==
$p_type['id'])
{
$p_type['selected'] = 1;
}
}
-
+
$data = array
- (
- 'project' => $project,
- 'options' => $project_types,
- 'editable' => true
+ (
+ 'project' => $project,
+ 'options' => $project_types,
+ 'editable' => true
);
- $this->use_yui_editor('description');
+ $this->rich_text_editor('description');
$GLOBALS['phpgw_info']['flags']['app_header'] =
lang('logistic') . '::' . lang('Project type');
$GLOBALS['phpgw']->jqcal->add_listener('start_date');
$GLOBALS['phpgw']->jqcal->add_listener('end_date');
-
+
phpgwapi_jquery::load_widget('core');
-
+
self::add_javascript('logistic', 'logistic',
'project.js');
self::render_template_xsl(array('project/project_item'), $data);
}
-
+
public function save()
{
$project_id = phpgw::get_var('id');
-
- if ($project_id && is_numeric($project_id))
+
+ if($project_id && is_numeric($project_id))
{
$project = $this->so->get_single($project_id);
}
@@ -545,18 +552,18 @@
{
$project = new logistic_project();
}
-
+
$project->populate();
- if( $project->validate() )
+ if($project->validate())
{
$project_id = $this->so->store($project);
- $GLOBALS['phpgw']->redirect_link('/index.php',
array('menuaction' => 'logistic.uiproject.view', 'id' => $project_id));
+ $GLOBALS['phpgw']->redirect_link('/index.php',
array('menuaction' => 'logistic.uiproject.view',
+ 'id' => $project_id));
}
else
{
- $this->edit( $project );
+ $this->edit($project);
}
}
- }
-
+ }
\ No newline at end of file
Modified: branches/dev-syncromind/logistic/inc/class.uirequirement.inc.php
===================================================================
--- branches/dev-syncromind/logistic/inc/class.uirequirement.inc.php
2015-04-13 17:36:12 UTC (rev 12996)
+++ branches/dev-syncromind/logistic/inc/class.uirequirement.inc.php
2015-04-13 17:37:05 UTC (rev 12997)
@@ -28,7 +28,7 @@
* @version $Id $
*/
- phpgw::import_class('phpgwapi.uicommon');
+ phpgw::import_class('phpgwapi.uicommon_jquery');
phpgw::import_class('logistic.sorequirement');
phpgw::import_class('logistic.soactivity');
phpgw::import_class('logistic.soproject');
@@ -40,7 +40,7 @@
phpgw::import_class('phpgwapi.datetime');
phpgw::import_class('phpgwapi.jquery');
- class logistic_uirequirement extends phpgwapi_uicommon
+ class logistic_uirequirement extends phpgwapi_uicommon_jquery
{
private $so;
private $so_requirement_value;
@@ -107,23 +107,18 @@
$this->delete =
$GLOBALS['phpgw']->acl->check('.activity', PHPGW_ACL_DELETE, 'logistic');//8
$this->manage =
$GLOBALS['phpgw']->acl->check('.activity', 16, 'logistic');//16
+
$GLOBALS['phpgw']->css->add_external_file('logistic/templates/base/css/base.css');
}
public function query()
{
- $params = array(
- 'start' => phpgw::get_var('startIndex', 'int',
'REQUEST', 0),
- 'results' => phpgw::get_var('results', 'int',
'REQUEST', null),
- 'query' => phpgw::get_var('query'),
- 'sort' => phpgw::get_var('sort'),
- 'dir' => phpgw::get_var('dir'),
- 'filters' => $filters
- );
+ $search = phpgw::get_var('search');
+ $order = phpgw::get_var('order');
+ $draw = phpgw::get_var('draw', 'int');
+ $columns = phpgw::get_var('columns');
- $activity_id = phpgw::get_var('activity_id');
-
- if
($GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'] > 0)
+
if($GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'] > 0)
{
$user_rows_per_page =
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];
}
@@ -131,13 +126,25 @@
{
$user_rows_per_page = 10;
}
- // YUI variables for paging and sorting
- $start_index = phpgw::get_var('startIndex', 'int');
- $num_of_objects = phpgw::get_var('results', 'int',
'GET', $user_rows_per_page);
- $sort_field = phpgw::get_var('sort');
- $sort_ascending = phpgw::get_var('dir') == 'desc' ?
false : true;
+
+ $params = array(
+ 'start' => phpgw::get_var('start', 'int',
'REQUEST', 0),
+ 'results' => phpgw::get_var('length', 'int',
'REQUEST', $user_rows_per_page),
+ 'query' => $search['value'],
+ 'order' =>
$columns[$order[0]['column']]['data'],
+ 'sort' => $order[0]['dir'],
+ 'allrows' => phpgw::get_var('length', 'int') ==
-1,
+ );
+
+ $start_index = $params['start'];
+ $num_of_objects = $params['results'] < 0 ? null :
$params['results'];
+ $sort_field = $params['order'];
+ $sort_ascending = $params['sort'] == 'desc' ? false :
true;
// Form variables
- $search_for = phpgw::get_var('query');
+ $search_for = $params['query'];
+
+ $activity_id = phpgw::get_var('activity_id');
+
$search_type = phpgw::get_var('search_option');
// Create an empty result set
$result_objects = array();
@@ -256,7 +263,7 @@
}
//$href = self::link(array('menuaction' =>
'logistic.uirequirement.edit', 'id' => $entry['id']));
- $href =
"javascript:load_requirement_edit_id({$entry['id']});";
+ $href =
"javascript:load_requirement_edit_id({$entry['id']}, {$entry['activity_id']});";
$entry['edit_requirement_link'] = "<a
class=\"btn-sm alloc\" href=\"{$href}\">Endre behov</a>";
$href =
"javascript:load_requirement_delete_id({$entry['id']});";
@@ -270,6 +277,7 @@
$result_data['start'] = $params['start'];
$result_data['sort'] = $params['sort'];
$result_data['dir'] = $params['dir'];
+ $result_data['draw'] = $draw;
$editable = phpgw::get_var('editable') == 'true' ? true
: false;
@@ -278,7 +286,7 @@
//Add action column to each row in result table
array_walk($result_data['results'],
array($this, '_add_links'), "logistic.uirequirement.view");
}
- return $this->yui_results($result_data);
+ return $this->jquery_results($result_data);
}
public function index()
@@ -288,8 +296,6 @@
return $this->query();
}
- phpgwapi_yui::load_widget('datatable');
- phpgwapi_yui::load_widget('paginator');
$activity_id = phpgw::get_var('activity_id');
$activity =
$this->so_activity->get_single($activity_id);
@@ -300,17 +306,8 @@
'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')),
@@ -386,9 +383,9 @@
public function view()
{
- if( $nonavbar = phpgw::get_var('nonavbar', 'bool'))
+ if( $this->nonavbar = phpgw::get_var('nonavbar',
'bool'))
{
- $GLOBALS['phpgw_info']['flags']['nonavbar'] =
$nonavbar;
+ $GLOBALS['phpgw_info']['flags']['nonavbar'] =
$this->nonavbar;
$GLOBALS['phpgw_info']['flags']['noheader_xsl']
= true;
$GLOBALS['phpgw_info']['flags']['nofooter']
= true;
}
@@ -414,11 +411,12 @@
$data = array
(
- 'tabs' =>
$GLOBALS['phpgw']->common->create_tabs($tabs, 0),
- 'view' =>
"requirement_details",
- 'requirement' => $requirement,
- 'activity' => $activity,
+ 'tabs' =>
$GLOBALS['phpgw']->common->create_tabs($tabs, 'details'),
+ 'view' =>
"requirement_details",
+ 'requirement' => $requirement,
+ 'activity' => $activity,
'location' =>
$location_info,
+ 'nonavbar' =>
$this->nonavbar
);
$GLOBALS['phpgw_info']['flags']['app_header'] =
lang('logistic') . '::' . lang('Project') . '::' . lang('Requirement');
@@ -433,9 +431,9 @@
public function edit($requirement = null)
{
- if( $nonavbar = phpgw::get_var('nonavbar', 'bool'))
+ if( $this->nonavbar = phpgw::get_var('nonavbar',
'bool'))
{
- $GLOBALS['phpgw_info']['flags']['nonavbar'] =
$nonavbar;
+ $GLOBALS['phpgw_info']['flags']['nonavbar'] =
$this->nonavbar;
$GLOBALS['phpgw_info']['flags']['noheader_xsl']
= true;
$GLOBALS['phpgw_info']['flags']['nofooter']
= true;
}
@@ -490,7 +488,8 @@
$attribute_requirement_array = array();
- foreach($attribute_requirement_types as
$attribute_requirement){
+ foreach($attribute_requirement_types as
$attribute_requirement)
+ {
$location_id =
$attribute_requirement->get_location_id();
$cust_attribute_id =
$attribute_requirement->get_cust_attribute_id();
@@ -509,12 +508,12 @@
$data = array
(
- 'tabs' =>
$GLOBALS['phpgw']->common->create_tabs($tabs, 0),
+ 'tabs' =>
$GLOBALS['phpgw']->common->create_tabs($tabs, 'details'),
'view' =>
"requirement_details",
'requirement' => $requirement,
'distict_locations' => $distict_locations_array,
'editable' => true,
- 'nonavbar' => $nonavbar
+ 'nonavbar' =>
$this->nonavbar
);
if($activity_id > 0)
@@ -538,16 +537,16 @@
$requirement_id = phpgw::get_var('id', 'int');
$new_location_id = phpgw::get_var('location_id');
- if( $nonavbar = phpgw::get_var('nonavbar', 'bool'))
+ if( $this->nonavbar = phpgw::get_var('nonavbar',
'bool'))
{
- $GLOBALS['phpgw_info']['flags']['nonavbar'] =
$nonavbar;
+ $GLOBALS['phpgw_info']['flags']['nonavbar'] =
$this->nonavbar;
$GLOBALS['phpgw_info']['flags']['noheader_xsl']
= true;
$GLOBALS['phpgw_info']['flags']['nofooter']
= true;
}
if(!$this->read)
{
- $GLOBALS['phpgw']->redirect_link('/index.php',
array('menuaction' => 'logistic.uirequirement.view', 'id' => $requirement_id,
'nonavbar' => $nonavbar));
+ $GLOBALS['phpgw']->redirect_link('/index.php',
array('menuaction' => 'logistic.uirequirement.view', 'id' => $requirement_id,
'nonavbar' => $this->nonavbar));
return false; // in case redirect fail;
}
@@ -588,7 +587,7 @@
// $db_requirement->transaction_abort();
}
- $GLOBALS['phpgw']->redirect_link('/index.php',
array('menuaction' => 'logistic.uirequirement.view', 'id' => $requirement_id,
'nonavbar' => $nonavbar));
+ $GLOBALS['phpgw']->redirect_link('/index.php',
array('menuaction' => 'logistic.uirequirement.view', 'id' => $requirement_id,
'nonavbar' => $this->nonavbar));
}
else
{
@@ -634,6 +633,13 @@
public function add_requirement_values()
{
+ if( $this->nonavbar = phpgw::get_var('nonavbar',
'bool'))
+ {
+ $GLOBALS['phpgw_info']['flags']['nonavbar'] =
$this->nonavbar;
+ $GLOBALS['phpgw_info']['flags']['noheader_xsl']
= true;
+ $GLOBALS['phpgw_info']['flags']['nofooter']
= true;
+ }
+
$requirement_id = phpgw::get_var('requirement_id');
if ($requirement_id && is_numeric($requirement_id))
@@ -722,12 +728,13 @@
$data = array
(
- 'tabs'
=> $GLOBALS['phpgw']->common->create_tabs($tabs, 1),
+ 'tabs'
=> $GLOBALS['phpgw']->common->create_tabs($tabs, 'constraints'),
'view'
=> "requirement_values",
'requirement'
=> $requirement,
'requirement_attributes_array' =>
$requirement_attributes_array,
'distict_locations' =>
$distict_locations_array,
'editable'
=> true,
+ 'nonavbar'
=> $this->nonavbar
);
if($activity_id > 0)
@@ -743,9 +750,9 @@
public function view_requirement_values()
{
- if( $nonavbar = phpgw::get_var('nonavbar', 'bool'))
+ if( $this->nonavbar = phpgw::get_var('nonavbar',
'bool'))
{
- $GLOBALS['phpgw_info']['flags']['nonavbar'] =
$nonavbar;
+ $GLOBALS['phpgw_info']['flags']['nonavbar'] =
$this->nonavbar;
$GLOBALS['phpgw_info']['flags']['noheader_xsl']
= true;
$GLOBALS['phpgw_info']['flags']['nofooter']
= true;
}
@@ -823,11 +830,12 @@
$data = array
(
- 'tabs'
=>
$GLOBALS['phpgw']->common->create_tabs($tabs, 1),
- 'view'
=> "requirement_values",
- 'requirement'
=> $requirement,
- 'activity'
=> $activity,
- 'requirement_attributes_array' =>
$requirement_attributes_array
+ 'tabs'
=> $GLOBALS['phpgw']->common->create_tabs($tabs, 'constraints'),
+ 'view'
=> "requirement_values",
+ 'requirement'
=> $requirement,
+ 'activity'
=> $activity,
+ 'requirement_attributes_array' =>
$requirement_attributes_array,
+ 'nonavbar' => $this->nonavbar
);
self::render_template_xsl(array('requirement/requirement_tabs',
'requirement/requirement_values'), $data);
@@ -835,6 +843,8 @@
public function save_requirement_values()
{
+ $this->nonavbar = phpgw::get_var('nonavbar',
'bool');
+
$requirement_id =
phpgw::get_var('requirement_id');
$attributes_array = array();
$attributes_array =
phpgw::get_var('cust_attributes');
@@ -1185,27 +1195,36 @@
$requirement =
$this->so->get_single($requirement_id);
- $tabs = array(
- array(
- 'label' => "1: " .
lang('Requirement details'),
- 'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'logistic.uirequirement.view',
+ $tabs = array
+ (
+ 'details'=> array
+ (
+ 'label' => "1: " .
lang('Requirement details'),
+ 'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'logistic.uirequirement.view',
'id' => $requirement->get_id(),
'nonavbar' => $this->nonavbar))
- ), array(
- 'label' => "2: " .
lang('Add constraints'),
- 'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'logistic.uirequirement.view_requirement_values',
+ ),
+ 'constraints'=> array
+ (
+ 'label' => "2: " . lang('Add
constraints'),
+ 'link' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'logistic.uirequirement.view_requirement_values',
'requirement_id' => $requirement->get_id(),
'nonavbar' => $this->nonavbar))
));
}
else
{
- $tabs = array(
- array(
- 'label' => "1: " .
lang('Requirement details')
- ), array(
- 'label' => "2: " .
lang('Add constraints')
- ));
+ $tabs = array
+ (
+ 'details'=> array
+ (
+ 'label' => "1: " .
lang('Requirement details')
+ ),
+ 'constraints'=> array
+ (
+ 'label' => "2: " . lang('Add
constraints')
+ )
+ );
}
return $tabs;
Modified:
branches/dev-syncromind/logistic/inc/class.uirequirement_resource_allocation.inc.php
===================================================================
---
branches/dev-syncromind/logistic/inc/class.uirequirement_resource_allocation.inc.php
2015-04-13 17:36:12 UTC (rev 12996)
+++
branches/dev-syncromind/logistic/inc/class.uirequirement_resource_allocation.inc.php
2015-04-13 17:37:05 UTC (rev 12997)
@@ -27,7 +27,7 @@
* @subpackage logistic
* @version $Id$
*/
- phpgw::import_class('phpgwapi.uicommon');
+ phpgw::import_class('phpgwapi.uicommon_jquery');
phpgw::import_class('logistic.soactivity');
include_class('logistic', 'activity', '/inc/model/');
include_class('logistic', 'requirement', '/inc/model/');
@@ -35,7 +35,7 @@
include_class('logistic', 'requirement_resource_allocation',
'/inc/model/');
- class logistic_uirequirement_resource_allocation extends
phpgwapi_uicommon
+ class logistic_uirequirement_resource_allocation extends
phpgwapi_uicommon_jquery
{
var $cat_id;
@@ -78,7 +78,7 @@
$this->so_requirement =
createObject('logistic.sorequirement');
$this->so_requirement_value =
CreateObject('logistic.sorequirement_value');
- $this->bo
= CreateObject('property.bolocation',true);
+ $this->bo
= CreateObject('property.bolocation',true);
$this->bocommon
= & $this->bo->bocommon;
$this->type_id
= $this->bo->type_id;
@@ -101,6 +101,8 @@
$this->edit =
$GLOBALS['phpgw']->acl->check('.activity', PHPGW_ACL_EDIT, 'logistic');//4
$this->delete =
$GLOBALS['phpgw']->acl->check('.activity', PHPGW_ACL_DELETE, 'logistic');//8
$this->manage =
$GLOBALS['phpgw']->acl->check('.activity', 16, 'logistic');//16
+
$GLOBALS['phpgw']->css->add_external_file('logistic/templates/base/css/base.css');
+
}
public function index()
@@ -109,9 +111,6 @@
{
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();
@@ -124,18 +123,9 @@
'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')),
@@ -174,21 +164,17 @@
),
);
- self::render_template_xsl(array('datatable_common'),
$data);
+ self::render_template_xsl(array('datatable_jquery'),
$data);
}
public function query()
{
- $params = array(
- 'start' => phpgw::get_var('startIndex', 'int',
'REQUEST', 0),
- 'results' => phpgw::get_var('results', 'int',
'REQUEST', null),
- 'query' => phpgw::get_var('query'),
- 'sort' => phpgw::get_var('sort'),
- 'dir' => phpgw::get_var('dir'),
- 'filters' => $filters
- );
+ $search = phpgw::get_var('search');
+ $order = phpgw::get_var('order');
+ $draw = phpgw::get_var('draw', 'int');
+ $columns = phpgw::get_var('columns');
- if
($GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'] > 0)
+
if($GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'] > 0)
{
$user_rows_per_page =
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];
}
@@ -197,14 +183,22 @@
$user_rows_per_page = 10;
}
- // YUI variables for paging and sorting
- $start_index = phpgw::get_var('startIndex', 'int');
- $num_of_objects = phpgw::get_var('results', 'int',
'GET', $user_rows_per_page);
- $sort_field = phpgw::get_var('sort');
- $sort_ascending = phpgw::get_var('dir') == 'desc' ?
false : true;
+ $params = array(
+ 'start' => phpgw::get_var('start', 'int',
'REQUEST', 0),
+ 'results' => phpgw::get_var('length', 'int',
'REQUEST', $user_rows_per_page),
+ 'query' => $search['value'],
+ 'order' =>
$columns[$order[0]['column']]['data'],
+ 'sort' => $order[0]['dir'],
+ 'allrows' => phpgw::get_var('length', 'int') ==
-1,
+ );
+ $start_index = $params['start'];
+ $num_of_objects = $params['results'] < 0 ? null :
$params['results'];
+ $sort_field = $params['order'];
+ $sort_ascending = $params['sort'] == 'desc' ? false :
true;
// Form variables
- $search_for = phpgw::get_var('query');
+ $search_for = $params['query'];
+
$search_type = phpgw::get_var('search_option');
// Create an empty result set
@@ -324,16 +318,16 @@
$result_data['start'] = $params['start'];
$result_data['sort'] = $params['sort'];
$result_data['dir'] = $params['dir'];
+ $result_data['draw'] = $draw;
$editable = phpgw::get_var('editable') == 'true' ? true
: false;
if (!$export)
{
//Add action column to each row in result table
- array_walk(
-
$result_data['results'], array($this, '_add_links'),
"logistic.uirequirement_resource_allocation.view");
+ array_walk( $result_data['results'],
array($this, '_add_links'), "logistic.uirequirement_resource_allocation.view");
}
- return $this->yui_results($result_data);
+ return $this->jquery_results($result_data);
}
public function add()
Modified:
branches/dev-syncromind/logistic/inc/class.uiresource_type_requirement.inc.php
===================================================================
---
branches/dev-syncromind/logistic/inc/class.uiresource_type_requirement.inc.php
2015-04-13 17:36:12 UTC (rev 12996)
+++
branches/dev-syncromind/logistic/inc/class.uiresource_type_requirement.inc.php
2015-04-13 17:37:05 UTC (rev 12997)
@@ -29,16 +29,22 @@
*/
phpgw::import_class('phpgwapi.jquery');
- phpgw::import_class('phpgwapi.uicommon');
+ phpgw::import_class('phpgwapi.uicommon_jquery');
phpgw::import_class('logistic.soproject');
include_class('logistic', 'project');
- class logistic_uiresource_type_requirement extends phpgwapi_uicommon
+ class logistic_uiresource_type_requirement extends
phpgwapi_uicommon_jquery
{
private $so;
private $so_project;
+ private $read;
+ private $add;
+ private $edit;
+ private $delete;
+ private $manage;
+
public $public_functions = array(
'query' => true,
@@ -57,28 +63,25 @@
$this->so =
CreateObject('logistic.soresource_type_requirement');
$this->so_project = CreateObject('logistic.soproject');
- $read = $GLOBALS['phpgw']->acl->check('.project',
PHPGW_ACL_READ, 'logistic');//1
- $add = $GLOBALS['phpgw']->acl->check('.project',
PHPGW_ACL_ADD, 'logistic');//2
- $edit = $GLOBALS['phpgw']->acl->check('.project',
PHPGW_ACL_EDIT, 'logistic');//4
- $delete = $GLOBALS['phpgw']->acl->check('.project',
PHPGW_ACL_DELETE, 'logistic');//8
+ $this->read =
$GLOBALS['phpgw']->acl->check('.project', PHPGW_ACL_READ, 'logistic');//1
+ $this->add =
$GLOBALS['phpgw']->acl->check('.project', PHPGW_ACL_ADD, 'logistic');//2
+ $this->edit =
$GLOBALS['phpgw']->acl->check('.project', PHPGW_ACL_EDIT, 'logistic');//4
+ $this->delete =
$GLOBALS['phpgw']->acl->check('.project', PHPGW_ACL_DELETE, 'logistic');//8
+ $this->manage =
$GLOBALS['phpgw']->acl->check('.project', 16, 'logistic');//16
- $manage = $GLOBALS['phpgw']->acl->check('.project',
16, 'logistic');//16
+ $GLOBALS['phpgw_info']['flags']['menu_selection'] =
"admin::logistic::resource_type_requirement";
+
$GLOBALS['phpgw']->css->add_external_file('logistic/templates/base/css/base.css');
- $GLOBALS['phpgw_info']['flags']['menu_selection'] =
"admin::logistic::resource_type_requirement";
}
public function query()
{
- $params = array(
- 'start' => phpgw::get_var('startIndex', 'int',
'REQUEST', 0),
- 'results' => phpgw::get_var('results', 'int',
'REQUEST', null),
- 'query' => phpgw::get_var('query'),
- 'sort' => phpgw::get_var('sort'),
- 'dir' => phpgw::get_var('dir'),
- 'filters' => $filters
- );
+ $search = phpgw::get_var('search');
+ $order = phpgw::get_var('order');
+ $draw = phpgw::get_var('draw', 'int');
+ $columns = phpgw::get_var('columns');
- if
($GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'] > 0)
+
if($GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'] > 0)
{
$user_rows_per_page =
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];
}
@@ -86,14 +89,29 @@
{
$user_rows_per_page = 10;
}
- // YUI variables for paging and sorting
- $start_index = phpgw::get_var('startIndex', 'int');
- $num_of_objects = phpgw::get_var('results', 'int',
'GET', $user_rows_per_page);
- $sort_field = phpgw::get_var('sort');
- $sort_ascending = phpgw::get_var('dir') == 'desc' ?
false : true;
+
+ $params = array(
+ 'start' => phpgw::get_var('start', 'int',
'REQUEST', 0),
+ 'results' => phpgw::get_var('length', 'int',
'REQUEST', $user_rows_per_page),
+ 'query' => $search['value'],
+ 'order' =>
$columns[$order[0]['column']]['data'],
+ 'sort' => $order[0]['dir'],
+ 'allrows' => phpgw::get_var('length', 'int') ==
-1,
+ );
+
+ $start_index = $params['start'];
+ $num_of_objects = $params['results'] < 0 ? null :
$params['results'];
+ $sort_field = $params['order'];
+ $sort_ascending = $params['sort'] == 'desc' ? false :
true;
// Form variables
- $search_for = phpgw::get_var('query');
+ $search_for = $params['query'];
+
+ $activity_id = phpgw::get_var('activity_id');
+
$search_type = phpgw::get_var('search_option');
+
+ // Form variables
+ $search_type = phpgw::get_var('search_option');
// Create an empty result set
$result_objects = array();
$result_count = 0;
@@ -140,16 +158,16 @@
$result_data['start'] = $params['start'];
$result_data['sort'] = $params['sort'];
$result_data['dir'] = $params['dir'];
+ $result_data['draw'] = $draw;
$editable = phpgw::get_var('editable') == 'true' ? true
: false;
if (!$export)
{
//Add action column to each row in result table
- array_walk(
-
$result_data['results'], array($this, '_add_links'),
"logistic.uiresource_type_requirement.view");
+ array_walk( $result_data['results'],
array($this, '_add_links'), "logistic.uiresource_type_requirement.view");
}
- return $this->yui_results($result_data);
+ return $this->jquery_results($result_data);
}
public function index()
@@ -175,16 +193,7 @@
'text' =>
lang('Entity types') . ':',
'list' =>
$entity_list,
),
- array('type' => 'text',
- 'text' =>
lang('search'),
- 'name' =>
'query'
- ),
array(
- 'type' =>
'submit',
- 'name' =>
'search',
- 'value' =>
lang('Search')
- ),
- array(
'type' =>
'link',
'value' =>
lang('t_new_type_requirement'),
'href' =>
self::link(array('menuaction' => 'logistic.uiresource_type_requirement.add')),
@@ -201,13 +210,13 @@
'label' => lang('Id'),
'sortable' => false,
'hidden' => true,
- 'formatter' =>
'YAHOO.portico.formatLink'
+ 'formatter' =>
'JqueryPortico.formatLink'
),
array(
'key' => 'location_id',
'label' => lang('Id'),
'sortable' => true,
- 'formatter' =>
'YAHOO.portico.formatLink'
+ 'formatter' =>
'JqueryPortico.formatLink'
),
array(
'key' => 'entity_label',
@@ -232,7 +241,7 @@
),
);
- self::render_template_xsl('datatable_common', $data);
+ self::render_template_xsl('datatable_jquery', $data);
}
public function add()
Modified: branches/dev-syncromind/logistic/js/logistic/requirement_overview.js
===================================================================
--- branches/dev-syncromind/logistic/js/logistic/requirement_overview.js
2015-04-13 17:36:12 UTC (rev 12996)
+++ branches/dev-syncromind/logistic/js/logistic/requirement_overview.js
2015-04-13 17:37:05 UTC (rev 12997)
@@ -5,11 +5,11 @@
TINY.box.show({iframe:requestUrl,
boxid:'frameless',width:750,height:450,fixed:false,maskid:'darkmask',maskopacity:40,
mask:true, animate:true, close: true,closejs:function(){closeJS_local()}});
}
- function load_requirement_edit_id( id ){
+ function load_requirement_edit_id( id , activity_id){
var oArgs = {menuaction: 'logistic.uirequirement.edit', id:id,
nonavbar: true, lean: true};
var requestUrl = phpGWLink('index.php', oArgs);
- TINY.box.show({iframe:requestUrl,
boxid:'frameless',width:750,height:450,fixed:false,maskid:'darkmask',maskopacity:40,
mask:true, animate:true, close: true,closejs:function(){closeJS_local()}});
+ TINY.box.show({iframe:requestUrl,
boxid:'frameless',width:750,height:450,fixed:false,maskid:'darkmask',maskopacity:40,
mask:true, animate:true, close:
true,closejs:function(){closeJS_local(activity_id)}});
}
function load_requirement_delete_id( id ){
@@ -84,14 +84,34 @@
}
- function closeJS_local()
+ function closeJS_local(activity_id)
{
- var reqUrl = datatable_source;
- YAHOO.portico.inlineTableHelper('requirement-container',
reqUrl, YAHOO.portico.columnDefs);
+ if(typeof(activity_id) == 'undefied' || !activity_id)
+ {
+ return;
+ }
+ var oArgs = {
+ menuaction:'logistic.uirequirement.index',
+ activity_id: activity_id,
+ };
+
+ var requestUrl = phpGWLink('index.php', oArgs, true);
+
+ JqueryPortico.updateinlineTableHelper(oTable0, requestUrl);
+
}
function closeJS_local_allocation(requirement_id)
{
-
YAHOO.portico.updateinlineTableHelper('allocation-container');
+ var oArgs = {
+
menuaction:'logistic.uirequirement_resource_allocation.index',
+ requirement_id: requirement_id,
+ type: "requirement_id"
+ };
+
+ var requestUrl = phpGWLink('index.php', oArgs, true);
+
+ JqueryPortico.updateinlineTableHelper(oTable1, requestUrl);
+
}
Modified:
branches/dev-syncromind/logistic/templates/base/activity/activity_tabs.xsl
===================================================================
--- branches/dev-syncromind/logistic/templates/base/activity/activity_tabs.xsl
2015-04-13 17:36:12 UTC (rev 12996)
+++ branches/dev-syncromind/logistic/templates/base/activity/activity_tabs.xsl
2015-04-13 17:37:05 UTC (rev 12997)
@@ -2,8 +2,7 @@
<!-- separate tabs and inline tables-->
<xsl:template match="data" xmlns:php="http://php.net/xsl">
-<div class="yui-navset yui-navset-top" id="activity-tabview">
- <xsl:call-template name="yui_phpgw_i18n"/>
+<div id="activity-tabview">
<xsl:choose>
<xsl:when test="view = 'activity_details'">
@@ -28,9 +27,11 @@
<!-- =========== BREADCRUMB ============== -->
<xsl:call-template name="breadcrumb" />
-
+ <div id="tab-content">
+
<xsl:value-of disable-output-escaping="yes"
select="tabs" />
<xsl:call-template name="activity_details" />
+ </div>
</xsl:when>
<xsl:when test="view = 'requirement_overview'">
@@ -55,12 +56,14 @@
<!-- =========== BREADCRUMB ============== -->
<xsl:call-template name="breadcrumb" />
-
- <xsl:value-of disable-output-escaping="yes"
select="tabs" />
- <xsl:call-template name="requirement_overview" />
+ <div id="tab-content">
+ <xsl:value-of disable-output-escaping="yes"
select="tabs" />
+ <xsl:call-template name="requirement_overview"
/>
+ </div>
</xsl:when>
</xsl:choose>
</div>
+<xsl:call-template name="jquery_phpgw_i18n"/>
</xsl:template>
<!-- =========== BREADCRUMB TEMPLATE ============== -->
@@ -82,7 +85,7 @@
</xsl:choose>
<xsl:if test="not( position() = last() )">
<img src="logistic/images/arrow_right.png" />
- </xsl:if>
+ </xsl:if>
</xsl:for-each>
</div>
</xsl:template>
Modified:
branches/dev-syncromind/logistic/templates/base/activity/add_activity_item.xsl
===================================================================
---
branches/dev-syncromind/logistic/templates/base/activity/add_activity_item.xsl
2015-04-13 17:36:12 UTC (rev 12996)
+++
branches/dev-syncromind/logistic/templates/base/activity/add_activity_item.xsl
2015-04-13 17:37:05 UTC (rev 12997)
@@ -2,8 +2,7 @@
<xsl:variable name="date_format"><xsl:value-of
select="php:function('get_phpgw_info',
'user|preferences|common|dateformat')"/></xsl:variable>
<xsl:variable name="datetime_format"><xsl:value-of
select="$date_format"/><xsl:text> H:i</xsl:text></xsl:variable>
-<xsl:call-template name="yui_phpgw_i18n"/>
-<div class="yui-navset yui-navset-top">
+<div>
<xsl:choose>
<xsl:when test="project/id != '' or project/id != 0">
@@ -262,6 +261,7 @@
<form name="cancel_form" id="cancel_form" action="{$cancel_url}" method="post">
</form>
+<xsl:call-template name="jquery_phpgw_i18n"/>
</xsl:template>
Modified:
branches/dev-syncromind/logistic/templates/base/activity/view_activity_item.xsl
===================================================================
---
branches/dev-syncromind/logistic/templates/base/activity/view_activity_item.xsl
2015-04-13 17:36:12 UTC (rev 12996)
+++
branches/dev-syncromind/logistic/templates/base/activity/view_activity_item.xsl
2015-04-13 17:37:05 UTC (rev 12997)
@@ -71,37 +71,23 @@
<h3 style="clear:left; float:left;margin: 0;
padding: 10px 0 5px;">Underaktiviteter</h3>
<a id="add-sub-activity-btn" class="btn focus"
href="{$add_sub_activity_url}"><xsl:value-of select="php:function('lang', 'Add
sub activity')" /></a>
- <div style="clear:both;"
id="sub-activities-container"></div>
- <xsl:call-template name="datasource-definition"
/>
+ <div style="clear:both;"
id="sub-activities-container"></div>
+ <xsl:for-each select="datatable_def">
+ <xsl:if test="container =
'datatable-container_0'">
+ <xsl:call-template
name="table_setup">
+ <xsl:with-param
name="container" select ='container'/>
+ <xsl:with-param
name="requestUrl" select ='requestUrl' />
+ <xsl:with-param
name="ColumnDefs" select ='ColumnDefs' />
+ <xsl:with-param
name="tabletools" select ='tabletools' />
+ <xsl:with-param
name="data" select ='data' />
+ <xsl:with-param
name="config" select ='config' />
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:for-each>
</div>
</div>
- </div>
-</xsl:template>
+ <div id="allocation">
+ </div>
-<xsl:template name="datasource-definition">
-
- <script>
- YAHOO.util.Event.onDOMReady(function(){
-
- var oArgs = {
- menuaction:'logistic.uiactivity.index',
- activity_id: '<xsl:value-of
select='activity/id'/>',
- type: 'children'
- };
-
- var requestUrl = phpGWLink('index.php', oArgs, true);
-
- var myColumnDefs = [
- {key:"id", label:'Id', sortable:false},
- {key:"name", label:'Aktivitetsnavn', sortable:false},
- {key:"start_date", label:'Startdato', sortable:false},
- {key:"end_date", label:'Sluttdato', sortable:false},
- {key:"responsible_user_name", label:'Ansvarlig',
sortable:false},
- {key:"status", label:'Status', sortable:false}
- ];
-
- YAHOO.portico.inlineTableHelper("sub-activities-container",
requestUrl, myColumnDefs);
-
- });
- </script>
-</xsl:template>
+ </div>
+</xsl:template>
\ No newline at end of file
Modified:
branches/dev-syncromind/logistic/templates/base/allocation/book_resources.xsl
===================================================================
---
branches/dev-syncromind/logistic/templates/base/allocation/book_resources.xsl
2015-04-13 17:36:12 UTC (rev 12996)
+++
branches/dev-syncromind/logistic/templates/base/allocation/book_resources.xsl
2015-04-13 17:37:05 UTC (rev 12997)
@@ -1,8 +1,7 @@
<xsl:template match="data" xmlns:php="http://php.net/xsl">
<xsl:variable name="date_format"><xsl:value-of
select="php:function('get_phpgw_info',
'user|preferences|common|dateformat')"/></xsl:variable>
-<xsl:call-template name="yui_phpgw_i18n"/>
-<div id="resource-allocation" class="yui-navset yui-navset-top">
+<div id="resource-allocation">
<h1 style="margin-bottom:10px;">
<xsl:value-of select="php:function('lang', 'Booking of
resources')"/> for <xsl:value-of select="activity/name"/>
</h1>
@@ -159,4 +158,5 @@
</form>
</div>
</div>
+<xsl:call-template name="jquery_phpgw_i18n"/>
</xsl:template>
Modified: branches/dev-syncromind/logistic/templates/base/css/base.css
===================================================================
--- branches/dev-syncromind/logistic/templates/base/css/base.css
2015-04-13 17:36:12 UTC (rev 12996)
+++ branches/dev-syncromind/logistic/templates/base/css/base.css
2015-04-13 17:37:05 UTC (rev 12997)
@@ -298,10 +298,10 @@
}
#dt-dlg_c .underlay {overflow:hidden;}
.inprogress {position:absolute;} /* transitional progressive enhancement state
*/
-}
+
dl.controller-description {
- width: 70%;
+ width: 100%;
}
dl.controller-description dt, dl.controller-description-edit {
@@ -746,7 +746,7 @@
dl.proplist, dl.proplist-col {
margin: 0;
padding-left: 0;
- width: 50%;
+ width: 100%;
}
#details .proplist dd, #details .proplist-col dd{
Modified:
branches/dev-syncromind/logistic/templates/base/project/project_item.xsl
===================================================================
--- branches/dev-syncromind/logistic/templates/base/project/project_item.xsl
2015-04-13 17:36:12 UTC (rev 12996)
+++ branches/dev-syncromind/logistic/templates/base/project/project_item.xsl
2015-04-13 17:37:05 UTC (rev 12997)
@@ -3,9 +3,7 @@
<xsl:template match="data" xmlns:php="http://php.net/xsl">
<xsl:variable name="date_format"><xsl:value-of
select="php:function('get_phpgw_info',
'user|preferences|common|dateformat')"/></xsl:variable>
-
-<xsl:call-template name="yui_phpgw_i18n"/>
-<div class="yui-navset yui-navset-top">
+<div>
<xsl:choose>
<xsl:when test="project/id != '' or project/id != 0">
<h1>
@@ -156,6 +154,7 @@
</div>
</div>
</div>
+<xsl:call-template name="jquery_phpgw_i18n"/>
</xsl:template>
<xsl:template match="options">
Modified:
branches/dev-syncromind/logistic/templates/base/project/resource_type_requirement_item.xsl
===================================================================
---
branches/dev-syncromind/logistic/templates/base/project/resource_type_requirement_item.xsl
2015-04-13 17:36:12 UTC (rev 12996)
+++
branches/dev-syncromind/logistic/templates/base/project/resource_type_requirement_item.xsl
2015-04-13 17:37:05 UTC (rev 12997)
@@ -1,7 +1,6 @@
<xsl:template match="data" xmlns:php="http://php.net/xsl">
-<xsl:call-template name="yui_phpgw_i18n"/>
-<div class="yui-navset yui-navset-top">
+<div>
<div>
<h1><img src="{img_go_home}" />
<xsl:value-of select="php:function('lang',
'Administrate requirements')" />
Modified:
branches/dev-syncromind/logistic/templates/base/requirement/requirement_item.xsl
===================================================================
---
branches/dev-syncromind/logistic/templates/base/requirement/requirement_item.xsl
2015-04-13 17:36:12 UTC (rev 12996)
+++
branches/dev-syncromind/logistic/templates/base/requirement/requirement_item.xsl
2015-04-13 17:37:05 UTC (rev 12997)
@@ -12,7 +12,6 @@
</xsl:variable>
-<div class="content-wrp">
<div id="details">
<form action="{$action_url}" method="post">
<input type="hidden" name="id" value =
"{requirement/id}" />
@@ -149,8 +148,10 @@
</xsl:when>
<xsl:otherwise>
<xsl:variable
name="edit_params">
-
<xsl:text>menuaction:logistic.uirequirement.edit, id:</xsl:text>
+
<xsl:text>menuaction:logistic.uirequirement.edit, id:</xsl:text>
<xsl:value-of
select="requirement/id" />
+ <xsl:text>,
nonavbar:</xsl:text>
+ <xsl:value-of
select="nonavbar" />
</xsl:variable>
<xsl:variable name="edit_url">
<xsl:value-of
select="php:function('get_phpgw_link', '/index.php', $edit_params )" />
@@ -168,7 +169,7 @@
</div>
</form>
</div>
-</div>
+ <div id='constraints'></div>
</xsl:template>
<xsl:template match="options">
Modified:
branches/dev-syncromind/logistic/templates/base/requirement/requirement_overview.xsl
===================================================================
---
branches/dev-syncromind/logistic/templates/base/requirement/requirement_overview.xsl
2015-04-13 17:36:12 UTC (rev 12996)
+++
branches/dev-syncromind/logistic/templates/base/requirement/requirement_overview.xsl
2015-04-13 17:37:05 UTC (rev 12997)
@@ -1,21 +1,9 @@
-<func:function name="phpgw:conditional">
- <xsl:param name="test"/>
- <xsl:param name="true"/>
- <xsl:param name="false"/>
- <func:result>
- <xsl:choose>
- <xsl:when test="$test">
- <xsl:value-of select="$true"/>
- </xsl:when>
- <xsl:otherwise>
- <xsl:value-of select="$false"/>
- </xsl:otherwise>
- </xsl:choose>
- </func:result>
-</func:function>
-
<xsl:template name="requirement_overview" xmlns:php="http://php.net/xsl">
+ <div id="details">
+ </div>
+ <div id="allocation">
+
<div id="resource_alloc_wrp" class="content-wrp">
<xsl:variable name="activity_id">
@@ -37,62 +25,65 @@
</xsl:if>
<div style="clear:both;" id="paging"></div>
- <div style="margin-bottom: 40px;"
id="requirement-container"></div>
+ <div style="margin-bottom: 40px;"
id="requirement-container">
+ <xsl:for-each select="datatable_def">
+ <xsl:if test="container =
'datatable-container_0'">
+ <xsl:call-template
name="table_setup">
+ <xsl:with-param
name="container" select ='container'/>
+ <xsl:with-param
name="requestUrl" select ='requestUrl' />
+ <xsl:with-param
name="ColumnDefs" select ='ColumnDefs' />
+ <xsl:with-param
name="tabletools" select ='tabletools' />
+ <xsl:with-param
name="data" select ='data' />
+ <xsl:with-param
name="config" select ='config' />
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:for-each>
+ </div>
<h2 style="clear:both;"><xsl:value-of
select="php:function('lang', 'Allocated resouces')" /><span
style="margin-left:470px;font-size:14px;">(<xsl:value-of
select="php:function('lang', 'Click on table above to get allocations')"
/>)</span></h2>
<form name='assign_task'>
<!-- // Needed for case of only one checkbox in
datatable-->
<input type='hidden' name='assign_requirement'
value = '0'/>
- <div id="allocation-container"></div>
+ <xsl:for-each select="datatable_def">
+ <xsl:if test="container =
'datatable-container_1'">
+ <xsl:call-template
name="table_setup">
+ <xsl:with-param
name="container" select ='container'/>
+ <xsl:with-param
name="requestUrl" select ='requestUrl' />
+ <xsl:with-param
name="ColumnDefs" select ='ColumnDefs' />
+ <xsl:with-param
name="tabletools" select ='tabletools' />
+ <xsl:with-param
name="data" select ='data' />
+ <xsl:with-param
name="config" select ='config' />
+ </xsl:call-template>
+ </xsl:if>
+ </xsl:for-each>
</form>
</div>
<xsl:call-template name="datasource-def" />
+ </div>
+
</xsl:template>
<xsl:template name="datasource-def">
<script>
-
- var datatable_source = '<xsl:value-of select="//datatable/source"/>';
-
- YAHOO.util.Event.onDOMReady(function(){
-
- YAHOO.portico.columnDefs = [
- <xsl:for-each select="//datatable/field">
- {
- resizeable: true,
- key: "<xsl:value-of
select="key"/>",
- <xsl:if test="label">
- label: "<xsl:value-of
select="label"/>",
- </xsl:if>
- sortable: <xsl:value-of
select="phpgw:conditional(not(sortable = 0), 'true', 'false')"/>,
- <xsl:if test="hidden">
- hidden: true,
- </xsl:if>
- <xsl:if test="formatter">
- formatter:
<xsl:value-of select="formatter"/>,
- </xsl:if>
- <xsl:if test="editor">
- editor: <xsl:value-of
select="editor"/>,
- </xsl:if>
- className: "<xsl:value-of
select="className"/>"
- }<xsl:value-of
select="phpgw:conditional(not(position() = last()), ',', '')"/>
- </xsl:for-each>
- ];
-
- var reqUrl = '<xsl:value-of
select="//datatable/source"/>';
-
-
YAHOO.portico.inlineTableHelper('requirement-container', reqUrl,
YAHOO.portico.columnDefs);
- });
- $(document).ready(function(){
- var requirement_id = $("#requirement-container
table").children("tr").eq(1).find("td.requirement_id").find("div").text();
- updateAllocationTable( requirement_id );
+ $(document).ready(function()
+ {
+ $('#datatable-container_0 tbody').on('click', 'tr',
function () {
+ var requirement_id = $('td', this).eq(0).text();
+ updateAllocationTable( requirement_id );
+ } );
+
});
- function updateAllocationTable(requirement_id){
-
+ function updateAllocationTable(requirement_id)
+ {
+ if(!requirement_id)
+ {
+ return;
+ }
+
var oArgs = {
menuaction:'logistic.uirequirement_resource_allocation.index',
requirement_id: requirement_id,
@@ -100,21 +91,7 @@
};
var requestUrl = phpGWLink('index.php', oArgs,
true);
-
- YAHOO.portico.columnDefs_allocation = [
- {key:"id", label:'Id', sortable:true},
- {key:"fm_bim_item_name", label:'Navn på
ressurs', sortable:true},
- {key:"resource_type_descr",
label:'Ressurstype', sortable:true},
- {key:"allocated_amount", label:'Antall',
sortable:false},
- {key:"location_code", label:'Lokasjonskode',
sortable:true},
- {key:"fm_bim_item_address", label:'Adresse',
sortable:true},
- {key:"delete_link", label:'Slett bestilling',
sortable:true},
- {key:"assign_job", label:'Tildel oppdrag',
sortable:false},
- {key:"related", label:'Link til oppdrag',
sortable:false},
- {key:"status", label:'status', sortable:true}
- ];
-
-
YAHOO.portico.inlineTableHelper('allocation-container', requestUrl,
YAHOO.portico.columnDefs_allocation);
+ JqueryPortico.updateinlineTableHelper(oTable1,
requestUrl);
}
</script>
</xsl:template>
Modified:
branches/dev-syncromind/logistic/templates/base/requirement/requirement_tabs.xsl
===================================================================
---
branches/dev-syncromind/logistic/templates/base/requirement/requirement_tabs.xsl
2015-04-13 17:36:12 UTC (rev 12996)
+++
branches/dev-syncromind/logistic/templates/base/requirement/requirement_tabs.xsl
2015-04-13 17:37:05 UTC (rev 12997)
@@ -2,12 +2,11 @@
<!-- separate tabs and inline tables-->
<xsl:template match="data" xmlns:php="http://php.net/xsl">
-<div class="yui-navset yui-navset-top" id="requirement_tabview">
+<div id="requirement_tabview">
<xsl:choose>
<xsl:when test="view = 'requirement_details'">
- <xsl:call-template name="yui_phpgw_i18n"/>
-
+
<xsl:choose>
<xsl:when test="requirement/id != '' or
requirement/id != 0">
<h1 style="float:left;">
@@ -35,9 +34,10 @@
</h1>
</xsl:otherwise>
</xsl:choose>
-
- <xsl:value-of disable-output-escaping="yes"
select="tabs" />
- <xsl:call-template name="requirement_details" />
+ <div id="tab-content">
+ <xsl:value-of disable-output-escaping="yes"
select="tabs" />
+ <xsl:call-template name="requirement_details" />
+ </div>
</xsl:when>
<xsl:when test="view = 'requirement_values'">
@@ -58,11 +58,11 @@
</h1>
</xsl:otherwise>
</xsl:choose>
-
- <xsl:value-of disable-output-escaping="yes"
select="tabs" />
- <xsl:call-template name="requirement_values" />
+ <div id="tab-content">
+ <xsl:value-of disable-output-escaping="yes"
select="tabs" />
+ <xsl:call-template name="requirement_values" />
+ </div>
</xsl:when>
</xsl:choose>
</div>
-
</xsl:template>
Modified:
branches/dev-syncromind/logistic/templates/base/requirement/requirement_values.xsl
===================================================================
---
branches/dev-syncromind/logistic/templates/base/requirement/requirement_values.xsl
2015-04-13 17:36:12 UTC (rev 12996)
+++
branches/dev-syncromind/logistic/templates/base/requirement/requirement_values.xsl
2015-04-13 17:37:05 UTC (rev 12997)
@@ -1,14 +1,20 @@
<xsl:template name="requirement_values" xmlns:php="http://php.net/xsl">
<xsl:variable name="date_format"><xsl:value-of
select="php:function('get_phpgw_info',
'user|preferences|common|dateformat')"/></xsl:variable>
+<div id='details'></div>
-<div class="yui-content" style="padding: 20px;">
- <h2><xsl:value-of select="php:function('lang', 'Criterias')"
/></h2>
+ <div id='constraints'>
+
+ <h2>
+ <xsl:value-of select="php:function('lang', 'Criterias')" />
+ </h2>
<xsl:variable name="action_url">
<xsl:value-of select="php:function('get_phpgw_link',
'/index.php', 'menuaction:logistic.uirequirement.save_requirement_values')" />
</xsl:variable>
+
<form id="frm-requirement-values" action="{$action_url}"
method="post">
<input type="hidden" name="requirement_id" value =
"{requirement/id}" />
+ <input type="hidden" name="nonavbar" value =
"{nonavbar}" />
<dl class="proplist-col">
<dd>
@@ -179,7 +185,9 @@
<xsl:variable name="view_resources_params">
<xsl:text>menuaction:logistic.uiactivity.view_resource_allocation,
activity_id:</xsl:text>
- <xsl:value-of select="activity/id" />
+ <xsl:value-of select="activity/id" />
+ <xsl:text>, nonavbar:</xsl:text>
+ <xsl:value-of select="nonavbar" />
</xsl:variable>
<xsl:variable name="view_resources_url">
<xsl:value-of
select="php:function('get_phpgw_link', '/index.php', $view_resources_params )"
/>
@@ -199,6 +207,8 @@
<xsl:variable name="params">
<xsl:text>menuaction:logistic.uirequirement.add_requirement_values,
requirement_id:</xsl:text>
<xsl:value-of
select="requirement/id" />
+ <xsl:text>,
nonavbar:</xsl:text>
+ <xsl:value-of
select="nonavbar" />
</xsl:variable>
<xsl:variable
name="edit_url">
<xsl:value-of
select="php:function('get_phpgw_link', '/index.php', $params )" />
@@ -212,7 +222,7 @@
</xsl:choose>
</div>
</form>
-</div>
+ </div>
</xsl:template>
<xsl:template match="options">
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [12997] converting logistic,
Sigurd Nes <=