Author: nathangray
New Revision: 56100
URL: http://svn.stylite.de/viewvc/egroupware?rev=56100&view=rev
Log:
Move projectmanager to new API
Removed:
trunk/projectmanager/setup/etemplates.inc.php
trunk/projectmanager/templates/default/csv_import.tpl
trunk/projectmanager/templates/default/preference_acl_row.tpl
trunk/projectmanager/templates/default/preference_colspan.tpl
Modified:
trunk/projectmanager/inc/class.datasource.inc.php
trunk/projectmanager/inc/class.projectmanager_admin.inc.php
trunk/projectmanager/inc/class.projectmanager_bo.inc.php
trunk/projectmanager/inc/class.projectmanager_constraints_so.inc.php
trunk/projectmanager/inc/class.projectmanager_datasource.inc.php
trunk/projectmanager/inc/class.projectmanager_elements_bo.inc.php
trunk/projectmanager/inc/class.projectmanager_elements_so.inc.php
trunk/projectmanager/inc/class.projectmanager_elements_ui.inc.php
trunk/projectmanager/inc/class.projectmanager_eroles_bo.inc.php
trunk/projectmanager/inc/class.projectmanager_eroles_so.inc.php
trunk/projectmanager/inc/class.projectmanager_eroles_ui.inc.php
trunk/projectmanager/inc/class.projectmanager_export_elements_csv.inc.php
trunk/projectmanager/inc/class.projectmanager_export_projects_csv.inc.php
trunk/projectmanager/inc/class.projectmanager_gantt.inc.php
trunk/projectmanager/inc/class.projectmanager_hooks.inc.php
trunk/projectmanager/inc/class.projectmanager_import_projects_csv.inc.php
trunk/projectmanager/inc/class.projectmanager_merge.inc.php
trunk/projectmanager/inc/class.projectmanager_milestones_so.inc.php
trunk/projectmanager/inc/class.projectmanager_milestones_ui.inc.php
trunk/projectmanager/inc/class.projectmanager_pricelist_bo.inc.php
trunk/projectmanager/inc/class.projectmanager_pricelist_so.inc.php
trunk/projectmanager/inc/class.projectmanager_pricelist_ui.inc.php
trunk/projectmanager/inc/class.projectmanager_roles_so.inc.php
trunk/projectmanager/inc/class.projectmanager_roles_ui.inc.php
trunk/projectmanager/inc/class.projectmanager_so.inc.php
trunk/projectmanager/inc/class.projectmanager_tracking.inc.php
trunk/projectmanager/inc/class.projectmanager_ui.inc.php
trunk/projectmanager/inc/class.projectmanager_widget.inc.php
trunk/projectmanager/inc/class.projectmanager_wizard_export_projects_csv.inc.php
trunk/projectmanager/inc/class.projectmanager_wizard_import_projects_csv.inc.php
trunk/projectmanager/index.php
trunk/projectmanager/setup/setup.inc.php
trunk/projectmanager/setup/tables_update.inc.php
trunk/projectmanager/templates/default/pricelist.list.xet
— trunk/projectmanager/inc/class.datasource.inc.php (original)
+++ trunk/projectmanager/inc/class.datasource.inc.php Tue May 10 00:05:39 2016
@@ -9,6 +9,9 @@
+use EGroupware\Api;
+use EGroupware\Api\Link;
/**
- constants for the different types of data
@@ -158,7 +161,7 @@
*/
function get($data_id)
{
— trunk/projectmanager/inc/class.projectmanager_admin.inc.php (original)
+++ trunk/projectmanager/inc/class.projectmanager_admin.inc.php Tue May 10 00:05:39 2016
@@ -9,6 +9,10 @@
+use EGroupware\Api;
+use EGroupware\Api\Egw;
+use EGroupware\Api\Etemplate;
/**
- ProjectManager: Administration
@@ -24,7 +28,7 @@
var $accounting_types;
var $duration_units;
/**
-
- Instance of config class for projectmanager
-
- Instance of Api\Config class for projectmanager
-
-
@var config
*/
@@ -37,9 +41,9 @@
{
if (!$GLOBALS[‘egw_info’][‘user’][‘apps’][‘admin’])
{
@@ -61,7 +65,7 @@
*/
function config($content=null)
{
@@ -75,7 +79,7 @@
}
if ($content[‘cancel’] || $content[‘save’])
{
-
Egw::redirect_link('/index.php', array(
'menuaction' => 'admin.admin_ui.index',
'ajax' => 'true'
), 'admin');
— trunk/projectmanager/inc/class.projectmanager_bo.inc.php (original)
+++ trunk/projectmanager/inc/class.projectmanager_bo.inc.php Tue May 10 00:05:39 2016
@@ -10,9 +10,13 @@
-define(‘EGW_ACL_BUDGET’,EGW_ACL_CUSTOM_1);
-define(‘EGW_ACL_EDIT_BUDGET’,EGW_ACL_CUSTOM_2);
-define(‘EGW_ACL_ADD_TIMESHEET’, EGW_ACL_CUSTOM_3);
+use EGroupware\Api;
+use EGroupware\Api\Link;
+use EGroupware\Api\Acl;
+
+define(‘EGW_ACL_BUDGET’,Acl::CUSTOM1);
+define(‘EGW_ACL_EDIT_BUDGET’,Acl::CUSTOM2);
+define(‘EGW_ACL_ADD_TIMESHEET’, Acl::CUSTOM3);
/**
- General business object of the projectmanager
@@ -23,7 +27,7 @@
class projectmanager_bo extends projectmanager_so
{
/**
-
- Debuglevel: 0 = no debug-messages, 1 = main, 2 = more, 3 = all, 4 = all incl. so_sql, or string with function-name to debug
-
- Debuglevel: 0 = no debug-messages, 1 = main, 2 = more, 3 = all, 4 = all incl. Api\Storage\Base, or string with function-name to debug
-
-
@var int|string
*/
@@ -306,11 +310,11 @@
$extra = array();
if ($old && $this->link_title($new) !== ($old_title=$this->link_title($old)))
{
-
//error_log(__METHOD__."() calling egw_link::notify_update('projectmanager', {$this->data['pm_id']}, ".array2string($this->data+$extra).")");
-
egw_link::notify_update('projectmanager',$this->data['pm_id'],$this->data+$extra);
-
//error_log(__METHOD__."() calling Link::notify_update('projectmanager', {$this->data['pm_id']}, ".array2string($this->data+$extra).")");
-
Link::notify_update('projectmanager',$this->data['pm_id'],$this->data+$extra);
}
//$changed[] = array();
if (isset($old)) foreach($old as $name => $value)
@@ -365,7 +369,7 @@
// the following is not really necessary, as it's already one in projectmanager_elements_bo::delete
// delete all links to project $pm_id
-
Link::unlink(0,'projectmanager',$pm_id);
$this->instanciate('constraints,milestones,pricelist,roles');
@@ -388,7 +392,7 @@
* changes the data from the db-format to your work-format
*
* reimplemented to adjust the timezone of the timestamps (adding $this->tz_offset_s to get user-time)
-
- Please note, we do NOT call the method of the parent or so_sql !!!
-
- Please note, we do NOT call the method of the parent or Api\Storage\Base !!!
-
-
@param array $data if given works on that array and returns result, else works on internal data-array
-
@return array with changed data
@@ -411,7 +415,7 @@
- changes the data from your work-format to the db-format
-
- reimplemented to adjust the timezone of the timestamps (subtraction $this->tz_offset_s to get server-time)
-
- Please note, we do NOT call the method of the parent or so_sql !!!
-
- Please note, we do NOT call the method of the parent or Api\Storage\Base !!!
-
-
@param array $data if given works on that array and returns result, else works on internal data-array
-
@return array with changed data
@@ -432,7 +436,7 @@
}
/**
-
- generate a project-ID / generted by config format
-
- generate a project-ID / generated by Api\Config format
-
-
@param boolean $set_data=true set generated number in $this->data, default true
-
@param string $parent=’’ pm_number of parent
@@ -550,9 +554,9 @@
/**
- checks if the given user has enough rights for a certain operation
-
-
- Rights are given via owner grants or role based acl
-
-
-
@param int $required EGW_ACL_READ, EGW_ACL_WRITE, EGW_ACL_ADD, EGW_ACL_ADD_TIMESHEET, EGW_ACL_DELETE, EGW_ACL_BUDGET, EGW_ACL_EDIT_BUDGET
-
- Rights are given via owner grants or role based Acl
-
-
-
@param int $required Acl::READ, Acl::EDIT, Acl::ADD, EGW_ACL_ADD_TIMESHEET, Acl::DELETE, EGW_ACL_BUDGET, EGW_ACL_EDIT_BUDGET
-
@param array|int $data=null project or project-id to use, default the project in $this->data
-
@param boolean $no_cache=false should a cached value be used, if availible, or not
-
@param int $user=null for which user to check, default current user
@@ -577,7 +581,7 @@
if (!$pm_id) // new entry, everything allowed, but delete
{
@@ -596,7 +600,7 @@
{
$data =& $this->data;
}
@@ -614,15 +618,15 @@
// anonymous access implies read rights for everyone
if (is_array($data) && $data[‘pm_access’] === ‘anonym’)
{
@@ -640,7 +644,7 @@
/**
* Read a project
*
-
- reimplemented to add an acl check
-
- reimplemented to add an Acl check
-
-
@param array $keys
-
@return array|boolean array with project, null if project not found or false if no perms to view it
@@ -651,7 +655,7 @@
{
return null;
}
@@ -705,7 +709,7 @@
$titles[$project[‘pm_id’]] = $this->link_title($project);
}
}
@@ -749,9 +753,9 @@
* - file read rights = project read rights
* - file write or delete rights = project edit rights
*
-
-
@ToDo Implement own acl rights for file access
-
-
@ToDo Implement own Acl rights for file access
-
@param int $id pm_id of project
-
-
@param int $check EGW_ACL_READ for read and EGW_ACL_EDIT for write or delete access
-
-
@param int $check Acl::READ for read and Acl::EDIT for write or delete access
-
@param string $rel_path path relative to project directory (currently not used)
-
@param int $user=null for which user to check, default current user
-
@return boolean true if access is granted or false otherwise
@@ -776,16 +780,16 @@
static $ancestors_cache = array(); // some caching
if (!$pm_id && !($pm_id = $this->pm_id)) return false;
+error_log(METHOD . “(”.array2string($pm_id)." ancestors cache:" . array2string($ancestors_cache));
if (!isset($ancestors_cache[$pm_id]))
{
$ancestors_cache[$pm_id] = array();
// read all projectmanager entries attached to this one
-
foreach(Link::get_links('projectmanager',$pm_id,'projectmanager') as $link_id => $data)
{
// we need to read the complete link, to know if the entry is a child (link_id1 == pm_id)
@@ -824,10 +828,10 @@
$children_cache[$pm_id] = array();
// read all projectmanager entries attached to this one
-
foreach(Link::get_links('projectmanager',$pm_id,'projectmanager') as $link_id => $data)
{
// we need to read the complete link, to know if the entry is a child (link_id1 == pm_id)
@@ -923,7 +927,7 @@
{
if ($this->logfile && ($f = @fopen($this->logfile,‘a+’)))
{
@@ -974,7 +978,7 @@
}
else
{
@@ -1091,7 +1095,7 @@
$data_backup = $this->data;
}
-
if (!$this->read((int) $source) || !$this->check_acl(Acl::READ))
{
if ((int) $this->debug >= 1 || $this->debug == 'copy') $this->debug_message("projectmanager_bo::copy($source,$only_stage) returning false (not found or no perms), data=".print_r($this->data,true));
return false;
— trunk/projectmanager/inc/class.projectmanager_constraints_so.inc.php (original)
+++ trunk/projectmanager/inc/class.projectmanager_constraints_so.inc.php Tue May 10 00:05:39 2016
@@ -10,12 +10,14 @@
+use EGroupware\Api;
+
/**
- Constraints storage object of the projectmanager
-
- Tables: egw_pm_constraints
*/
-class projectmanager_constraints_so extends so_sql
+class projectmanager_constraints_so extends Api\Storage\Base
{
// Gantt chart supports 4 constraint types. The most common is 0,
// Ends before .
— trunk/projectmanager/inc/class.projectmanager_datasource.inc.php (original)
+++ trunk/projectmanager/inc/class.projectmanager_datasource.inc.php Tue May 10 00:05:39 2016
@@ -10,6 +10,9 @@
+use EGroupware\Api;
+use EGroupware\Api\Link;
+
include_once(EGW_INCLUDE_ROOT.’/projectmanager/inc/class.datasource.inc.php’);
/**
@@ -180,7 +183,7 @@
if ($this->debug > 3 || $this->debug == ‘copy’) $this->projectmanager_bo->debug_message(“projectmanager_datasource::copy() data=”.print_r($this->projectmanager_bo->data,true));
// link the new sub-project with the project
-
$link_id = egw_link::link('projectmanager',$target,'projectmanager',$pm_id,$element['pe_remark'],0,0,1);
-
$link_id = Link::link('projectmanager',$target,'projectmanager',$pm_id,$element['pe_remark'],0,0,1);
}
$this->projectmanager_bo->data = $data_backup;
— trunk/projectmanager/inc/class.projectmanager_elements_bo.inc.php (original)
+++ trunk/projectmanager/inc/class.projectmanager_elements_bo.inc.php Tue May 10 00:05:39 2016
@@ -10,13 +10,18 @@
+use EGroupware\Api;
+use EGroupware\Api\Link;
+use EGroupware\Api\Egw;
+use EGroupware\Api\Acl;
+
/**
- Elements business object of the projectmanager
/
class projectmanager_elements_bo extends projectmanager_elements_so
{
/*
-
- Debuglevel: 0 = no debug-messages, 1 = main, 2 = more, 3 = all, 4 = all incl. so_sql, or string with function-name to debug
-
- Debuglevel: 0 = no debug-messages, 1 = main, 2 = more, 3 = all, 4 = all incl. Api\Storage\Base, or string with function-name to debug
-
-
@var int/string
*/
@@ -162,7 +167,7 @@
// for projectmanager we need to check the direction of the link
if ($data[‘target_app’] == ‘projectmanager’)
{
@@ -248,7 +253,7 @@
$this->data[‘pe_status’]= ‘new’;
}
// if user linking has no ADD rights, the entry is set to ignored
@@ -299,7 +304,7 @@
*/
function update_cat($pe_ids, $cat_id)
{
@@ -371,7 +376,7 @@
* - Adding, editing and deleting of elements require the ADD right of the project (deleting requires the element to exist pe_id!=0)
* - reading or editing of budgets require the concerned rights of the project
*
-
-
@param int $required EGW_ACL_READ, EGW_ACL_WRITE, EGW_ACL_ADD, EGW_ACL_DELETE, EGW_ACL_BUDGET or EGW_ACL_EDIT_BUDGET
-
-
@param int $required Acl::READ, ACL::EDIT, Acl::ADD, Acl::DELETE, EGW_ACL_BUDGET or EGW_ACL_EDIT_BUDGET
-
@param array/int $data=null project-element or pe_id to use, default the project-element in $this->data
-
@return boolean true if the rights are ok, false if not
*/
@@ -380,7 +385,7 @@
$pe_id = is_array($data) ? $data[‘pe_id’] : ($data ? $data : $this->data[‘pe_id’]);
$pm_id = is_array($data) ? $data[‘pm_id’] : ($data ? 0 : $this->data[‘pm_id’]);
@@ -394,9 +399,9 @@
$pm_id = $data['pm_id'];
}
-
if ($required == Acl::EDIT ||$required == Acl::DELETE)
-
{
-
$required = Acl::ADD; // edit or delete of elements is handled by the ADD right of the project
}
return $this->project->check_acl($required,$pm_id);
}
@@ -434,7 +439,7 @@
- changes the data from the db-format to your work-format
-
- reimplemented to adjust the timezone of the timestamps (adding $this->tz_offset_s to get user-time)
-
- Please note, we do NOT call the method of the parent or so_sql !!!
-
- Please note, we do NOT call the method of the parent or Api\Storage\Base !!!
-
-
@param array $data if given works on that array and returns result, else works on internal data-array
-
@return array with changed data
@@ -460,7 +465,7 @@
- changes the data from your work-format to the db-format
-
- reimplemented to adjust the timezone of the timestamps (subtraction $this->tz_offset_s to get server-time)
-
- Please note, we do NOT call the method of the parent or so_sql !!!
-
- Please note, we do NOT call the method of the parent or Api\Storage\Base !!!
-
-
@param array $data if given works on that array and returns result, else works on internal data-array
-
@return array with changed data
@@ -510,7 +515,7 @@
{
unset($keys[‘update_remark’]);
unset($this->data[‘update_remark’]);
@@ -572,7 +577,7 @@
if ($pe_id)
{
// delete one link
@@ -581,7 +586,7 @@
elseif ($pm_id)
{
// delete all links to project $pm_id
-
$link_id = egw_link::link('projectmanager',$this->pm_id,$element['pe_app'],$app_id,$element['pe_remark'],0,0,1);
-
$link_id = Link::link('projectmanager',$this->pm_id,$element['pe_app'],$app_id,$element['pe_remark'],0,0,1);
}
if ((int) $this->debug >= 3 || $this->debug == 'copytree') $this->debug_message("calling update($element[pe_app],$app_id,$link_id,$this->pm_id,false);");
@@ -798,7 +803,7 @@
* @param string $op defaults to ‘AND’, can be set to ‘OR’ too, then criteria’s are OR’ed together
* @param int/boolean $start if != false, return only maxmatch rows begining with start
* @param array $filter if set (!=null) col-data pairs, to be and-ed (!) into the query without wildcards
-
-
@param string/boolean $join=true default join with links-table or string as in so_sql
-
-
@param string/boolean $join=true default join with links-table or string as in Api\Storage\Base
-
@return array of matching rows (the row is an array of the cols) or False
*/
function search($criteria,$only_keys=True,$order_by=’’,$extra_cols=’’,$wildcard=’’,$empty=False,$op=‘AND’,$start=false,$filter=null,$join=true)
@@ -810,7 +815,7 @@
if ($filter[‘cumulate’])
{
$cumulate = array();
— trunk/projectmanager/inc/class.projectmanager_elements_so.inc.php (original)
+++ trunk/projectmanager/inc/class.projectmanager_elements_so.inc.php Tue May 10 00:05:39 2016
@@ -10,6 +10,9 @@
+use EGroupware\Api;
+use EGroupware\Api\Link;
+
/**
- Elements storage object of the projectmanager
-
@@ -17,14 +20,14 @@
*
- A project P is the parent of an other project C, if link_id1=P.pm_id and link_id2=C.pm_id !
/
-class projectmanager_elements_so extends so_sql
+class projectmanager_elements_so extends Api\Storage\Base
{
/*
- Table name ‘egw_links’
-
-
@var string
*/
- var $links_table = solink::TABLE;
- var $links_table = Link\Storage::TABLE;
/**
@@ -199,7 +202,7 @@
* @param string $op defaults to ‘AND’, can be set to ‘OR’ too, then criteria’s are OR’ed together
* @param int|boolean $start if != false, return only maxmatch rows begining with start
* @param array $filter if set (!=null) col-data pairs, to be and-ed (!) into the query without wildcards
-
-
@param string|boolean $join =true default join with links-table or string as in so_sql
-
-
@param string|boolean $join =true default join with links-table or string as in Api\Storage\Base
-
@return array of matching rows (the row is an array of the cols) or False
*/
function search($criteria,$only_keys=True,$order_by=’’,$extra_cols=’’,$wildcard=’’,$empty=False,$op=‘AND’,$start=false,$filter=null,$join=true)
@@ -253,7 +256,7 @@
{
if (!is_object($GLOBALS[‘egw’]->categories))
{
@@ -268,7 +271,7 @@
*
* @param array $keys array with keys in form internalName => value, may be a scalar value if only one key
* @param array|string $extra_cols string or array of strings to be added to the SELECT, eg. “count(*) as num”
-
-
@param string|boolean $join =true default join with links-table or string as in so_sql
-
-
@param string|boolean $join =true default join with links-table or string as in Api\Storage\Base
-
@return array|boolean data if row could be retrived else False
*/
function read($keys,$extra_cols=’’,$join=true)
— trunk/projectmanager/inc/class.projectmanager_elements_ui.inc.php (original)
+++ trunk/projectmanager/inc/class.projectmanager_elements_ui.inc.php Tue May 10 00:05:39 2016
@@ -10,6 +10,14 @@
+use EGroupware\Api;
+use EGroupware\Api\Link;
+use EGroupware\Api\Framework;
+use EGroupware\Api\Egw;
+use EGroupware\Api\Acl;
+use EGroupware\Api\Vfs;
+use EGroupware\Api\Etemplate;
+
/**
- ProjectManage UI: list and edit projects-elements
*/
@@ -51,7 +59,7 @@
*/
function __construct()
{
@@ -71,9 +79,9 @@
// check if we have at least read-access to this project
-
if (!$this->project->check_acl(EGW_ACL_READ))
-
{
-
egw_framework::message(lang('Permission denied !!!'),'error');
-
if (!$this->project->check_acl(Acl::READ))
-
{
-
Framework::message(lang('Permission denied !!!'),'error');
$pm_id = 0;
}
@@ -240,10 +248,10 @@
}
//echo “projectmanager_elements_ui::edit(): save_necessary=”.(int)$save_necessary.", update_necessary=$update_necessary, data="; _debug_array($this->data);
@@ -256,7 +264,7 @@
{
$msg = lang(‘Project-Element saved’);
@@ -267,8 +275,8 @@
if ($content['save'] || $content['cancel'] || $content['delete'])
{
@@ -289,14 +297,14 @@
}
if ($this->data[‘pe_id’])
{
@@ -400,11 +408,11 @@
‘type’ => projectmanager_constraints_so::$constraint_types,
);
$readonlys = array(
-
'delete' => !$this->data['pe_id'] || !$this->check_acl(EGW_ACL_DELETE),
-
'edit' => !$view || !$this->check_acl(EGW_ACL_EDIT),
-
'delete' => !$this->data['pe_id'] || !$this->check_acl(Acl::DELETE),
-
'edit' => !$view || !$this->check_acl(Acl::EDIT),
'eroles_edit' => $view,
);
-
// display eroles tab only if it's enabled in Api\Config and for supported erole Egw\Applications
$readonlys[$tabs]['eroles'] = (!$this->config['enable_eroles']) || !(in_array($this->data['pe_app'],$this->erole_apps));
// disable the times tab, if accounting-type status
$readonlys[$tabs]['times'] = $this->project->data['pm_accounting_type'] == 'status';
@@ -438,11 +446,11 @@
/**
* query projects for nextmatch in the projects-list
*
-
- reimplemented from so_sql to disable action-buttons based on the acl and make some modification on the data
-
- reimplemented from Api\Storage\Base to disable action-buttons based on the Acl and make some modification on the data
-
-
@param array &$query_in
-
@param array &$rows returned rows/cups
-
-
@param array &$readonlys eg. to disable buttons based on acl
-
-
@param array &$readonlys eg. to disable buttons based on Acl
*/
function get_rows(&$query_in,&$rows,&$readonlys)
{
@@ -458,17 +466,17 @@
{
return 0;
}
-
Api\Cache::setSession('projectmanager', 'projectelements_list', $query_in);
//echo "<p>project_elements_ui::get_rows(".print_r($query,true).")</p>\n";
// save the state of the index in the user prefs
@@ -554,11 +562,11 @@
$budget_rights = $this->project->check_acl(EGW_ACL_BUDGET);
foreach($rows as $n => &$row)
{
@@ -602,14 +610,14 @@
if ($query[‘filter2’]&3)
{
if ($this->prefs[‘show_links’] &&
-
(isset($row['pe_all_links']) || ($row['pe_all_links'] = egw_link::get_links($row['link']['app'],$row['link']['id'],'',true))))
-
(isset($row['pe_all_links']) || ($row['pe_all_links'] = Link::get_links($row['link']['app'],$row['link']['id'],'',true))))
{
foreach ($row['pe_all_links'] as $link)
{
if ($show_links != 'none' &&
!($row['pm_link']['id'] == $link['id'] && $link['app'] == 'projectmanager') &&
!($row['pm_id'] == $link['id'] && $link['app'] == 'projectmanager') &&
@@ -626,7 +634,7 @@
if ($this->prefs[‘show_custom_app_icons’] || $this->prefs[‘show_infolog_type_icon’])
{
$custom_app_icons[‘location’] = ‘pm_custom_app_icons’;
@@ -777,7 +785,7 @@
‘hint’ => ‘necessary for project-elements doing that not automatic’,
‘group’ => ++$group,
),
-
'cat' => Etemplate\Widget\Nextmatch::category_action(
'projectmanager',$group,'Change category','cat_'
)+array(
'disableClass' => 'rowNoEdit',
@@ -857,7 +865,7 @@
}
//Create app list for "Add new" menu items
@@ -912,7 +920,7 @@
$this->action($content[‘nm’][‘action’], $content[‘nm’][‘selected’], $msg, $content[‘add_existing_popup’]);
}
$content = array(
-
'nm' => Api\Cache::getSession('projectmanager', 'projectelements_list'),
'msg' => $msg,
);
if (!is_array($content['nm']))
@@ -968,7 +976,7 @@
$content[‘nm’][‘actions’] = $this->get_actions();
// add "buttons" only with add-rights
@@ -996,8 +1004,8 @@
’: ’ . $this->project->data[‘pm_number’] . ': ’ .$this->project->data[‘pm_title’] ;
// fill the sel_options Applications
-
$sel_options ['pe_app'] = egw_link::app_list('add_app');
-
$this->tpl->setElementAttribute('nm[link_add]', 'application', egw_link::app_list('add'));
-
$sel_options ['pe_app'] = Link::app_list('add_app');
-
$this->tpl->setElementAttribute('nm[link_add]', 'application', Link::app_list('add'));
$this->tpl->exec('projectmanager.projectmanager_elements_ui.index',$content,$sel_options,$readonlys);
}
@@ -1010,10 +1018,10 @@
{
if (!$this->prefs[‘document_dir’]) return array();
@@ -1023,7 +1031,7 @@
$actions[‘document-’.$file[‘name’]] = $file[‘name’];
}
}
@@ -1103,7 +1111,7 @@
return $failed == 0;
case 'cat':
@@ -1156,7 +1164,7 @@
return $failed==0;
break;
case ‘delete’:
@@ -1169,7 +1177,7 @@
break;
case 'sync_all': // does NOT use id's
@@ -1187,7 +1195,7 @@
if(count($checked) == 0)
{
// Use all, from merge selectbox in side menu
-
$query = $old_query = Api\Cache::getSession('projectmanager', 'projectelements_list');
$query['num_rows'] = -1; // all
$this->get_rows($query,$selection,$readonlys);
foreach($selection as $element)
@@ -1196,7 +1204,7 @@
}
// Reset nm params
-
Api\Cache::setSession('projectmanager', 'projectelements_list', $old_query);
}
foreach($this->search(array('pm_id' => $this->data['pm_id']),false) as $id => $element)
@@ -1319,7 +1327,7 @@
if($ids[‘elements’])
{
if($document_merge->export_limit &&
— trunk/projectmanager/inc/class.projectmanager_eroles_bo.inc.php (original)
+++ trunk/projectmanager/inc/class.projectmanager_eroles_bo.inc.php Tue May 10 00:05:39 2016
@@ -10,6 +10,9 @@
-
@version $Id: class.projectmanager_eroles_bo.inc.php 26091 2008-10-07 17:57:50Z jaytraxx $
*/
+use EGroupware\Api;
+use EGroupware\Api\Etemplate;
+
/**
- eRoles business object of the projectmanager
- eRoles - element roles define the role of an egroupware element when it gets merged with a document
@@ -65,7 +68,7 @@
}
elseif(isset($_REQUEST[‘etemplate_exec_id’]))
{
@@ -83,7 +86,7 @@
elseif(isset($_REQUEST[‘etemplate_exec_id’]))
{
if(is_object($etemplate_request) ||
@@ -218,7 +221,7 @@
// search for global erole
$erole = parent::read(array(
‘role_title’ => $role_title,
-
'pm_id' => '0') // need to be '0' NOT 0, as Api\Storage\Base only uses it, if != '', but 0 == ''!
);
if(isset($erole['role_id'])) return $erole['role_id'];
— trunk/projectmanager/inc/class.projectmanager_eroles_so.inc.php (original)
+++ trunk/projectmanager/inc/class.projectmanager_eroles_so.inc.php Tue May 10 00:05:39 2016
@@ -12,13 +12,15 @@
-
@version $Id: class.projectmanager_eroles_so.inc.php 26091 2008-10-07 17:57:50Z jaytraxx $
*/
+use EGroupware\Api;
+
/**
- eRoles storage object of the projectmanager
- eRoles - element roles define the role of an egroupware element when it gets merged with a document
-
- Tables: egw_pm_eroles
/
-class projectmanager_eroles_so extends so_sql
+class projectmanager_eroles_so extends Api\Storage\Base
{
/*
- Constructor, calls the constructor of the extended class
— trunk/projectmanager/inc/class.projectmanager_eroles_ui.inc.php (original)
+++ trunk/projectmanager/inc/class.projectmanager_eroles_ui.inc.php Tue May 10 00:05:39 2016
@@ -12,7 +12,12 @@
-
@version $Id: class.projectmanager_eroles_ui.inc.php 27222 2009-06-08 16:21:14Z jaytraxx $
*/
-define(‘EGW_ACL_PROJECT_EROLES’,EGW_ACL_EDIT);
+use EGroupware\Api;
+use EGroupware\Api\Framework;
+use EGroupware\Api\Acl;
+use EGroupware\Api\Etemplate;
+
+define(‘EGW_ACL_PROJECT_EROLES’,Acl::EDIT);
/**
- ProjectManager UI: eRoles
@@ -54,7 +59,7 @@
*/
function eroles($content=null)
{
@@ -98,7 +103,7 @@
$msg = lang(‘Element role saved’);
— trunk/projectmanager/inc/class.projectmanager_export_elements_csv.inc.php (original)
+++ trunk/projectmanager/inc/class.projectmanager_export_elements_csv.inc.php Tue May 10 00:05:39 2016
@@ -11,6 +11,9 @@
+use EGroupware\Api;
+use EGroupware\Api\Link;
+
/**
- export project elements to CSV
*/
@@ -49,21 +52,21 @@
$selection = array();
if ($options[‘selection’] == ‘selected’) {
// ui selection with ‘Use search results’
-
$query = $old_query = Api\Cache::getSession('projectmanager', 'projectelements_list');
$query['num_rows'] = -1; // all
$query['csv_export'] = true; // so get_rows method _can_ produce different content or not store state in the session
// Getting elements from the project list, use those search results
if($no_project)
{
-
$p_query = $old_p_query = Api\Cache::getSession('projectmanager', 'project_list');
$pm_ui = new projectmanager_ui();
$p_query['num_rows'] = -1; // all
$p_query['csv_export'] = true; // so get_rows method _can_ produce different content or not store state in the session
$count = $pm_ui->get_rows($p_query,$selection,$readonlys);
// Reset nm params
@@ -87,11 +90,11 @@
// Reset nm params
unset($query['num_rows']);
@@ -101,7 +104,7 @@
‘col_filter’ => array(‘pm_id’ => true)
);
$ui->get_rows($query,$selection,$readonlys);
@@ -134,15 +137,15 @@
}
else
{