r56100 - in /trunk/projectmanager: ./ inc/ setup/ templates/default/

classic Classic list List threaded Threaded
1 message Options
nathangray nathangray
Reply | Threaded
Open this post in threaded view
|

r56100 - in /trunk/projectmanager: ./ inc/ setup/ templates/default/

Author: nathangray
Date: Tue May 10 00:05:39 2016
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

Modified: trunk/projectmanager/inc/class.datasource.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/projectmanager/inc/class.datasource.inc.php?rev=56100&r1=56099&r2=56100&view=diff
==============================================================================
--- 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 @@
  * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
  * @version $Id$
  */
+
+use EGroupware\Api;
+use EGroupware\Api\Link;
 
 /**
  * constants for the different types of data
@@ -158,7 +161,7 @@
  */
  function get($data_id)
  {
- if (($title = egw_link::title($this->type,$data_id)))
+ if (($title = Link::title($this->type,$data_id)))
  {
  return array(
  'pe_title'  => $title,

Modified: trunk/projectmanager/inc/class.projectmanager_admin.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/projectmanager/inc/class.projectmanager_admin.inc.php?rev=56100&r1=56099&r2=56100&view=diff
==============================================================================
--- 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 @@
  * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
  * @version $Id$
  */
+
+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'])
  {
- throw new egw_exception_no_permission_admin();
+ throw new Api\Exception\NoPermission\Admin();
  }
- $this->config = new config('projectmanager');
+ $this->config = new Api\Config('projectmanager');
  $this->config->read_repository();
 
  $this->accounting_types = array(
@@ -61,7 +65,7 @@
  */
  function config($content=null)
  {
- $tpl = new etemplate_new('projectmanager.config');
+ $tpl = new Etemplate('projectmanager.config');
 
  if ($content['save'] || $content['apply'])
  {
@@ -75,7 +79,7 @@
  }
  if ($content['cancel'] || $content['save'])
  {
- egw::redirect_link('/index.php', array(
+ Egw::redirect_link('/index.php', array(
  'menuaction' => 'admin.admin_ui.index',
  'ajax' => 'true'
  ), 'admin');

Modified: trunk/projectmanager/inc/class.projectmanager_bo.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/projectmanager/inc/class.projectmanager_bo.inc.php?rev=56100&r1=56099&r2=56100&view=diff
==============================================================================
--- 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 @@
  * @version $Id$
  */
 
-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)))
  {
- $extra[egw_link::OLD_LINK_TITLE] = $old_title;
+ $extra[Link::OLD_LINK_TITLE] = $old_title;
  }
  // notify the link-class about the update, as other apps may be subscribt to it
- //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
- egw_link::unlink(0,'projectmanager',$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
  {
- return $required != EGW_ACL_DELETE;
+ return $required != Acl::DELETE;
  }
  if (!isset($rights) || $no_cache) // check if we have a cache entry for $pm_id
  {
@@ -596,7 +600,7 @@
  {
  $data =& $this->data;
  }
- // rights come from owner grants or role based acl
+ // rights come from owner grants or role based Acl
  $memberships = $GLOBALS['egw']->accounts->memberships($this->user);
  $member_from_groups = array_intersect_key((array)$data['pm_members'], $memberships);
  $grants_from_groups = 0;
@@ -614,15 +618,15 @@
  // anonymous access implies read rights for everyone
  if (is_array($data) && $data['pm_access'] === 'anonym')
  {
- $rights |= EGW_ACL_READ;
+ $rights |= Acl::READ;
  }
  }
  // private project need either a private grant or a role ACL
- if (is_array($data) && $data['pm_access'] === 'private' && !($rights & EGW_ACL_PRIVATE) && !$data['pm_members'][$user]['role_acl'])
+ if (is_array($data) && $data['pm_access'] === 'private' && !($rights & Acl::PRIVAT) && !$data['pm_members'][$user]['role_acl'])
  {
  $access = false;
  }
- elseif ($required & EGW_ACL_READ)       // read-rights are implied by all other rights, but EGW_ACL_ADD_TIMESHEET
+ elseif ($required & Acl::READ)       // read-rights are implied by all other rights, but EGW_ACL_ADD_TIMESHEET
  {
  $access = (boolean) ($rights & ~EGW_ACL_ADD_TIMESHEET);
  }
@@ -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;
  }
- if (!$this->check_acl(EGW_ACL_READ))
+ if (!$this->check_acl(Acl::READ))
  {
  return false;
  }
@@ -705,7 +709,7 @@
  $titles[$project['pm_id']] = $this->link_title($project);
  }
  }
- // we assume all not returned projects are not readable by the user, as we notify egw_link about all deletes
+ // we assume all not returned projects are not readable by the user, as we notify Link about all deletes
  foreach($ids as $id)
  {
  if (!isset($titles[$id]))
@@ -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(egw_link::get_links('projectmanager',$pm_id,'projectmanager') as $link_id => $data)
+ 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)
- $link = egw_link::get_link($link_id);
+ $link = Link::get_link($link_id);
  if ($link['link_id1'] == $pm_id)
  {
  continue; // we are the parent in this link ==> ignore it
@@ -824,10 +828,10 @@
  $children_cache[$pm_id] = array();
 
  // read all projectmanager entries attached to this one
- foreach(egw_link::get_links('projectmanager',$pm_id,'projectmanager') as $link_id => $data)
+ 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)
- $link = egw_link::get_link($link_id);
+ $link = Link::get_link($link_id);
  if ($link['link_id1'] != $pm_id)
  {
  continue; // we are NOT the parent in this link ==> ignore it
@@ -923,7 +927,7 @@
  {
  if ($this->logfile && ($f = @fopen($this->logfile,'a+')))
  {
- fwrite($f,date('Y-m-d H:i:s: ').common::grab_owner_name($GLOBALS['egw_info']['user']['account_id'])."\n");
+ fwrite($f,date('Y-m-d H:i:s: ').Api\Accounts::username($GLOBALS['egw_info']['user']['account_id'])."\n");
  fwrite($f,$msg."\n\n");
  fclose($f);
  }
@@ -974,7 +978,7 @@
  }
  else
  {
- $prefs = new preferences($uid);
+ $prefs = new Api\Preferences($uid);
  $prefs->read_repository();
  $user_prefs =& $prefs->data['projectmanager'];
  unset($prefs);
@@ -1091,7 +1095,7 @@
 
  $data_backup = $this->data;
  }
- if (!$this->read((int) $source) || !$this->check_acl(EGW_ACL_READ))
+ 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;

Modified: trunk/projectmanager/inc/class.projectmanager_constraints_so.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/projectmanager/inc/class.projectmanager_constraints_so.inc.php?rev=56100&r1=56099&r2=56100&view=diff
==============================================================================
--- 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 @@
  * @version $Id$
  */
 
+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,
  // <start> Ends before <end>.

Modified: trunk/projectmanager/inc/class.projectmanager_datasource.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/projectmanager/inc/class.projectmanager_datasource.inc.php?rev=56100&r1=56099&r2=56100&view=diff
==============================================================================
--- 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 @@
  * @version $Id$
  */
 
+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;
 

Modified: trunk/projectmanager/inc/class.projectmanager_elements_bo.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/projectmanager/inc/class.projectmanager_elements_bo.inc.php?rev=56100&r1=56099&r2=56100&view=diff
==============================================================================
--- 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 @@
  * @version $Id$
  */
 
+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')
  {
- $link = egw_link::get_link($data['link_id']);
+ $link = Link::get_link($data['link_id']);
  if ($link['link_id2'] == $data['id'])
  {
  //error_log(__METHOD__."() --> ignoring notification to child");
@@ -248,7 +253,7 @@
  $this->data['pe_status']= 'new';
  }
  // if user linking has no ADD rights, the entry is set to ignored
- if (!$this->check_acl(EGW_ACL_ADD,array('pm_id'=>$pm_id)) && !
+ if (!$this->check_acl(Acl::ADD,array('pm_id'=>$pm_id)) && !
  ($this->check_acl(EGW_ACL_ADD_TIMESHEET, array('pm_id'=>$pm_id)) && $app == 'timesheet')
  )
  {
@@ -299,7 +304,7 @@
  */
  function update_cat($pe_ids, $cat_id)
  {
- if (!$this->check_acl(EGW_ACL_EDIT, array(
+ if (!$this->check_acl(Acl::EDIT, array(
  'pm_id' => $this->pm_id,
  'pe_id' => $pe_ids,
  )))
@@ -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']);
 
- if (!$pe_id && (!$pm_id || $required == EGW_ACL_DELETE))
+ if (!$pe_id && (!$pm_id || $required == Acl::DELETE))
  {
  return false;
  }
@@ -394,9 +399,9 @@
 
  $pm_id = $data['pm_id'];
  }
- if ($required == EGW_ACL_EDIT ||$required ==  EGW_ACL_DELETE)
- {
- $required = EGW_ACL_ADD; // edit or delete of elements is handled by the ADD right of the project
+ 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']);
- egw_link::update_remark($this->data['pe_id'],$this->data['pe_remark']);
+ Link::update_remark($this->data['pe_id'],$this->data['pe_remark']);
  }
  if ($keys) $this->data_merge($keys);
 
@@ -572,7 +577,7 @@
  if ($pe_id)
  {
  // delete one link
- egw_link::unlink($pe_id);
+ Link::unlink($pe_id);
  // update the project
  $this->project->update($pm_id);
 
@@ -581,7 +586,7 @@
  elseif ($pm_id)
  {
  // delete all links to project $pm_id
- egw_link::unlink(0,'projectmanager',$pm_id);
+ Link::unlink(0,'projectmanager',$pm_id);
  }
  return $ret;
  }
@@ -707,7 +712,7 @@
  {
  if ((int) $this->debug >= 3 || $this->debug == 'copytree') $this->debug_message("linking $element[pe_app]:$element[pe_app_id] $element[pe_title]");
  $app_id = $element['pe_app_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();
- foreach((array)$GLOBALS['egw']->hooks->process(array(
+ foreach((array)Api\Hooks::process(array(
  'location' => 'pm_cumulate',
  'pm_id' => $filter['pm_id'],
  )) as $app => $data)

Modified: trunk/projectmanager/inc/class.projectmanager_elements_so.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/projectmanager/inc/class.projectmanager_elements_so.inc.php?rev=56100&r1=56099&r2=56100&view=diff
==============================================================================
--- 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 @@
  * @version $Id$
  */
 
+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;
  /**
  * Join in the links 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))
  {
- $GLOBALS['egw']->categories = new categories();
+ $GLOBALS['egw']->categories = new Api\Categories();
  }
  $filter['cat_id'] = $GLOBALS['egw']->categories->return_all_children($filter['cat_id']);
  }
@@ -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)

Modified: trunk/projectmanager/inc/class.projectmanager_elements_ui.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/projectmanager/inc/class.projectmanager_elements_ui.inc.php?rev=56100&r1=56099&r2=56100&view=diff
==============================================================================
--- 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 @@
  * @version $Id$
  */
 
+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()
  {
- $this->tpl = new etemplate_new();
+ $this->tpl = new Etemplate();
 
  if ((int) $_REQUEST['pm_id'])
  {
@@ -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);
 
- $view = $content['view'] && !($content['edit'] && $this->check_acl(EGW_ACL_EDIT));
+ $view = $content['view'] && !($content['edit'] && $this->check_acl(Acl::EDIT));
 
  if (($content['save'] || $content['apply'] ||
- $content['pe_constraints']['delete'] || $content['new_constraint']['add_button']) && $this->check_acl(EGW_ACL_EDIT))
+ $content['pe_constraints']['delete'] || $content['new_constraint']['add_button']) && $this->check_acl(Acl::EDIT))
  {
  if ($update_necessary || $save_necessary)
  {
@@ -256,7 +264,7 @@
  {
  $msg = lang('Project-Element saved');
 
- egw_framework::refresh_opener($msg,'projectmanager',$content['pe_id'], 'edit');
+ Framework::refresh_opener($msg,'projectmanager',$content['pe_id'], 'edit');
  }
  }
  else
@@ -267,8 +275,8 @@
 
  if ($content['save'] || $content['cancel'] || $content['delete'])
  {
- egw_framework::window_close();
- common::egw_exit();
+ Framework::window_close();
+ exit();
  }
  }
  else
@@ -289,14 +297,14 @@
  }
  if ($this->data['pe_id'])
  {
- if (!$this->check_acl(EGW_ACL_READ))
+ if (!$this->check_acl(Acl::READ))
  {
  $this->tpl->location(array(
  'menuaction' => 'projectmanager.projectmanager_elements_ui.index',
  'msg' => lang('Permission denied !!!'),
  ));
  }
- if (!$this->check_acl(EGW_ACL_EDIT)) $view = true;
+ if (!$this->check_acl(Acl::EDIT)) $view = true;
  }
 
  $datasource = $this->datasource($this->data['pe_app']);
@@ -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 config and for supported erole applications
+ // 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;
  }
- if(!$this->project->check_acl(EGW_ACL_READ, $this->pm_id))
+ if(!$this->project->check_acl(Acl::READ, $this->pm_id))
  {
  return 0;
  }
 
  // Check for filter change, need to get totals
- $session = egw_cache::getSession('projectmanager', 'projectelements_list');
+ $session = Api\Cache::getSession('projectmanager', 'projectelements_list');
  $get_totals = $query_in['start'] === 0 || ($session && $session['filter'] != $query_in['filter']) || !$session && $query_in['filter'];
  $query=$query_in;
  unset($query_in['col_filter']['parent_id']);
- $GLOBALS['egw']->session->appsession('projectelements_list','projectmanager',$query_in);
+ 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)
  {
- if ($n && !$this->check_acl(EGW_ACL_EDIT,$row))
+ if ($n && !$this->check_acl(Acl::EDIT,$row))
  {
  $row['class'] .= ' rowNoEdit';
  }
- if ($n && !$this->check_acl(EGW_ACL_DELETE,$row))
+ if ($n && !$this->check_acl(Acl::DELETE,$row))
  {
  $row['class'] .= ' rowNoDelete';
  }
@@ -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') &&
- ($show_links == 'all' || ($show_links == 'links') === ($link['app'] != egw_link::VFS_APPNAME)))
+ ($show_links == 'all' || ($show_links == 'links') === ($link['app'] != Link::VFS_APPNAME)))
  {
  $row['pe_links'][] = $link;
  }
@@ -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';
- $custom_app_icons = $GLOBALS['egw']->hooks->process($custom_app_icons);
+ $custom_app_icons = Api\Hooks::process($custom_app_icons);
  foreach($rows as $n => &$row)
  {
  $app_info = $custom_app_icons[$row['pe_app']][$row['pe_app_id']];
@@ -777,7 +785,7 @@
  'hint' => 'necessary for project-elements doing that not automatic',
  'group' => ++$group,
  ),
- 'cat' => etemplate_widget_nextmatch::category_action(
+ '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
- $app_list = egw_link::app_list('add');
+ $app_list = Link::app_list('add');
  // Bookmarks doesn't support link via URL this way
  unset($app_list['bookmarks']);
  $actions['add']['children'] = array();
@@ -912,7 +920,7 @@
  $this->action($content['nm']['action'], $content['nm']['selected'], $msg, $content['add_existing_popup']);
  }
  $content = array(
- 'nm' => $GLOBALS['egw']->session->appsession('projectelements_list','projectmanager'),
+ '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
- if ($this->project->check_acl(EGW_ACL_ADD))
+ if ($this->project->check_acl(Acl::ADD))
  {
  if(!$this->config['enable_eroles'])
  {
@@ -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();
 
- if (!is_array($actions = egw_session::appsession('document_actions','projectmanager')))
+ if (!is_array($actions = Api\Cache::getSession('projectmanager', 'document_actions')))
  {
  $actions = array();
- if (($files = egw_vfs::find($this->prefs['document_dir'],array('need_mime'=>true),true)))
+ if (($files = Vfs::find($this->prefs['document_dir'],array('need_mime'=>true),true)))
  {
  foreach($files as $file)
  {
@@ -1023,7 +1031,7 @@
  $actions['document-'.$file['name']] = $file['name'];
  }
  }
- egw_session::appsession('document_actions','projectmanager',$actions);
+ Api\Cache::setSession('projectmanager', 'document_actions', $actions);
  }
  return $actions;
  }
@@ -1086,12 +1094,12 @@
  {
  break;
  }
- $title = egw_link::title($app, $link_id);
+ $title = Link::title($app, $link_id);
 
  if($btn['add'])
  {
  $action_msg = lang('linked to %1', $title);
- if(egw_link::link('projectmanager', $this->pm_id, $app, $link_id))
+ if(Link::link('projectmanager', $this->pm_id, $app, $link_id))
  {
  $success++;
  }
@@ -1103,7 +1111,7 @@
  return $failed == 0;
 
  case 'cat':
- if (!$this->project->check_acl(EGW_ACL_ADD) ||
+ if (!$this->project->check_acl(Acl::ADD) ||
  ($num = $this->update_cat($checked, $cat_id)) === false)
  {
  $msg = lang('Permission denied !!!');
@@ -1156,7 +1164,7 @@
  return $failed==0;
  break;
  case 'delete':
- if (!$this->project->check_acl(EGW_ACL_ADD))
+ if (!$this->project->check_acl(Acl::ADD))
  {
  $msg = lang('Permission denied !!!');
  }
@@ -1169,7 +1177,7 @@
  break;
 
  case 'sync_all': // does NOT use id's
- if ($this->project->check_acl(EGW_ACL_ADD))
+ if ($this->project->check_acl(Acl::ADD))
  {
  $msg = lang('%1 element(s) updated',$this->sync_all());
  return true;
@@ -1187,7 +1195,7 @@
  if(count($checked) == 0)
  {
  // Use all, from merge selectbox in side menu
- $query = $old_query = $GLOBALS['egw']->session->appsession('projectelements_list','projectmanager');
+ $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
- $GLOBALS['egw']->session->appsession('projectelements_list','projectmanager', $old_query);
+ 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 &&
- !bo_merge::is_export_limit_excepted() && count($ids['elements']) > (int)$document_merge->export_limit)
+ !Api\Storage\Merge::is_export_limit_excepted() && count($ids['elements']) > (int)$document_merge->export_limit)
  {
  return lang('No rights to export more then %1 entries!',(int)$document_merge->export_limit);
  }

Modified: trunk/projectmanager/inc/class.projectmanager_eroles_bo.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/projectmanager/inc/class.projectmanager_eroles_bo.inc.php?rev=56100&r1=56099&r2=56100&view=diff
==============================================================================
--- 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']))
  {
- if($etemplate_request = etemplate_request::read($_REQUEST['etemplate_exec_id']))
+ if($etemplate_request = Etemplate\Request::read($_REQUEST['etemplate_exec_id']))
  {
  $this->pm_id = $etemplate_request->content['pm_id'];
  }
@@ -83,7 +86,7 @@
  elseif(isset($_REQUEST['etemplate_exec_id']))
  {
  if(is_object($etemplate_request) ||
- ($etemplate_request = etemplate_request::read($_REQUEST['etemplate_exec_id'])))
+ ($etemplate_request = Etemplate\Request::read($_REQUEST['etemplate_exec_id'])))
  {
  $this->pe_id = $etemplate_request->content['pe_id'];
  }
@@ -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 so_sql only uses it, if != '', but 0 == ''!
+ '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'];
 

Modified: trunk/projectmanager/inc/class.projectmanager_eroles_so.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/projectmanager/inc/class.projectmanager_eroles_so.inc.php?rev=56100&r1=56099&r2=56100&view=diff
==============================================================================
--- 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

Modified: trunk/projectmanager/inc/class.projectmanager_eroles_ui.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/projectmanager/inc/class.projectmanager_eroles_ui.inc.php?rev=56100&r1=56099&r2=56100&view=diff
==============================================================================
--- 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)
  {
- $tpl = new etemplate_new('projectmanager.eroles');
+ $tpl = new Etemplate('projectmanager.eroles');
 
  $pm_id = is_array($content) ? $content['pm_id'] : (int) $_REQUEST['pm_id'];
 
@@ -98,7 +103,7 @@
  $msg = lang('Element role saved');
 
 
- if ($content['save']) egw_framework::window_close();
+ if ($content['save']) Framework::window_close();
  }
  else
  {

Modified: trunk/projectmanager/inc/class.projectmanager_export_elements_csv.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/projectmanager/inc/class.projectmanager_export_elements_csv.inc.php?rev=56100&r1=56099&r2=56100&view=diff
==============================================================================
--- 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 @@
  * @version $Id$
  */
 
+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 = $GLOBALS['egw']->session->appsession('projectelements_list','projectmanager');
+ $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 = $GLOBALS['egw']->session->appsession('project_list','projectmanager');
+ $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
- $GLOBALS['egw']->session->appsession('project_list','projectmanager', $old_p_query);
+ Api\Cache::setSession('projectmanager', 'project_list', $old_p_query);
  $query['col_filter']['pm_id'] = array();
  if($count)
  {
@@ -87,11 +90,11 @@
 
  // Reset nm params
  unset($query['num_rows']);
- $GLOBALS['egw']->session->appsession('projectelements_list','projectmanager', $old_query);
+ Api\Cache::setSession('projectmanager', 'projectelements_list', $old_query);
  }
  elseif ( $options['selection'] == 'all' )
  {
- $_query = $GLOBALS['egw']->session->appsession('projectelements_list','projectmanager');
+ $_query = Api\Cache::getSession('projectmanager', 'projectelements_list');
  // Clear the PM ID or results will be restricted
  unset($ui->pm_id);
 
@@ -101,7 +104,7 @@
  'col_filter' => array('pm_id' => true)
  );
  $ui->get_rows($query,$selection,$readonlys);
- $GLOBALS['egw']->session->appsession('projectelements_list','projectmanager', $_query);
+ Api\Cache::setSession('projectmanager', 'projectelements_list', $_query);
  }
  elseif ($options['selection'] == 'filter')
  {
@@ -134,15 +137,15 @@
  }
  else
  {
- $_query = $GLOBALS['egw']->session->appsession('projectelements_list','projectmanager');
+ $_query = Api\Cache::getSession('projectmanager', 'projectelements_list');
  $query = array(
  'num_rows' => -1,
  'col_filter' => array('pm_id' => $options['pm_id']),
  'csv_export' => true, // so get_rows method _can_ produce different content or not store state in the session
  );
  $ui->get_rows($query,$selection,$readonlys);
- $GLOBALS['egw']->session->appsession('projectelements_list','projectmanager', $_query);
- $this->project_name = egw_link::title('projectmanager', $options['pm_id']);
+ Api\Cache::setSession('projectmanager', 'projectelements_list', $_query);
+ $this->project_name = Link::title('projectmanager', $options['pm_id']);
  }
  if($no_project)
  {
@@ -160,7 +163,7 @@
  if(is_array($record['pe_resources'])) {
  $resources = array();
  foreach($record['pe_resources'] as $resource) {
- $resources[] = common::grab_owner_name($resource);
+ $resources[] = Api\Accounts::username($resource);
  }
  $record['pe_resources'] = implode(',', $resources);
  }
@@ -228,7 +231,7 @@
  }
 
  /**
- * return html for options.
+ * return Api\Html for options.
  * this way the plugin has all opportunities for options tab
  *
  */

Modified: trunk/projectmanager/inc/class.projectmanager_export_projects_csv.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/projectmanager/inc/class.projectmanager_export_projects_csv.inc.php?rev=56100&r1=56099&r2=56100&view=diff
==============================================================================
--- trunk/projectmanager/inc/class.projectmanager_export_projects_csv.inc.php (original)
+++ trunk/projectmanager/inc/class.projectmanager_export_projects_csv.inc.php Tue May 10 00:05:39 2016
@@ -11,6 +11,9 @@
  * @version $Id$
  */
 
+use EGroupware\Api;
+use EGroupware\Api\Link;
+
 /**
  * export projects to CSV
  */
@@ -60,7 +63,7 @@
  if ($options['selection'] == 'selected')
  {
  // Use search results
- $old_query = $GLOBALS['egw']->session->appsession($list,'projectmanager');
+ $old_query = Api\Cache::getSession('projectmanager', $list);
  $query = array_merge($old_query, $query);
  $query['num_rows'] = -1; // all
  $query['csv_export'] = true; // so get_rows method _can_ produce different content or not store state in the session
@@ -68,11 +71,11 @@
 
  // Reset nm params
  unset($query['num_rows']);
- $GLOBALS['egw']->session->appsession($list,'projectmanager', $old_query);
+ Api\Cache::setSession('projectmanager', $list, $old_query);
  }
  elseif ( $options['selection'] == 'all' )
  {
- $_query = $GLOBALS['egw']->session->appsession($list,'projectmanager');
+ $_query = Api\Cache::getSession('projectmanager', $list);
  $query = array(
  'filter2' => $list == 'project_list' ? 'active' : '0' ,
  'col_filter' => $list == 'project_list' ? array() : array('pm_id' => $pm_id),
@@ -82,7 +85,7 @@
  $ui->get_rows($query,$selection,$readonlys);
 
  // Reset nm params
- $GLOBALS['egw']->session->appsession($list,'projectmanager', $_query);
+ Api\Cache::setSession('projectmanager', $list, $_query);
  }
  elseif ($options['selection'] == 'filter')
  {
@@ -250,7 +253,7 @@
  $pm_id = $GLOBALS['egw_info']['user']['preferences']['projectmanager']['current_project'];
  if($pm_id)
  {
- $project_title = egw_link::title('projectmanager', $pm_id);
+ $project_title = Link::title('projectmanager', $pm_id);
  }
  return array(
  'name' => 'projectmanager.export_csv_selectors',

Modified: trunk/projectmanager/inc/class.projectmanager_gantt.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/projectmanager/inc/class.projectmanager_gantt.inc.php?rev=56100&r1=56099&r2=56100&view=diff
==============================================================================
--- trunk/projectmanager/inc/class.projectmanager_gantt.inc.php (original)
+++ trunk/projectmanager/inc/class.projectmanager_gantt.inc.php Tue May 10 00:05:39 2016
@@ -9,6 +9,12 @@
  * @version $Id$
  */
 
+use EGroupware\Api;
+use EGroupware\Api\Link;
+use EGroupware\Api\Framework;
+use EGroupware\Api\Acl;
+use EGroupware\Api\Etemplate;
+
 class projectmanager_gantt extends projectmanager_elements_ui {
 
  public $public_functions = array(
@@ -53,13 +59,13 @@
  $result = $this->action($data['gantt']['action'], $data['gantt']['selected'], $msg, $add_existing);
  if($msg)
  {
- egw_framework::message($msg, $result ? 'success' : 'error');
+ Framework::message($msg, $result ? 'success' : 'error');
  }
  }
  if ($data['sync_all'])
  {
  $this->project = new projectmanager_bo($pm_id);
- if($this->project->check_acl(EGW_ACL_ADD))
+ if($this->project->check_acl(Acl::ADD))
  {
  $data['msg'] = lang('%1 element(s) updated',$this->sync_all());
  }
@@ -75,17 +81,17 @@
  $GLOBALS['egw']->preferences->save_repository(false,'user',false);
 
  // Save filters in session per project
- $result = egw_cache::setSession('projectmanager', 'gantt_'.$pm_id[0], $data['gantt']);
+ $result = Api\Cache::setSession('projectmanager', 'gantt_'.$pm_id[0], $data['gantt']);
  }
  else
  {
  $data = array(
  'planned_times' => $GLOBALS['egw_info']['user']['preferences']['projectmanager']['gantt_planned_times'],
  'constraints' => $GLOBALS['egw_info']['user']['preferences']['projectmanager']['gantt_constraints'],
- 'gantt' => (array)egw_cache::getSession('projectmanager', 'gantt_'.$pm_id[0])
+ 'gantt' => (array)Api\Cache::getSession('projectmanager', 'gantt_'.$pm_id[0])
  );
  }
- egw_framework::includeCSS('projectmanager','gantt');
+ Framework::includeCSS('projectmanager','gantt');
  $GLOBALS['egw_info']['flags']['app_header'] = '';
 
  // Yes, we want the link registry
@@ -114,7 +120,7 @@
  'done'    => lang('Done (100%)'),
  ),
  );
- $template = new etemplate_new();
+ $template = new Etemplate();
  $template->read('projectmanager.gantt');
 
  $template->setElementAttribute('gantt','actions', $this->get_gantt_actions());
@@ -178,7 +184,7 @@
  * can be specified to indicate desired width, start hidden, and to try
  * to use the specified et2_widget to render the value.
  *
- * @see http://docs.dhtmlx.com/gantt/api__gantt_columns_config.html
+ * @see http://docs.dhtmlx.com/gantt/api__gantt_columns_config.Api\Html
  *
  * @return array
  */
@@ -305,28 +311,28 @@
  }
  $projects[] = $bo->add_project($data, $pm_id, $params);
  }
- $response = egw_json_response::get();
+ $response = Api\Json\Response::get();
  $response->data($data);
  }
 
  // Get the data into required format
  protected function &add_project(&$data, $pm_id, $params) {
- if(!$pm_id || !$this->project->check_acl(EGW_ACL_READ, $pm_id))
+ if(!$pm_id || !$this->project->check_acl(Acl::READ, $pm_id))
  {
  return array();
  }
  if ($pm_id != $this->project->data['pm_id'])
  {
- if (!$this->project->read($pm_id) || !$this->project->check_acl(EGW_ACL_READ))
+ if (!$this->project->read($pm_id) || !$this->project->check_acl(Acl::READ))
  {
  return array();
  }
  }
  $project = $this->project->data + array(
  'id' => 'projectmanager::'.$this->project->data['pm_id'],
- 'text' => $this->prefs['gantt_element_title_length'] ? substr(egw_link::title('projectmanager', $this->project->data['pm_id']), 0, $this->prefs['gantt_element_title_length']) : egw_link::title('projectmanager', $this->project->data['pm_id']),
- 'edit' => $this->project->check_acl(EGW_ACL_EDIT),
- 'start_date' => egw_time::to($params['planned_times'] ? $this->project->data['pm_planned_start'] : $this->project->data['pm_real_start'],egw_time::DATABASE),
+ 'text' => $this->prefs['gantt_element_title_length'] ? substr(Link::title('projectmanager', $this->project->data['pm_id']), 0, $this->prefs['gantt_element_title_length']) : Link::title('projectmanager', $this->project->data['pm_id']),
+ 'edit' => $this->project->check_acl(Acl::EDIT),
+ 'start_date' => Api\DateTime::to($params['planned_times'] ? $this->project->data['pm_planned_start'] : $this->project->data['pm_real_start'],Api\DateTime::DATABASE),
  'open' => $params['level'] < $params['depth'],
  'progress' => ((int)substr($this->project->data['pm_completion'],0,-1))/100,
  'parent' => $params['parent'] && $params['parent'] != $this->project->data['pm_id'] ? 'projectmanager::'.$params['parent'] : 0
@@ -344,7 +350,7 @@
  // Avoid a 0 length project, that causes display and control problems
  // Add 1 day - 1 second to go from 0:00 to 23:59
  if($end == $start) strtotime('+1 day', $end)-1;
- $project['end_date'] = egw_time::to($end,egw_time::DATABASE);
+ $project['end_date'] = Api\DateTime::to($end,Api\DateTime::DATABASE);
  }
  else
  {
@@ -353,13 +359,13 @@
  // Add in planned start & end, if different
  if(!$params['planned_times'])
  {
- if($project['pm_planned_start'] && $project['pm_planned_start'] != egw_time::to($project['start_date'],egw_time::DATABASE))
- {
- $project['planned_start'] = egw_time::to((int)$project['pm_planned_start'], egw_time::DATABASE);
+ if($project['pm_planned_start'] && $project['pm_planned_start'] != Api\DateTime::to($project['start_date'],Api\DateTime::DATABASE))
+ {
+ $project['planned_start'] = Api\DateTime::to((int)$project['pm_planned_start'], Api\DateTime::DATABASE);
  }
  if($project['pm_planned_end'] && $project['pm_planned_end'] != $project['pm_real_end'])
  {
- $project['planned_end'] = egw_time::to((int)$project['pm_planned_end'], egw_time::DATABASE);
+ $project['planned_end'] = Api\DateTime::to((int)$project['pm_planned_end'], Api\DateTime::DATABASE);
  }
  }
 
@@ -368,7 +374,7 @@
 
  if(is_array($project['pm_members'])) {
  foreach($project['pm_members'] as $uid => &$member_data) {
- $member_data['name'] = common::grab_owner_name($member_data['member_uid']);
+ $member_data['name'] = Api\Accounts::username($member_data['member_uid']);
  }
  }
  $data['data'][] =& $project;
@@ -397,8 +403,8 @@
  'ms_id' => $milestone['ms_id'],
  'text' => $milestone['ms_title'],
  'parent' => 'projectmanager::'.$pm_id,
- 'edit' => $this->project->check_acl(EGW_ACL_EDIT),
- 'start_date' => egw_time::to($milestone['ms_date'],egw_time::DATABASE),
+ 'edit' => $this->project->check_acl(Acl::EDIT),
+ 'start_date' => Api\DateTime::to($milestone['ms_date'],Api\DateTime::DATABASE),
  'type' => 'milestone',
  'pe_icon' => 'projectmanager/milestone'
  );
@@ -504,25 +510,25 @@
  $pe['id'] = $pe['pe_app'].':'.$pe['pe_app_id'].':'.$pe['pe_id'];
  $pe['text'] = $this->prefs['gantt_element_title_length'] ? substr($pe['pe_title'], 0, $this->prefs['gantt_element_title_length']) : $pe['pe_title'];
  $pe['parent'] = 'projectmanager::'.$pm_id;
- $pe['start_date'] = egw_time::to((int)$pe['pe_start'],egw_time::DATABASE);
+ $pe['start_date'] = Api\DateTime::to((int)$pe['pe_start'],Api\DateTime::DATABASE);
  if($pe['pe_planned_start'] && $pe['pe_planned_start'] != $pe['pe_start'])
  {
- $pe['start_date'] = egw_time::to($pe['pe_real_start'], egw_time::DATABASE);
- $pe['planned_start'] = egw_time::to((int)$pe['pe_planned_start'], egw_time::DATABASE);
+ $pe['start_date'] = Api\DateTime::to($pe['pe_real_start'], Api\DateTime::DATABASE);
+ $pe['planned_start'] = Api\DateTime::to((int)$pe['pe_planned_start'], Api\DateTime::DATABASE);
  }
  $pe['duration'] = self::get_duration($data,(float)($params['planned_times'] ? $pe['pe_planned_time'] : $pe['pe_used_time']));
  if($pe['pe_end'])
  {
  // Make sure we don't kill the gantt chart with too large a time span - limit to 10 years
- $pe['end_date'] = egw_time::to(min($pe['pe_end'],strtotime('+10 years',$pe['pe_start'])),egw_time::DATABASE );
+ $pe['end_date'] = Api\DateTime::to(min($pe['pe_end'],strtotime('+10 years',$pe['pe_start'])),Api\DateTime::DATABASE );
  }
  if($pe['pe_planned_end'] && $pe['pe_planned_end'] != $pe['pe_end'])
  {
- $pe['end_date'] = egw_time::to($pe['pe_real_end'], egw_time::DATABASE);
- $pe['planned_end'] = egw_time::to((int)$pe['pe_planned_end'], egw_time::DATABASE);
+ $pe['end_date'] = Api\DateTime::to($pe['pe_real_end'], Api\DateTime::DATABASE);
+ $pe['planned_end'] = Api\DateTime::to((int)$pe['pe_planned_end'], Api\DateTime::DATABASE);
  }
  $pe['progress'] = ((int)substr($pe['pe_completion'],0,-1))/100;
- $pe['edit'] = $this->check_acl(EGW_ACL_EDIT, $pe);
+ $pe['edit'] = $this->check_acl(Acl::EDIT, $pe);
 
  // Set field for filter to filter on
  $pe['filter'] = $pe['pe_completion'] > 0 ? ($pe['pe_completion'] != 100 ? 'ongoing' : 'done') : 'not';
@@ -610,7 +616,7 @@
  // Don't change timesheets
  if($values['pe_app'] == 'timesheet')
  {
- egw_json_response::get()->call('egw.message',lang('Editing timesheets is not supported, edit the entry directly'), 'error');
+ Api\Json\Response::get()->call('egw.message',lang('Editing timesheets is not supported, edit the entry directly'), 'error');
  return;
  }
  if(class_exists('stylite_projectmanager_gantt') && $params['datasource_update'])
@@ -623,7 +629,7 @@
  // Only tell them once
  $GLOBALS['egw']->preferences->add('projectmanager','skip_stylite_warning', true);
  $GLOBALS['egw']->preferences->save_repository();
- egw_json_response::get()->apply('egw.message', Array(lang('Direct update from Gantt chart requires <a href="http://www.egroupware.org/products">Stylite EGroupware Enterprise Line (EPL)</a>.'
+ Api\Json\Response::get()->apply('egw.message', Array(lang('Direct update from Gantt chart requires <a href="http://www.egroupware.org/products">Stylite EGroupware Enterprise Line (EPL)</a>.'
  . '<br />Project elements will be updated but the associated datasource will not.'),'info'));
  }
 
@@ -649,11 +655,11 @@
  }
  if(array_key_exists('start_date', $values))
  {
- $keys['pe_' . ($params['planned_times'] ? 'planned' : 'real') . '_start'] = egw_time::to($values['start_date'],'ts');
+ $keys['pe_' . ($params['planned_times'] ? 'planned' : 'real') . '_start'] = Api\DateTime::to($values['start_date'],'ts');
  }
  if(array_key_exists('end_date', $values))
  {
- $keys['pe_' . ($params['planned_times'] ? 'planned' : 'real') . '_end'] = egw_time::to($values['end_date'],'ts');
+ $keys['pe_' . ($params['planned_times'] ? 'planned' : 'real') . '_end'] = Api\DateTime::to($values['end_date'],'ts');
  }
  if($keys)
  {
@@ -665,7 +671,7 @@
  // Update milestone
  $pe_bo = new projectmanager_elements_bo((int)$values['pm_id']);
  $milestone = $pe_bo->milestones->read((int)$values['ms_id']);
- $pe_bo->milestones->save(array('ms_date' => egw_time::to($values['start_date'],'ts')));
+ $pe_bo->milestones->save(array('ms_date' => Api\DateTime::to($values['start_date'],'ts')));
  }
  else if ($values['pm_id'])
  {
@@ -674,11 +680,11 @@
  $keys['pm_completion'] = (int)($values['progress'] * 100).'%';
  if(array_key_exists('start_date', $values))
  {
- $keys['pm_' . ($params['planned_times'] ? 'planned' : 'real') . '_start'] = egw_time::to($values['start_date'],'ts');
+ $keys['pm_' . ($params['planned_times'] ? 'planned' : 'real') . '_start'] = Api\DateTime::to($values['start_date'],'ts');
  }
  if(array_key_exists('end_date', $values))
  {
- $keys['pm_' . ($params['planned_times'] ? 'planned' : 'real') . '_end'] = egw_time::to($values['end_date'],'ts');
+ $keys['pm_' . ($params['planned_times'] ? 'planned' : 'real') . '_end'] = Api\DateTime::to($values['end_date'],'ts');
  }
  if($keys)
  {
@@ -706,7 +712,7 @@
  $pe_bo->constraints->save($keys);
 
  // Return the new key so we can tell new from old
- egw_json_response::get()->data($keys['pm_id'] . ':'.$values['source'].':'.$values['target']);
+ Api\Json\Response::get()->data($keys['pm_id'] . ':'.$values['source'].':'.$values['target']);
  }
  else if ($values['id'])
  {
@@ -726,8 +732,8 @@
  */
  protected static function get_duration_unit($task)
  {
- $start = new egw_time($task['start_date']);
- $end = new egw_time($task['end_date']);
+ $start = new Api\DateTime($task['start_date']);
+ $end = new Api\DateTime($task['end_date']);
  $diff = $start->diff($end);
 
  // Determine a good unit.

Modified: trunk/projectmanager/inc/class.projectmanager_hooks.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/projectmanager/inc/class.projectmanager_hooks.inc.php?rev=56100&r1=56099&r2=56100&view=diff
==============================================================================
--- trunk/projectmanager/inc/class.projectmanager_hooks.inc.php (original)
+++ trunk/projectmanager/inc/class.projectmanager_hooks.inc.php Tue May 10 00:05:39 2016
@@ -9,6 +9,12 @@
  * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
  * @version $Id$
  */
+
+use EGroupware\Api;
+use EGroupware\Api\Link;
+use EGroupware\Api\Framework;
+use EGroupware\Api\Egw;
+use EGroupware\Api\Acl;
 
 /**
  * diverse hooks for ProjectManager: all static functions
@@ -33,7 +39,7 @@
  */
  public static function init_static()
  {
- self::$config = config::read('projectmanager');
+ self::$config = Api\Config::read('projectmanager');
  }
 
  /**
@@ -125,7 +131,7 @@
  if ($location == 'sidebox_menu')
  {
  // Magic etemplate2 favorites menu (from nextmatch widget)
- display_sidebox($appname, lang('Favorites'), egw_framework::favorite_list($appname, 'nextmatch-projectmanager.list.rows-favorite'));
+ display_sidebox($appname, lang('Favorites'), Framework\Favorites::list_favorites($appname, 'nextmatch-projectmanager.list.rows-favorite'));
 
  // project-dropdown in sidebox menu
  if (!is_object($GLOBALS['projectmanager_bo']))
@@ -148,24 +154,24 @@
  $pm_id = (int) $GLOBALS['egw_info']['preferences']['projectmanager']['current_project'];
  }
  $file = array(
- 'Projectlist' => egw::link('/index.php',array(
+ 'Projectlist' => Egw::link('/index.php',array(
  'menuaction' => 'projectmanager.projectmanager_ui.index',
  'ajax' => 'true',
  ))
  );
- if($GLOBALS['projectmanager_bo']->check_acl(EGW_ACL_READ))
+ if($GLOBALS['projectmanager_bo']->check_acl(Acl::READ))
  {
  $file += array(
  array(
  'text' => 'Elementlist',
- 'link' =>  egw::link('/index.php',array(
+ 'link' =>  Egw::link('/index.php',array(
  'menuaction' => 'projectmanager.projectmanager_ui.index',
  'ajax' => 'true',
  )),
  ),
  array(
  'text' => 'Gantt chart',
- 'link' =>  egw::link('/index.php',array(
+ 'link' =>  Egw::link('/index.php',array(
  'menuaction' => 'projectmanager.projectmanager_ui.index',
  'ajax' => 'true',
  )),
@@ -176,13 +182,13 @@
  if (!self::$config['accounting_types'] || in_array('pricelist',(is_array(self::$config['accounting_types'])?self::$config['accounting_types']:explode(',',self::$config['accounting_types']))))
  {
  // menuitem links to project-spezific priclist only if user has rights and it is used
- // to not always instanciate the priclist class, this code dublicats bopricelist::check_acl(EGW_ACL_READ),
+ // to not always instanciate the priclist class, this code dublicats bopricelist::check_acl(Acl::READ),
  // specialy the always existing READ right for the general pricelist!!!
  $file[] = array(
  'text' => 'Pricelist',
  'icon' => 'pricelist',
  'app'  => 'projectmanager',
- 'link' =>  egw::link('/index.php',array(
+ 'link' =>  Egw::link('/index.php',array(
  'menuaction' => 'projectmanager.projectmanager_ui.index',
  'ajax' => 'true',
  ))
@@ -194,7 +200,7 @@
  'text' => 'Filemanager',
  'icon' => 'navbar',
  'app'  => 'filemanager',
- 'link' => egw::link('/index.php',array(
+ 'link' => Egw::link('/index.php',array(
  'menuaction' => 'filemanager.filemanager_ui.index',
  'ajax'       => 'true',
  ),'filemanager'),
@@ -209,7 +215,7 @@
  'icon' => false
  );
 
- $file['Placeholders'] = egw::link('/index.php','menuaction=projectmanager.projectmanager_merge.show_replacements');
+ $file['Placeholders'] = Egw::link('/index.php','menuaction=projectmanager.projectmanager_merge.show_replacements');
  display_sidebox($appname,$GLOBALS['egw_info']['apps'][$appname]['title'].' '.lang('Menu'),$file);
 
  // allways show sidebox
@@ -219,9 +225,9 @@
  if ($GLOBALS['egw_info']['user']['apps']['admin'])
  {
  $file = Array(
- 'Site configuration' => egw::link('/index.php','menuaction=projectmanager.projectmanager_admin.config'),
- 'Custom fields' => egw::link('/index.php','menuaction=admin.customfields.index&appname=projectmanager&use_private=1'),
- 'Global Categories'  => egw::link('/index.php',array(
+ 'Site configuration' => Egw::link('/index.php','menuaction=projectmanager.projectmanager_admin.config'),
+ 'Custom fields' => Egw::link('/index.php','menuaction=admin.customfields.index&appname=projectmanager&use_private=1'),
+ 'Global Categories'  => Egw::link('/index.php',array(
  'menuaction' => 'admin.admin_categories.index',
  'appname'    => $appname,
  'global_cats'=> True)),
@@ -279,9 +285,9 @@
  {
  return null;
  }
- $tree = html::tree($projects,$selected_project,false,'load_project');
+ $tree = Api\Html::tree($projects,$selected_project,false,'load_project');
  // hack for stupid ie (cant set it as a class!)
- //if (html::$user_agent == 'msie') $tree = str_replace('id="foldertree"','id="foldertree" style="overflow: auto; width: 198px;"',$tree);
+ //if (Api\Header\UserAgent::type() == 'msie') $tree = str_replace('id="foldertree"','id="foldertree" style="overflow: auto; width: 198px;"',$tree);
  // do it all the time, as we want distinct behavior here
  $tree = str_replace('id="foldertree"','id="foldertree" style="overflow: auto; max-width:400px; width:100%; max-height:450px;"',$tree);
  return array(
@@ -321,8 +327,8 @@
  $projects[0] = lang('Select a project');
  }
  return array(
- 'text' => html::select('pm_id',$pm_id,$projects,true,' style="width: 100%;"'.
- ' onchange="egw_appWindow(\'projectmanager\').location.href=\''.$select_link.'\'+this.value;" title="'.html::htmlspecialchars(
+ 'text' => Api\Html::select('pm_id',$pm_id,$projects,true,' style="width: 100%;"'.
+ ' onchange="egw_appWindow(\'projectmanager\').location.href=\''.$select_link.'\'+this.value;" title="'.Api\Html::htmlspecialchars(
  $pm_id && isset($projects[$pm_id]) ? $projects[$pm_id] : lang('Select a project')).'"'),
  'no_lang' => True,
  'link' => False
@@ -336,7 +342,7 @@
  */
  static function settings()
  {
- $apps = egw_link::app_list('add_app');
+ $apps = Link::app_list('add_app');
  foreach (array('addressbook', 'bookmarks', 'tracker', 'resources') as $unset_app) // these apps never show as pe since they don't have end date
  {
  unset($apps[$unset_app]);
@@ -515,7 +521,7 @@
  'help'   => lang('If you specify a directory (full vfs path) here, %1 displays an action for each document. That action allows to download the specified document with the data inserted.',lang('projectmanager')).' '.
  lang('the document can contain placeholder like {{%1}}, to be replaced with the data.','pm_title').' '.
  lang('Furthermore addressbook elements in the projectmanager elements list can be selected to define individual recipients of a serial letter.').' '.
- lang('The following document-types are supported:'). implode(',',bo_merge::get_file_extensions()),
+ lang('The following document-types are supported:'). implode(',',Api\Storage\Merge::get_file_extensions()),
  'run_lang' => false,
  'xmlrpc' => True,
  'admin'  => False,
@@ -599,23 +605,23 @@
  /**
  * ACL rights and labels used
  *
- * @param string|array string with location or array with parameters incl. "location", specially "owner" for selected acl owner
+ * @param string|array string with location or array with parameters incl. "location", specially "owner" for selected Acl owner
  */
  public static function acl_rights($params)
  {
  return array(
- acl::READ    => 'read',
- acl::EDIT    => 'edit',
- acl::DELETE  => 'delete',
- acl::PRIVAT  => 'private',
- acl::ADD     => 'add element',
- acl::CUSTOM1 => 'budget',
- acl::CUSTOM2 => 'edit budget',
- );
- }
-
- /**
- * Hook to tell framework we use standard categories method
+ Acl::READ    => 'read',
+ Acl::EDIT    => 'edit',
+ Acl::DELETE  => 'delete',
+ Acl::PRIVAT  => 'private',
+ Acl::ADD     => 'add element',
+ Acl::CUSTOM1 => 'budget',
+ Acl::CUSTOM2 => 'edit budget',
+ );
+ }
+
+ /**
+ * Hook to tell framework we use standard Api\Categories method
  *
  * @param string|array $data hook-data or location
  * @return boolean

Modified: trunk/projectmanager/inc/class.projectmanager_import_projects_csv.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/projectmanager/inc/class.projectmanager_import_projects_csv.inc.php?rev=56100&r1=56099&r2=56100&view=diff
==============================================================================
--- trunk/projectmanager/inc/class.projectmanager_import_projects_csv.inc.php (original)
+++ trunk/projectmanager/inc/class.projectmanager_import_projects_csv.inc.php Tue May 10 00:05:39 2016
@@ -11,6 +11,8 @@
  * @version $Id$
  */
 
+use EGroupware\Api;
+use EGroupware\Api\Link;
 
 /**
  * class to import projects from CSV
@@ -227,13 +229,13 @@
  // Process parent, if present
  if($_data['parent'])
  {
- egw_link::link('projectmanager', $_data['parent'], 'projectmanager',$this->bo->data['pm_id'],'Linked by import');
+ Link::link('projectmanager', $_data['parent'], 'projectmanager',$this->bo->data['pm_id'],'Linked by import');
  }
  return true;
  }
  }
  default:
- throw new egw_exception('Unsupported action');
+ throw new Api\Exception('Unsupported action');
 
  }
  }
@@ -255,7 +257,7 @@
  $id = $record->get_identifier();
  if($id && (int)$record->parent)
  {
- $link_id = egw_link::link($this->definition->application,$id,'projectmanager',$record->parent);
+ $link_id = Link::link($this->definition->application,$id,'projectmanager',$record->parent);
  }
  }
 

Modified: trunk/projectmanager/inc/class.projectmanager_merge.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/projectmanager/inc/class.projectmanager_merge.inc.php?rev=56100&r1=56099&r2=56100&view=diff
==============================================================================
--- trunk/projectmanager/inc/class.projectmanager_merge.inc.php (original)
+++ trunk/projectmanager/inc/class.projectmanager_merge.inc.php Tue May 10 00:05:39 2016
@@ -12,10 +12,14 @@
  * @version $Id: class.projectmanager_merge.inc.php 30377 2010-09-27 19:35:10Z jaytraxx $
  */
 
+use EGroupware\Api;
+use EGroupware\Api\Link;
+use EGroupware\Api\Egw;
+
 /**
  * Projectmanager - document merge object
  */
-class projectmanager_merge extends bo_merge
+class projectmanager_merge extends Api\Storage\Merge
 {
  /**
  * Functions that can be called via menuaction
@@ -353,7 +357,7 @@
  $project = $record->get_record_array();
 
  // Set any missing custom fields, or the marker will stay
- $custom = config::get_customfields('projectmanager');
+ $custom = Api\Storage\Customfields::get('projectmanager');
  foreach($custom as $name => $field)
  {
  $this->projectmanager_fields['#'.$name] = $field['label'];
@@ -368,7 +372,7 @@
  $all_roles = array('Coordinator' => array());
  $all_roles += array_fill_keys($roles, array());
  foreach((Array)$project['pm_members'] as $account_id => $info) {
- $all_roles[$info['role_title']][] = common::grab_owner_name($info['member_uid']);
+ $all_roles[$info['role_title']][] = Api\Accounts::username($info['member_uid']);
  }
  foreach($all_roles as $name => $users) {
  $project[$name] = implode(', ', $users);
@@ -399,10 +403,10 @@
  case 'pm_real_start': case 'pm_real_end':
  case 'pe_planned_start_total': case 'pe_planned_end_total':
  case 'pe_real_start_total': case 'pe_real_end_total':
- if($value) $value = egw_time::to($value);
+ if($value) $value = Api\DateTime::to($value);
  break;
  case 'pm_creator': case 'pm_modifier':
- $value = common::grab_owner_name($value);
+ $value = Api\Accounts::username($value);
  break;
  case 'cat_id':
  if ($value)
@@ -465,10 +469,10 @@
  case 'pe_planned_start': case 'pe_planned_end':
  case 'pe_real_start': case 'pe_real_end':
  case 'pe_synced': case 'pe_modified':
- if($value) $value = egw_time::to($value);
+ if($value) $value = Api\DateTime::to($value);
  break;
  case 'pe_modifier':
- $value = common::grab_owner_name($value);
+ $value = Api\Accounts::username($value);
  break;
  case 'cat_id':
  if ($value)
@@ -490,7 +494,7 @@
  $names = array();
  foreach($value as $id => $user_id)
  {
- $names[] = common::grab_owner_name($user_id);
+ $names[] = Api\Accounts::username($user_id);
  }
  $value = implode(', ', $names);
  break;
@@ -505,11 +509,11 @@
  // Element links
  if(strpos($content, ($prefix ? $prefix.'/':'').'links') !== false)
  {
- $replacements['$$'.($prefix ? $prefix.'/':'').'links$$'] = $this->get_links($element['pe_app'], $element['pe_app_id'], '!'.egw_link::VFS_APPNAME);
+ $replacements['$$'.($prefix ? $prefix.'/':'').'links$$'] = $this->get_links($element['pe_app'], $element['pe_app_id'], '!'.Link::VFS_APPNAME);
  }
  if(strpos($content, ($prefix ? $prefix.'/':'').'attachments') !== false)
  {
- $replacements['$$'.($prefix ? $prefix.'/':'').'attachments$$'] = $this->get_links($element['pe_app'], $element['pe_app_id'], egw_link::VFS_APPNAME);
+ $replacements['$$'.($prefix ? $prefix.'/':'').'attachments$$'] = $this->get_links($element['pe_app'], $element['pe_app_id'], Link::VFS_APPNAME);
  }
  if(strpos($content, ($prefix ? $prefix.'/':'').'links_attachments') !== false)
  {
@@ -535,14 +539,14 @@
  }
 
  /**
- * Generate table with replacements for the preferences
+ * Generate table with replacements for the Api\Preferences
  *
  */
  public function show_replacements()
  {
  $GLOBALS['egw_info']['flags']['app_header'] = lang('Projectmanager').' - '.lang('Replacements for inserting project data into documents');
  $GLOBALS['egw_info']['flags']['nonavbar'] = false;
- common::egw_header();
+ $GLOBALS['egw']->framework->header();
 
  echo "<table width='90%' align='center'>\n";
 
@@ -563,7 +567,7 @@
 
  // Custom fields
  echo '<tr><td colspan="4"><h3>'.lang('Custom fields').":</h3></td></tr>";
- $custom = config::get_customfields('projectmanager');
+ $custom = Api\Storage\Customfields::get('projectmanager');
  foreach($custom as $name => $field)
  {
  echo '<tr><td>{{#'.$name.'}}</td><td colspan="3">'.$field['label']."</td></tr>\n";
@@ -605,9 +609,9 @@
  .'<ul>'
  .'<li><a href="#pe_fields">'.lang('Projectmanager element fields').'</a></li>';
  foreach(array(
- 'Addressbook fields' => egw::link('/index.php','menuaction=addressbook.addressbook_merge.show_replacements'),
- 'Calendar fields' => egw::link('/index.php','menuaction=calendar.calendar_merge.show_replacements'),
- 'Infolog fields' => egw::link('/index.php','menuaction=infolog.infolog_merge.show_replacements'),
+ 'Addressbook fields' => Egw::link('/index.php','menuaction=addressbook.addressbook_merge.show_replacements'),
+ 'Calendar fields' => Egw::link('/index.php','menuaction=calendar.calendar_merge.show_replacements'),
+ 'Infolog fields' => Egw::link('/index.php','menuaction=infolog.infolog_merge.show_replacements'),
  ) as $placeholder => $link)
  {
  echo '<li><a href="'.$link.'" target="_blank">'.lang($placeholder).'</a></li>';
@@ -655,9 +659,9 @@
  .'<ul>'
  .'<li><a href="#pe_fields">'.lang('Projectmanager element fields').'</a></li>';
  foreach(array(
- 'Addressbook fields' => egw::link('/index.php','menuaction=addressbook.addressbook_merge.show_replacements'),
- 'Calendar fields' => egw::link('/index.php','menuaction=calendar.calendar_merge.show_replacements'),
- 'Infolog fields' => egw::link('/index.php','menuaction=infolog.infolog_merge.show_replacements'),
+ 'Addressbook fields' => Egw::link('/index.php','menuaction=addressbook.addressbook_merge.show_replacements'),
+ 'Calendar fields' => Egw::link('/index.php','menuaction=calendar.calendar_merge.show_replacements'),
+ 'Infolog fields' => Egw::link('/index.php','menuaction=infolog.infolog_merge.show_replacements'),
  ) as $placeholder => $link)
  {
  echo '<li><a href="'.$link.'" target="_blank">'.lang($placeholder).'</a></li>';
@@ -671,7 +675,7 @@
  .'</tr>'."\n";
 
  // Serial letter
- $link = egw::link('/index.php','menuaction=addressbook.addressbook_merge.show_replacements');
+ $link = Egw::link('/index.php','menuaction=addressbook.addressbook_merge.show_replacements');
  echo '<tr><td colspan="4">'
  .'<h3>'.lang('Contact fields for serial letters').'</h3>'
  .lang('Addressbook elements of a project can be used to define individual serial letter recipients. Available fields are').':'
@@ -705,7 +709,7 @@
  }
 
  echo "</table>\n";
- common::egw_footer();
+ $GLOBALS['egw']->framework->footer();
  }
 
  /**
@@ -740,7 +744,7 @@
  else
  {
  $limit = array(0,-1);
- if($this->export_limit && !bo_merge::is_export_limit_excepted()) {
+ if($this->export_limit && !Api\Storage\Merge::is_export_limit_excepted()) {
  $limit = array(0,(int)$this->export_limit);
  // Need to do this to give an error
  $count = count($this->projectmanager_elements_bo->search($query));
@@ -751,7 +755,7 @@
  }
  }
  if($count && count($elements) < $count) {
- throw new egw_exception(lang('No rights to export more then %1 entries!',(int)$this->export_limit));
+ throw new Api\Exception(lang('No rights to export more then %1 entries!',(int)$this->export_limit));
  }
  }
 

Modified: trunk/projectmanager/inc/class.projectmanager_milestones_so.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/projectmanager/inc/class.projectmanager_milestones_so.inc.php?rev=56100&r1=56099&r2=56100&view=diff
==============================================================================
--- trunk/projectmanager/inc/class.projectmanager_milestones_so.inc.php (original)
+++ trunk/projectmanager/inc/class.projectmanager_milestones_so.inc.php Tue May 10 00:05:39 2016
@@ -10,12 +10,14 @@
  * @version $Id$
  */
 
+use EGroupware\Api;
+
 /**
  * Milestones storage object of the projectmanager
  *
  * Tables: egw_pm_milestones
  */
-class projectmanager_milestones_so extends so_sql
+class projectmanager_milestones_so extends Api\Storage\Base
 {
  /**
  * pm_id of current project

Modified: trunk/projectmanager/inc/class.projectmanager_milestones_ui.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/projectmanager/inc/class.projectmanager_milestones_ui.inc.php?rev=56100&r1=56099&r2=56100&view=diff
==============================================================================
--- trunk/projectmanager/inc/class.projectmanager_milestones_ui.inc.php (original)
+++ trunk/projectmanager/inc/class.projectmanager_milestones_ui.inc.php Tue May 10 00:05:39 2016
@@ -9,6 +9,12 @@
  * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
  * @version $Id$
  */
+
+use EGroupware\Api;
+use EGroupware\Api\Link;
+use EGroupware\Api\Framework;
+use EGroupware\Api\Acl;
+use EGroupware\Api\Etemplate;
 
 /**
  * Milestones user interface of the Projectmanager
@@ -29,7 +35,7 @@
  */
  function __construct()
  {
- $this->tpl = new etemplate_new();
+ $this->tpl = new Etemplate();
 
  if ((int) $_REQUEST['pm_id'])
  {
@@ -49,7 +55,7 @@
  parent::__construct($pm_id);
 
  // check if we have at least read-access to this project
- if (!$this->check_acl(EGW_ACL_READ))
+ if (!$this->check_acl(Acl::READ))
  {
  $this->tpl->location(array(
  'menuaction' => 'projectmanager.projectmanager_ui.index',
@@ -75,7 +81,7 @@
  */
  function edit($content=null,$view=false)
  {
- $view = $view || $content['view'] || !$this->check_acl(EGW_ACL_EDIT);
+ $view = $view || $content['view'] || !$this->check_acl(Acl::EDIT);
 
  if (is_array($content))
  {
@@ -83,13 +89,13 @@
  {
  if($content['ms_id'])
  {
- egw_link::unlink(0, 'projectmanager', $this->data['pm_id'],'pm_milestone',$content['ms_id']);
+ Link::unlink(0, 'projectmanager', $this->data['pm_id'],'pm_milestone',$content['ms_id']);
  }
  $this->read($content['pm_id']);
  }
  $this->milestones->data_merge($content);
 
- if ($this->check_acl(EGW_ACL_EDIT))
+ if ($this->check_acl(Acl::EDIT))
  {
  if ($content['save'] || $content['apply'])
  {
@@ -101,9 +107,9 @@
  else
  {
  $msg = lang('Milestone saved');
- egw_link::link('projectmanager', $this->data['pm_id'],'pm_milestone',$this->milestones->data['ms_id']);
+ Link::link('projectmanager', $this->data['pm_id'],'pm_milestone',$this->milestones->data['ms_id']);
  // Refresh the project via projectmanager, since PM's sub-types don't fit
- egw_framework::refresh_opener($msg, 'projectmanager', $this->data['pm_id'], 'edit');
+ Framework::refresh_opener($msg, 'projectmanager', $this->data['pm_id'], 'edit');
 
  }
  }
@@ -114,22 +120,22 @@
  'ms_id' => $content['ms_id'],
  )))
  {
- egw_link::unlink(0, 'pm_milestone', $content['ms_id']);
+ Link::unlink(0, 'pm_milestone', $content['ms_id']);
  $msg = lang('Milestone deleted');
- egw_framework::refresh_opener($msg, 'projectmanager', 'edit');
+ Framework::refresh_opener($msg, 'projectmanager', 'edit');
 
  }
  }
- if ($content['edit'] && $this->check_acl(EGW_ACL_EDIT))
+ if ($content['edit'] && $this->check_acl(Acl::EDIT))
  {
  $view = false;
  }
  }
  if ($content['save'] || $content['cancel'] || $content['delete'])
  {
- egw_framework::window_close();
+ Framework::window_close();
 
- $GLOBALS['egw']->common->egw_exit();
+ exit();
  }
  }
  elseif ($_REQUEST['ms_id'])
@@ -152,7 +158,7 @@
  if ($view)
  {
  $readonlys = array(
- 'edit'     => !$this->check_acl(EGW_ACL_EDIT),
+ 'edit'     => !$this->check_acl(Acl::EDIT),
  'save'     => true,
  'apply'    => true,
  'delete'   => true,
@@ -169,7 +175,7 @@
  );
  $sel_options['pm_id'] += $this->query_list('pm_title','pm_id');
  }
- $readonlys['delete'] = !$this->milestones->data['ms_id'] || !$this->check_acl(EGW_ACL_EDIT);
+ $readonlys['delete'] = !$this->milestones->data['ms_id'] || !$this->check_acl(Acl::EDIT);
 
  $GLOBALS['egw_info']['flags']['app_header'] = lang('projectmanager').' - '.($view ? lang('View milestone') :
  ($this->milestones->data['ms_id'] ? lang('Edit milestone') : lang('Add milestone')));

Modified: trunk/projectmanager/inc/class.projectmanager_pricelist_bo.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/projectmanager/inc/class.projectmanager_pricelist_bo.inc.php?rev=56100&r1=56099&r2=56100&view=diff
==============================================================================
--- trunk/projectmanager/inc/class.projectmanager_pricelist_bo.inc.php (original)
+++ trunk/projectmanager/inc/class.projectmanager_pricelist_bo.inc.php Tue May 10 00:05:39 2016
@@ -10,6 +10,9 @@
  * @version $Id$
  */
 
+use EGroupware\Api;
+use EGroupware\Api\Acl;
+
 /**
  * Pricelist buisness object of the projectmanager
  */
@@ -51,7 +54,7 @@
  }
 
  /**
- * saves the content of data to the db, also checks acl and deletes not longer set prices!
+ * saves the content of data to the db, also checks Acl and deletes not longer set prices!
  *
  * @param array $keys=null if given $keys are copied to data before saveing => allows a save as
  * @return int/boolean 0 on success, true on missing acl-rights and errno != 0 else
@@ -91,8 +94,8 @@
  }
  if ($pricelist_need_save)
  {
- // check acl
- if (!$this->check_acl(EGW_ACL_EDIT,$need_general ? 0 : $this->data['pm_id']))
+ // check Acl
+ if (!$this->check_acl(Acl::EDIT,$need_general ? 0 : $this->data['pm_id']))
  {
  return lang('permission denied !!!').' need_general='.(int)$need_general;
  }
@@ -135,10 +138,10 @@
  $old_price = $old_prices[(int)$price['pm_id']][date('Y-m-d',(int)$price['pl_validsince'])];
  if (!$this->prices_equal($price,$old_price))
  {
- // price needs saving, checking acl now
- if (!$this->check_acl(EGW_ACL_EDIT,$price['pm_id']))
- {
- return lang('permission denied !!!').' check_acl(EGW_ACL_EDIT(pm_id='.(int)$price[pm_id].')';
+ // price needs saving, checking Acl now
+ if (!$this->check_acl(Acl::EDIT,$price['pm_id']))
+ {
+ return lang('permission denied !!!').' check_acl(Acl::EDIT(pm_id='.(int)$price[pm_id].')';
  }
  // maintain time of old price, to not create doublets with different times by users operating in different TZ's
  if ($old_price) $price['pl_validsince'] = $old_price['pl_validsince'];
@@ -155,9 +158,9 @@
  {
  foreach($prices as &$price)
  {
- if (!$this->check_acl(EGW_ACL_DELETE,$price['pm_id']))
- {
- return lang('permission denied !!!').' check_acl(EGW_ACL_DELETE(pm_id='.(int)$price[pm_id].')';
+ if (!$this->check_acl(Acl::DELETE,$price['pm_id']))
+ {
+ return lang('permission denied !!!').' check_acl(Acl::DELETE(pm_id='.(int)$price[pm_id].')';
  }
  if (!parent::delete($price))
  {
@@ -180,12 +183,13 @@
  * @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 prices-table or string as in so_sql
+ * @param string/boolean $join=true default join with prices-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=false,$order_by='',$extra_cols='',$wildcard='',$empty=False,$op='AND',$start=false,$filter=null,$join=true)
  {
- if (!$this->check_acl(EGW_ACL_READ,(int)($criteria['pm_id'] ? $criteria['pm_id'] : $this->pm_id)))
+ error_log(array2string($filter));
+ if (!$this->check_acl(Acl::READ,(int)($criteria['pm_id'] ? $criteria['pm_id'] : $this->pm_id)))
  {
  return false;
  }
@@ -220,7 +224,7 @@
  *
  * @param array $keys array with keys in form internalName => value, may be a scalar value if only one key
  * @param string/array $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)
@@ -229,7 +233,7 @@
  foreach(!is_array($keys) || !isset($keys['pm_id']) ? array($this->pm_id) :
  (is_array($keys['pm_id']) ? $keys['pm_id'] : array($keys['pm_id'])) as $pm_id)
  {
- if (!$this->check_acl(EGW_ACL_READ,(int)$pm_id)) return false;
+ if (!$this->check_acl(Acl::READ,(int)$pm_id)) return false;
  }
  return parent::read($keys,$extra_cols,$join);
  }
@@ -244,7 +248,7 @@
  */
  function delete($keys)
  {
- if (!$this->check_acl(EGW_ACL_EDIT,(int)(is_array($keys) ? $keys['pm_id'] : $keys)))
+ if (!$this->check_acl(Acl::EDIT,(int)(is_array($keys) ? $keys['pm_id'] : $keys)))
  {
  return false;
  }
@@ -286,9 +290,9 @@
 */
  if (!$pm_id)
  {
- return $required == EGW_ACL_READ || $this->project->is_admin;
- }
- return $this->project->check_acl($required == EGW_ACL_READ ? EGW_ACL_BUDGET : EGW_ACL_EDIT_BUDGET,$pm_id);
+ return $required == Acl::READ || $this->project->is_admin;
+ }
+ return $this->project->check_acl($required == Acl::READ ? EGW_ACL_BUDGET : EGW_ACL_EDIT_BUDGET,$pm_id);
  }
 
  /**

Modified: trunk/projectmanager/inc/class.projectmanager_pricelist_so.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/projectmanager/inc/class.projectmanager_pricelist_so.inc.php?rev=56100&r1=56099&r2=56100&view=diff
==============================================================================
--- trunk/projectmanager/inc/class.projectmanager_pricelist_so.inc.php (original)
+++ trunk/projectmanager/inc/class.projectmanager_pricelist_so.inc.php Tue May 10 00:05:39 2016
@@ -10,12 +10,14 @@
  * @version $Id$
  */
 
+use EGroupware\Api;
+
 /**
  * Pricelist storage object of the projectmanager
  *
  * Tables: egw_pm_pricelist, egw_pm_prices
  */
-class projectmanager_pricelist_so extends so_sql
+class projectmanager_pricelist_so extends Api\Storage\Base
 {
  /**
  * Table name of the prices table
@@ -59,7 +61,7 @@
  *
  * @param array $keys array with keys in form internalName => value, may be a scalar value if only one key
  * @param string/array $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)
@@ -161,7 +163,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 prices-table or string as in so_sql
+ * @param string/boolean $join=true default join with prices-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=false,$order_by='pl_title',$extra_cols='',$wildcard='',$empty=False,$op='AND',$start=false,$filter=null,$join=true)

Modified: trunk/projectmanager/inc/class.projectmanager_pricelist_ui.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/projectmanager/inc/class.projectmanager_pricelist_ui.inc.php?rev=56100&r1=56099&r2=56100&view=diff
==============================================================================
--- trunk/projectmanager/inc/class.projectmanager_pricelist_ui.inc.php (original)
+++ trunk/projectmanager/inc/class.projectmanager_pricelist_ui.inc.php Tue May 10 00:05:39 2016
@@ -9,6 +9,11 @@
  * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
  * @version $Id$
  */
+
+use EGroupware\Api;
+use EGroupware\Api\Framework;
+use EGroupware\Api\Acl;
+use EGroupware\Api\Etemplate;
 
 /**
  * Pricelist user interface of the projectmanager
@@ -59,7 +64,7 @@
 
  function edit($content=null,$view=false,$msg='')
  {
- $tpl = new etemplate_new('projectmanager.pricelist.edit');
+ $tpl = new Etemplate('projectmanager.pricelist.edit');
  if (!is_array($content))
  {
  if (($pl_id = (int) $_GET['pl_id']) && $this->read(array(
@@ -80,14 +85,14 @@
  );
  }
  // no READ or EDIT/ADD rights ==> close the popup
- if (!$this->check_acl($view ? EGW_ACL_READ : EGW_ACL_EDIT) &&
- !($this->pm_id && $this->check_acl($view ? EGW_ACL_READ : EGW_ACL_EDIT,$this->pm_id)))
- {
- egw_framework::window_close(lang('Permission denied !!!'));
-
- common::egw_header();
-
- common::egw_exit();
+ if (!$this->check_acl($view ? Acl::READ : Acl::EDIT) &&
+ !($this->pm_id && $this->check_acl($view ? Acl::READ : Acl::EDIT,$this->pm_id)))
+ {
+ Framework::window_close(lang('Permission denied !!!'));
+
+ $GLOBALS['egw']->framework->header();
+
+ exit();
  }
  if (count($this->data['project_prices'])) $content['tabs'] = 'project'; // open project tab
  $pm_id = count($this->data['project_prices']) ? $this->data['project_prices'][0]['pm_id'] : $this->pm_id;
@@ -132,22 +137,22 @@
  $msg = lang('Error: saving the price (%1) !!!',$err);
  $button = 'apply'; // dont close the window
  }
- egw_framework::refresh_opener($msg, 'projectmanager');
+ Framework::refresh_opener($msg, 'projectmanager');
 
  if ($button == 'apply') break;
  // fall through
  case 'cancel':
- egw_framework::window_close();
- common::egw_exit();
+ Framework::window_close();
+ exit();
  break;
 
  case 'edit':
- $view = false; // acl is ensured later, see $view_*prices
+ $view = false; // Acl is ensured later, see $view_*prices
  break;
  }
  }
- $view_prices = $view || count($this->data['prices']) && !$this->check_acl(EGW_ACL_EDIT);
- $view_project_prices = $view || !$this->check_acl(EGW_ACL_EDIT,$this->pm_id);
+ $view_prices = $view || count($this->data['prices']) && !$this->check_acl(Acl::EDIT);
+ $view_project_prices = $view || !$this->check_acl(Acl::EDIT,$this->pm_id);
  $view = $view || $view_prices && $view_project_prices; // nothing to edit => no rights
 
  $content = $this->data + array(
@@ -181,7 +186,7 @@
  }
  }
  // set general data and price readonly, if $view or price belongs to general pricelist and no edit there
- if ($view || count($this->data['prices']) && !$this->check_acl(EGW_ACL_EDIT))
+ if ($view || count($this->data['prices']) && !$this->check_acl(Acl::EDIT))
  {
  foreach($this->db_cols as $name => $data)
  {
@@ -194,7 +199,7 @@
  }
  }
  // set project-spez. prices readonly, if view or no edit-rights there
- if ($view || !$this->check_acl(EGW_ACL_EDIT,$this->pm_id))
+ if ($view || !$this->check_acl(Acl::EDIT,$this->pm_id))
  {
  foreach(array('pl_billable','pl_customertitle') as $name)
  {
@@ -207,14 +212,14 @@
  }
  }
  $readonlys['button[save]'] = $readonlys['button[apply]'] = $view;
- $readonlys['button[edit]'] = !$view || !$this->check_acl(EGW_ACL_EDIT) && !$this->check_acl(EGW_ACL_EDIT,$this->pm_id);
+ $readonlys['button[edit]'] = !$view || !$this->check_acl(Acl::EDIT) && !$this->check_acl(Acl::EDIT,$this->pm_id);
 
  if (!$this->pm_id) // no project tab for the general pricelist
  {
  $readonlys['tabs']['project'] = true;
  }
  // no general price tab, if there are none and no rights to edit the general pricelist
- if (!count($this->data['prices']) && !$this->check_acl(EGW_ACL_EDIT))
+ if (!count($this->data['prices']) && !$this->check_acl(Acl::EDIT))
  {
  $readonlys['tabs']['price'] = true;
  }
@@ -233,21 +238,26 @@
  /**
  * query pricelist for nextmatch
  *
- * 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
  * @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,&$rows,&$readonlys)
  {
- $GLOBALS['egw']->session->appsession('pricelist','projectmanager',$query);
+ Api\Cache::setSession('projectmanager', 'pricelist', $query);
 
  if ($query['cat_id'])
  {
  $query['col_filter']['cat_id'] = $query['cat_id'];
  }
- if ($query['col_filter']['pm_id'] === '' || !$this->check_acl(EGW_ACL_READ,$query['col_filter']['pm_id']))
+ if (is_array($query['col_filter']['pm_id']))
+ {
+ $query['col_filter']['pm_id'] = array_shift($query['col_filter']['pm_id']);
+ }
+
+ if ($query['col_filter']['pm_id'] === '' || !$this->check_acl(Acl::READ,$query['col_filter']['pm_id']))
  {
  unset($query['col_filter']['pm_id']);
  }
@@ -256,7 +266,7 @@
  $this->__construct($query['col_filter']['pm_id']);
  $query['actions'] = $this->get_actions();
  }
- if ($query['col_filter']['pl_billable'] === '') unset($query['col_filter']['pl_billable']);
+ if (!$query['col_filter']['pl_billable']) unset($query['col_filter']['pl_billable']);
 
  $total = parent::get_rows($query,$rows,$readonlys,true);
 
@@ -265,7 +275,7 @@
  {
  $row =& $rows[$n];
  // we only delete prices from the shown pricelist, not inhirited ones or onces from the general list
- if ($row['pm_id'] != $this->pm_id || !$this->check_acl(EGW_ACL_EDIT,$this->pm_id))
+ if ($row['pm_id'] != $this->pm_id || !$this->check_acl(Acl::EDIT,$this->pm_id))
  {
  $readonlys["delete[$row[pm_id]:$row[pl_id]]"] = true;
  $rows[$n]['class'] .= 'rowNoDelete ';
@@ -276,7 +286,7 @@
 
  function index($content=null,$msg='')
  {
- while (!$this->check_acl(EGW_ACL_READ,$this->pm_id))
+ while (!$this->check_acl(Acl::READ,$this->pm_id))
  {
  if ($this->pm_id) // try falling back to the general pricelist
  {
@@ -285,11 +295,11 @@
  }
  else
  {
- egw_framework::message(lang('Permission denied !!!'), 'error');
+ Framework::message(lang('Permission denied !!!'), 'error');
  return;
  }
  }
- $tpl = new etemplate_new('projectmanager.pricelist.list');
+ $tpl = new Etemplate('projectmanager.pricelist.list');
 
  if (!is_array($content))
  {
@@ -306,7 +316,7 @@
  }
  else
  {
- $nm = $GLOBALS['egw']->session->appsession('pricelist','projectmanager');
+ $nm = Api\Cache::getSession('projectmanager', 'pricelist');
  $pm_id = $nm['col_filter']['pm_id'];
  }
  foreach($content['nm']['selected'] as $pl_id) {
@@ -324,9 +334,9 @@
  $msg = $msg ? $msg : $_GET['msg'];
  if($msg)
  {
- egw_framework::message($msg);
- }
- $content['nm'] = $GLOBALS['egw']->session->appsession('pricelist','projectmanager');
+ Framework::message($msg);
+ }
+ $content['nm'] = Api\Cache::getSession('projectmanager', 'pricelist');
  if (!is_array($content['nm']))
  {
  $content['nm'] = array(
@@ -366,7 +376,7 @@
 
  $readonlys = array(
  // show add button only, if user has rights to add a new price
- 'add' => !$this->check_acl(EGW_ACL_EDIT,$this->pm_id),
+ 'add' => !$this->check_acl(Acl::EDIT,$this->pm_id),
  );
  return $tpl->exec('projectmanager.projectmanager_pricelist_ui.index',$content,$sel_options,$readonlys);
  }

Modified: trunk/projectmanager/inc/class.projectmanager_roles_so.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/projectmanager/inc/class.projectmanager_roles_so.inc.php?rev=56100&r1=56099&r2=56100&view=diff
==============================================================================
--- trunk/projectmanager/inc/class.projectmanager_roles_so.inc.php (original)
+++ trunk/projectmanager/inc/class.projectmanager_roles_so.inc.php Tue May 10 00:05:39 2016
@@ -10,12 +10,14 @@
  * @version $Id$
  */
 
+use EGroupware\Api;
+
 /**
  * Roles storage object of the projectmanager
  *
  * Tables: egw_pm_roles
  */
-class projectmanager_roles_so extends so_sql
+class projectmanager_roles_so extends Api\Storage\Base
 {
  /**
  * Constructor, calls the constructor of the extended class

Modified: trunk/projectmanager/inc/class.projectmanager_roles_ui.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/projectmanager/inc/class.projectmanager_roles_ui.inc.php?rev=56100&r1=56099&r2=56100&view=diff
==============================================================================
--- trunk/projectmanager/inc/class.projectmanager_roles_ui.inc.php (original)
+++ trunk/projectmanager/inc/class.projectmanager_roles_ui.inc.php Tue May 10 00:05:39 2016
@@ -10,7 +10,12 @@
  * @version $Id$
  */
 
-define('EGW_ACL_ROLES',EGW_ACL_EDIT); // maybe this gets an own ACL later
+use EGroupware\Api;
+use EGroupware\Api\Framework;
+use EGroupware\Api\Acl;
+use EGroupware\Api\Etemplate;
+
+define('EGW_ACL_ROLES',Acl::EDIT); // maybe this gets an own ACL later
 
 /**
  * ProjectManager UI: roles
@@ -26,10 +31,10 @@
  'roles' => true,
  );
  var $acl2id = array(
- 'read'   => EGW_ACL_READ,
- 'edit'   => EGW_ACL_EDIT,
- 'delete' => EGW_ACL_DELETE,
- 'add'    => EGW_ACL_ADD,
+ 'read'   => Acl::READ,
+ 'edit'   => Acl::EDIT,
+ 'delete' => Acl::DELETE,
+ 'add'    => Acl::ADD,
  'budget' => EGW_ACL_BUDGET,
  'edit_budget' => EGW_ACL_EDIT_BUDGET,
  'add_timesheet' => EGW_ACL_ADD_TIMESHEET
@@ -58,7 +63,7 @@
  */
  function roles($content=null)
  {
- $tpl = new etemplate_new('projectmanager.roles');
+ $tpl = new Etemplate('projectmanager.roles');
 
  $pm_id = is_array($content) ? $content['pm_id'] : (int) $_REQUEST['pm_id'];
 
@@ -100,7 +105,7 @@
  {
  $msg = lang('Role saved');
 
- if ($content['save']) egw_framework::window_close();
+ if ($content['save']) Framework::window_close();
  }
  else
  {

Modified: trunk/projectmanager/inc/class.projectmanager_so.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/projectmanager/inc/class.projectmanager_so.inc.php?rev=56100&r1=56099&r2=56100&view=diff
==============================================================================
--- trunk/projectmanager/inc/class.projectmanager_so.inc.php (original)
+++ trunk/projectmanager/inc/class.projectmanager_so.inc.php Tue May 10 00:05:39 2016
@@ -10,6 +10,10 @@
  * @version $Id$
  */
 
+use EGroupware\Api;
+use EGroupware\Api\Link;
+use EGroupware\Api\Acl;
+
 /**
  * General storage object of the projectmanager: access the main project data
  *
@@ -17,14 +21,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_so extends so_sql_cf
+class projectmanager_so extends Api\Storage
 {
  /**
  * Table name 'egw_links'
  *
  * @var string
  */
- var $links_table = solink::TABLE;
+ var $links_table = Link\Storage::TABLE;
  /**
  * Configuration data
  *
@@ -80,7 +84,7 @@
  {
  parent::__construct('projectmanager','egw_pm_projects','egw_pm_extra','','pm_extra_name','pm_extra_value','pm_id');
 
- $this->config = config::read('projectmanager');
+ $this->config = Api\Config::read('projectmanager');
  if (!$this->config)
  {
  $this->config = array(
@@ -101,7 +105,7 @@
  {
  if ($rights) $this->read_grants[] = $owner; // ANY ACL implies READ!
 
- if ($rights & EGW_ACL_PRIVATE) $this->private_grants[] = $owner;
+ if ($rights & Acl::PRIVAT) $this->private_grants[] = $owner;
  }
  if (($memberships = $GLOBALS['egw']->accounts->memberships($this->user, true)))
  {
@@ -255,7 +259,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 sql to do a join, added as is after the table-name, default true=add join for acl
+ * @param string/boolean $join=true sql to do a join, added as is after the table-name, default true=add join for Acl
  * @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,$need_full_no_count=false)
@@ -265,7 +269,7 @@
  {
  if (!is_object($GLOBALS['egw']->categories))
  {
- $GLOBALS['egw']->categories = new categories();
+ $GLOBALS['egw']->categories = new Api\Categories();
  }
  $filter['cat_id'] = $GLOBALS['egw']->categories->return_all_children($filter['cat_id']);
  }

Modified: trunk/projectmanager/inc/class.projectmanager_tracking.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/projectmanager/inc/class.projectmanager_tracking.inc.php?rev=56100&r1=56099&r2=56100&view=diff
==============================================================================
--- trunk/projectmanager/inc/class.projectmanager_tracking.inc.php (original)
+++ trunk/projectmanager/inc/class.projectmanager_tracking.inc.php Tue May 10 00:05:39 2016
@@ -10,10 +10,12 @@
  * @version $Id: class.projectmanager_tracking.inc.php 26515 2009-03-24 11:50:16Z leithoff $
  */
 
+use EGroupware\Api;
+
 /**
  * Projectmanager - tracking object for the tracker
  */
-class projectmanager_tracking extends bo_tracking
+class projectmanager_tracking extends Api\Storage\Tracking
 {
  /**
  * Application we are tracking (required!)
@@ -99,7 +101,7 @@
  }
 
  /**
- * Get the subject for a given entry, reimplementation for get_subject in bo_tracking
+ * Get the subject for a given entry, reimplementation for get_subject in Api\Storage\Tracking
  *
  * Default implementation uses the link-title
  *
@@ -124,11 +126,11 @@
  if (!$data['pm_modified'] || !$old)
  {
  return lang('New Project submitted by %1 at %2',
- common::grab_owner_name($data['pm_creator']),
+ Api\Accounts::username($data['pm_creator']),
  $this->datetime($data['pm_created']));
  }
  return lang('Project modified by %1 at %2',
- $data['pm_modifier'] ? common::grab_owner_name($data['pm_modifier']) : lang('Projectmanager'),
+ $data['pm_modifier'] ? Api\Accounts::username($data['pm_modifier']) : lang('Projectmanager'),
  $this->datetime($data['pm_modified']));
  }
 }

Modified: trunk/projectmanager/inc/class.projectmanager_ui.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/projectmanager/inc/class.projectmanager_ui.inc.php?rev=56100&r1=56099&r2=56100&view=diff
==============================================================================
--- trunk/projectmanager/inc/class.projectmanager_ui.inc.php (original)
+++ trunk/projectmanager/inc/class.projectmanager_ui.inc.php Tue May 10 00:05:39 2016
@@ -11,6 +11,11 @@
  */
 
 use EGroupware\Api;
+use EGroupware\Api\Link;
+use EGroupware\Api\Framework;
+use EGroupware\Api\Egw;
+use EGroupware\Api\Acl;
+use EGroupware\Api\Etemplate;
 
 /**
  * ProjectManager UI: list and edit projects
@@ -96,12 +101,12 @@
  {
  $pm_id = $GLOBALS['egw_info']['user']['preferences']['projectmanager']['current_project'];
  }
- if(!$this->check_acl(EGW_ACL_READ,$pm_id))
+ if(!$this->check_acl(Acl::READ,$pm_id))
  {
  $pm_id = $_GET['pm_id'] = $GLOBALS['egw_info']['user']['preferences']['projectmanager']['current_project'] = 0;
 
  }
- if($this->check_acl(EGW_ACL_READ, $pm_id))
+ if($this->check_acl(Acl::READ, $pm_id))
  {
  $this->pm_list();
 
@@ -134,7 +139,7 @@
  {
  if ((int) $this->debug >= 1 || $this->debug == 'edit') $this->debug_message("projectmanager_ui::edit(,$view) content=".print_r($content,true));
 
- $tpl = new etemplate_new('projectmanager.edit');
+ $tpl = new Etemplate('projectmanager.edit');
 
  if (is_array($content))
  {
@@ -148,7 +153,7 @@
  {
  $this->init();
  }
- $view = $content['view'] && !$content['edit'] || !$this->check_acl(EGW_ACL_EDIT);
+ $view = $content['view'] && !$content['edit'] || !$this->check_acl(Acl::EDIT);
 
  if (!$content['view']) // just changed to edit-mode, still counts as view
  {
@@ -208,7 +213,7 @@
  }
  //echo "projectmanager_ui::edit(): data="; _debug_array($this->data);
 
- if (($content['save'] || $content['apply']) && $this->check_acl(EGW_ACL_EDIT))
+ if (($content['save'] || $content['apply']) && $this->check_acl(Acl::EDIT))
  {
  // generate project-number, taking into account a given parent-project
  if (empty($this->data['pm_number']))
@@ -243,18 +248,18 @@
  if ($content['add_link'])
  {
  list($app,$app_id) = explode(':',$content['add_link'],2);
- egw_link::link($app,$app_id,'projectmanager',$this->data['pm_id']);
+ Link::link($app,$app_id,'projectmanager',$this->data['pm_id']);
  }
  // writing links for new entry, existing ones are handled by the widget itself
  if (!$content['pm_id'] && is_array($content['link_to']['to_id']))
  {
- egw_link::link('projectmanager',$this->data['pm_id'],$content['link_to']['to_id']);
+ Link::link('projectmanager',$this->data['pm_id'],$content['link_to']['to_id']);
 
  // check if we have dragged in images and fix their image urls
- if (etemplate_widget_vfs::fix_html_dragins('projectmanager', $this->data['pm_id'],
+ if (Etemplate\Widget\Vfs::fix_html_dragins('projectmanager', $this->data['pm_id'],
  $content['link_to']['to_id'], $content['pm_description']))
  {
- so_sql::update(array(
+ Api\Storage\Base::update(array(
  'pm_description' => $content['pm_description'],
  ));
  }
@@ -271,17 +276,17 @@
  array('pm_id'=>$this->data['pm_id']),$this->data['pm_status']);
  }
  }
- if ($content['apply']) egw_framework::refresh_opener($msg, 'projectmanager', $this->data['pm_id'], 'edit');
- }
- if ($content['delete'] && $this->check_acl(EGW_ACL_DELETE))
+ if ($content['apply']) Framework::refresh_opener($msg, 'projectmanager', $this->data['pm_id'], 'edit');
+ }
+ if ($content['delete'] && $this->check_acl(Acl::DELETE))
  {
  $msg = $this->delete($pm_id,$delete_sources) ? lang('Project deleted') : lang('Error: deleting project !!!');
  }
  if ($content['save'] || $content['delete']) // refresh opener and output message
  {
- egw_framework::refresh_opener($msg,'projectmanager', $this->data['pm_id'], $content['save']?'edit':'delete');
- egw_framework::window_close();
- common::egw_exit();
+ Framework::refresh_opener($msg,'projectmanager', $this->data['pm_id'], $content['save']?'edit':'delete');
+ Framework::window_close();
+ exit();
  }
  $template = $content['template'];
  }
@@ -296,10 +301,10 @@
  // for a new sub-project set some data from the parent
  elseif ($_GET['link_app'] == 'projectmanager' && (int) $_GET['link_id'] && $this->read((int) $_GET['link_id']))
  {
- if (!$this->check_acl(EGW_ACL_READ)) // no read-rights for the parent, eg. someone edited the url
+ if (!$this->check_acl(Acl::READ)) // no read-rights for the parent, eg. someone edited the url
  {
  $GLOBALS['egw']->framework->render(lang('Permission denied !!!'));
- common::egw_exit();
+ exit();
  }
  $this->generate_pm_number(true,$parent_number=$this->data['pm_number']);
  foreach(array('pm_id','pm_title','pm_description','pm_creator','pm_created','pm_modified','pm_modifier','pm_real_start','pm_real_end','pm_completion','pm_status','pm_used_time','pm_planned_time','pm_replanned_time','pm_used_budget','pm_planned_budget') as $key)
@@ -311,22 +316,22 @@
  }
  if((int)$_GET['template'] && $this->read((int) $_GET['template']))
  {
- if (!$this->check_acl(EGW_ACL_READ)) // no read-rights for the template, eg. someone edited the url
+ if (!$this->check_acl(Acl::READ)) // no read-rights for the template, eg. someone edited the url
  {
  $GLOBALS['egw']->framework->render(lang('Permission denied !!!'));
- common::egw_exit();
+ exit();
  }
  // we do only stage 1 of the copy, so if the user hits cancel everythings Ok
  $this->copy($template = (int) $_GET['template'],1,$parent_number);
  }
  if ($this->data['pm_id'])
  {
- if (!$this->check_acl(EGW_ACL_READ))
+ if (!$this->check_acl(Acl::READ))
  {
  $GLOBALS['egw']->framework->render(lang('Permission denied !!!'));
- common::egw_exit();
- }
- if (!$this->check_acl(EGW_ACL_EDIT)) $view = true;
+ exit();
+ }
+ if (!$this->check_acl(Acl::EDIT)) $view = true;
  }
  // no pm-number set, generate one
  if (!$this->data['pm_number']) $this->generate_pm_number(true);
@@ -361,7 +366,7 @@
  if ($add_link && !is_array($content['link_to']['to_id']))
  {
  list($app,$app_id) = explode(':',$add_link,2);
- egw_link::link('projectmanager',$content['link_to']['to_id'],$app,$app_id);
+ Link::link('projectmanager',$content['link_to']['to_id'],$app,$app_id);
  }
  $content['links'] = $content['link_to'];
 
@@ -394,8 +399,8 @@
  $this->config['accounting_types'] = explode(',',$this->config['accounting_types']);
  }
  $readonlys = array(
- 'delete' => !$this->data['pm_id'] || !$this->check_acl(EGW_ACL_DELETE),
- 'edit' => !$view || !$this->check_acl(EGW_ACL_EDIT),
+ 'delete' => !$this->data['pm_id'] || !$this->check_acl(Acl::DELETE),
+ 'edit' => !$view || !$this->check_acl(Acl::EDIT),
  'tabs' => array(
  'accounting' => !$this->check_acl(EGW_ACL_BUDGET) && // disable the tab, if no budget rights and no owner or coordinator
  ($this->config['accounting_types'] && count($this->config['accounting_types']) == 1 ||
@@ -515,11 +520,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
  * @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)
  {
@@ -537,7 +542,7 @@
  $query = $query_in;
  // Don't keep pm_id filter in seesion
  unset($query_in['col_filter']['pm_id']);
- $GLOBALS['egw']->session->appsession('project_list','projectmanager',$query_in);
+ Api\Cache::setSession('projectmanager', 'project_list', $query_in);
 
  //echo "<p>projectmanager_ui::get_rows(".print_r($query,true).")</p>\n";
  // save the state of the index in the user prefs
@@ -574,18 +579,18 @@
  foreach($rows as &$row)
  {
  // Hide as much as possible for users without read access, but still have other permissions
- if(!$this->check_acl(EGW_ACL_READ,$row['pm_id']))
+ if(!$this->check_acl(Acl::READ,$row['pm_id']))
  {
  foreach($row as $key => &$value)
  {
  if(!in_array($key, array('pm_id','pm_number','pm_title'))) $value = '';
  }
  }
- if (!$this->check_acl(EGW_ACL_EDIT,$row))
+ if (!$this->check_acl(Acl::EDIT,$row))
  {
  $row['class'] .= ' rowNoEdit';
  }
- if (!$this->check_acl(EGW_ACL_DELETE,$row))
+ if (!$this->check_acl(Acl::DELETE,$row))
  {
  $row['class'] .= ' rowNoDelete';
  }
@@ -659,7 +664,7 @@
  {
  if ((int) $this->debug >= 1 || $this->debug == 'index') $this->debug_message("projectmanager_ui::index(,$msg) content=".print_r($content,true));
 
- $tpl = new etemplate_new('projectmanager.list');
+ $tpl = new Etemplate('projectmanager.list');
 
  if ($_GET['msg']) $msg = $_GET['msg'];
 
@@ -706,7 +711,7 @@
  break;
 
  case 'delete':
- if (!$this->read($pm_id) || !$this->check_acl(EGW_ACL_DELETE))
+ if (!$this->read($pm_id) || !$this->check_acl(Acl::DELETE))
  {
  $msg = lang('Permission denied !!!');
  }
@@ -719,12 +724,12 @@
  }
  }
  $content = array(
- 'nm' => $GLOBALS['egw']->session->appsession('project_list','projectmanager'),
+ 'nm' => Api\Cache::getSession('projectmanager', 'project_list'),
  'duration_format' => ','.$this->config['duration_format'],
  );
  if($msg)
  {
- egw_framework::message($msg);
+ Framework::message($msg);
  }
  if (!is_array($content['nm']))
  {
@@ -852,7 +857,7 @@
  'copy' => array(
  'caption' => 'Copy',
  'url' => 'menuaction=projectmanager.projectmanager_ui.edit&template=$id',
- 'popup' => egw_link::get_registry('projectmanager', 'add_popup'),
+ 'popup' => Link::get_registry('projectmanager', 'add_popup'),
  ),
  'template' => array(
  'caption' => 'Template',
@@ -861,12 +866,12 @@
  // get inherited by children
  'prefix' => 'template_',
  'url' => 'menuaction=projectmanager.projectmanager_ui.edit&template=$action',
- 'popup' => egw_link::get_registry('projectmanager', 'add_popup'),
+ 'popup' => Link::get_registry('projectmanager', 'add_popup'),
  ),
  'sub' => array(
  'caption' => 'Subproject',
  'url' => 'menuaction=projectmanager.projectmanager_ui.edit&link_app=projectmanager&link_id=$id',
- 'popup' => egw_link::get_registry('projectmanager', 'add_popup'),
+ 'popup' => Link::get_registry('projectmanager', 'add_popup'),
  'icon' => 'navbar',
  ),
  'templatesub' => array(
@@ -876,7 +881,7 @@
  // get inherited by children
  'prefix' => 'templatesub_',
  'url' => 'menuaction=projectmanager.projectmanager_ui.edit&template=$action&link_app=projectmanager&link_id=$id',
- 'popup' => egw_link::get_registry('projectmanager', 'add_popup'),
+ 'popup' => Link::get_registry('projectmanager', 'add_popup'),
  ),
  ),
  ),
@@ -904,7 +909,7 @@
  $GLOBALS['egw_info']['user']['preferences']['projectmanager']['document_dir'],
  $group, 'Insert in document', 'document_'
  ),
- 'cat' => nextmatch_widget::category_action(
+ 'cat' => Etemplate\Widget\Nextmatch::category_action(
  'projectmanager',$group,'Change category','cat_'
  )+array(
  'disableClass' => 'rowNoEdit',
@@ -974,8 +979,8 @@
  if ($use_all)
  {
  // get the whole selection
- $old_query = $GLOBALS['egw']->session->appsession('project_list','projectmanager');
- $query = is_array($session_name) ? $session_name : $GLOBALS['egw']->session->appsession($session_name,'projectmanager');
+ $old_query = Api\Cache::getSession('projectmanager', 'project_list');
+ $query = is_array($session_name) ? $session_name : Api\Cache::getSession('projectmanager', $session_name);
 
  @set_time_limit(0); // switch off the execution time limit, as it's for big selections to small
  $query['num_rows'] = -1; // all
@@ -986,7 +991,7 @@
  if(is_array($project) && $project['pm_id'] && is_numeric($project['pm_id'])) $checked[] = $project['pm_id'];
  }
  // Reset query
- $GLOBALS['egw']->session->appsession('project_list','projectmanager',$old_query);
+ Api\Cache::setSession('projectmanager', 'project_list', $old_query);
  }
 
  // Dialogs to get options
@@ -995,7 +1000,7 @@
  switch($action)
  {
  case 'gantt':
- egw::redirect_link('/index.php', array(
+ Egw::redirect_link('/index.php', array(
  'menuaction' => 'projectmanager.projectmanager_ganttchart.show',
  'pm_id'      => implode(',',$checked),
  ));
@@ -1004,7 +1009,7 @@
  $action_msg = lang('deleted');
  foreach($checked as $pm_id)
  {
- if (!$this->read($pm_id) || !$this->check_acl(EGW_ACL_DELETE))
+ if (!$this->read($pm_id) || !$this->check_acl(Acl::DELETE))
  {
  $failed++;
  }
@@ -1019,7 +1024,7 @@
  $action_msg = $action == 'cat' ? lang('category set') : lang('status set');
  foreach($checked as $pm_id)
  {
- if (!$this->read($pm_id) || !$this->check_acl(EGW_ACL_EDIT))
+ if (!$this->read($pm_id) || !$this->check_acl(Acl::EDIT))
  {
  $failed++;
  }
@@ -1127,7 +1132,7 @@
  {
  return $nodes;
  }
- Api\Etemplate\Widget\Tree::send_quote_json($nodes);
+ Etemplate\Widget\Tree::send_quote_json($nodes);
  }
 
  protected static function _project_tree_leaves($filter, $parent_pm_id = 'mains', $_pm_id, &$projects = array())
@@ -1211,11 +1216,11 @@
 
  );
  // show pricelist only if we use pricelists
- $config = config::read('projectmanager');
+ $config = Api\Config::read('projectmanager');
  if (!$config['accounting_types'] || in_array('pricelist',(is_array($config['accounting_types'])?$config['accounting_types']:explode(',',$config['accounting_types']))))
  {
  // menuitem links to project-spezific priclist only if user has rights and it is used
- // to not always instanciate the priclist class, this code dublicats bopricelist::check_acl(EGW_ACL_READ),
+ // to not always instanciate the priclist class, this code dublicats bopricelist::check_acl(Acl::READ),
  // specialy the always existing READ right for the general pricelist!!!
  $actions[] = array(
  'caption' => 'Pricelist',

Modified: trunk/projectmanager/inc/class.projectmanager_widget.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/projectmanager/inc/class.projectmanager_widget.inc.php?rev=56100&r1=56099&r2=56100&view=diff
==============================================================================
--- trunk/projectmanager/inc/class.projectmanager_widget.inc.php (original)
+++ trunk/projectmanager/inc/class.projectmanager_widget.inc.php Tue May 10 00:05:39 2016
@@ -10,6 +10,8 @@
  * @version $Id$
  */
 
+use EGroupware\Api;
+
 /**
  * ProjectManager: eTemplate widgets
  *
@@ -246,7 +248,7 @@
  }
  }
 
- $response = egw_json_response::get();
+ $response = Api\Json\Response::get();
  $response->data($options);
  }
 }

Modified: trunk/projectmanager/inc/class.projectmanager_wizard_export_projects_csv.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/projectmanager/inc/class.projectmanager_wizard_export_projects_csv.inc.php?rev=56100&r1=56099&r2=56100&view=diff
==============================================================================
--- trunk/projectmanager/inc/class.projectmanager_wizard_export_projects_csv.inc.php (original)
+++ trunk/projectmanager/inc/class.projectmanager_wizard_export_projects_csv.inc.php Tue May 10 00:05:39 2016
@@ -9,6 +9,8 @@
  * @author Nathan Gray
  * @version $Id$
  */
+
+use EGroupware\Api;
 
 class projectmanager_wizard_export_projects_csv extends importexport_wizard_basic_export_csv
 {
@@ -44,7 +46,7 @@
 
  // Custom fields
  unset($this->export_fields['customfields']); // Heading, not a real field
- $custom = config::get_customfields('projectmanager', true);
+ $custom = Api\Storage\Customfields::get('projectmanager', true);
  foreach($custom as $name => $data) {
  $this->export_fields['#'.$name] = $data['label'];
  }
@@ -52,7 +54,7 @@
 
  public function wizard_step50(&$content, &$sel_options, &$readonlys, &$preserv) {
  if($this->debug || true) error_log(get_class($this) . '::wizard_step50->$content '.print_r($content,true));
- // return
+ // return
  if ($content['step'] == 'wizard_step50')
  {
  switch (array_search('pressed', $content['button']))

Modified: trunk/projectmanager/inc/class.projectmanager_wizard_import_projects_csv.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/projectmanager/inc/class.projectmanager_wizard_import_projects_csv.inc.php?rev=56100&r1=56099&r2=56100&view=diff
==============================================================================
--- trunk/projectmanager/inc/class.projectmanager_wizard_import_projects_csv.inc.php (original)
+++ trunk/projectmanager/inc/class.projectmanager_wizard_import_projects_csv.inc.php Tue May 10 00:05:39 2016
@@ -9,6 +9,8 @@
  * @author Nathan Gray
  * @version $Id$
  */
+
+use EGroupware\Api;
 
 class projectmanager_wizard_import_projects_csv extends importexport_wizard_basic_import_csv
 {
@@ -38,7 +40,7 @@
  if(count($role_list) > 0) {
  $this->mapping_fields[lang('Roles')] = $role_list;
  }
- $custom = config::get_customfields('projectmanager', true);
+ $custom = Api\Storage\Customfields::get('projectmanager', true);
  foreach($custom as $name => $data) {
  $this->mapping_fields['#'.$name] = $data['label'];
  }

Modified: trunk/projectmanager/index.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/projectmanager/index.php?rev=56100&r1=56099&r2=56100&view=diff
==============================================================================
--- trunk/projectmanager/index.php (original)
+++ trunk/projectmanager/index.php Tue May 10 00:05:39 2016
@@ -9,6 +9,8 @@
  * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License
  * @version $Id$
  */
+
+use EGroupware\Api;
 
 $GLOBALS['egw_info'] = array(
  'flags' => array(
@@ -29,12 +31,12 @@
  }
  else
  {
- common::egw_header();
+ $GLOBALS['egw']->framework->header();
  parse_navbar();
  echo '<p style="text-align: center; color:red; font-weight: bold;">'.lang('Your database is NOT up to date (%1 vs. %2), please run %3setup%4 to update your database.',
  $setup_info['projectmanager']['version'],$GLOBALS['egw_info']['apps']['projectmanager']['version'],
  '<a href="../setup/">','</a>')."</p>\n";
- common::egw_exit();
+ exit();
  }
 }
 unset($setup_info);
@@ -44,4 +46,4 @@
 $GLOBALS['egw']->redirect_link('/index.php',array(
  'menuaction' => $pm_id ? 'projectmanager.projectmanager_elements_ui.index' : 'projectmanager.projectmanager_ui.index',
 ));
-common::egw_exit();
+exit();

Modified: trunk/projectmanager/setup/setup.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/projectmanager/setup/setup.inc.php?rev=56100&r1=56099&r2=56100&view=diff
==============================================================================
--- trunk/projectmanager/setup/setup.inc.php (original)
+++ trunk/projectmanager/setup/setup.inc.php Tue May 10 00:05:39 2016
@@ -12,7 +12,7 @@
  */
 
 $setup_info['projectmanager']['name']      = 'projectmanager';
-$setup_info['projectmanager']['version']   = '14.2';
+$setup_info['projectmanager']['version']   = '16.1';
 $setup_info['projectmanager']['app_order'] = 5;
 $setup_info['projectmanager']['tables']    = array('egw_pm_projects','egw_pm_extra','egw_pm_elements','egw_pm_constraints','egw_pm_milestones','egw_pm_roles','egw_pm_members','egw_pm_pricelist','egw_pm_prices','egw_pm_eroles');
 $setup_info['projectmanager']['enable']    = 1;
@@ -49,10 +49,6 @@
 
 /* Dependencies for this app to work */
 $setup_info['projectmanager']['depends'][] = array(
- 'appname' => 'phpgwapi',
- 'versions' => Array('14.1')
+ 'appname' => 'api',
+ 'versions' => Array('16.1')
 );
-$setup_info['projectmanager']['depends'][] = array(
- 'appname' => 'etemplate',
- 'versions' => Array('14.1')
-);

Modified: trunk/projectmanager/setup/tables_update.inc.php
URL: http://svn.stylite.de/viewvc/egroupware/trunk/projectmanager/setup/tables_update.inc.php?rev=56100&r1=56099&r2=56100&view=diff
==============================================================================
--- trunk/projectmanager/setup/tables_update.inc.php (original)
+++ trunk/projectmanager/setup/tables_update.inc.php Tue May 10 00:05:39 2016
@@ -451,3 +451,9 @@
 
  return $GLOBALS['setup_info']['projectmanager']['currentver'] = '14.2';
 }
+
+
+function projectmanager_upgrade14_2()
+{
+ return $GLOBALS['setup_info']['projectmanager']['currentver'] = '16.1';
+}

Modified: trunk/projectmanager/templates/default/pricelist.list.xet
URL: http://svn.stylite.de/viewvc/egroupware/trunk/projectmanager/templates/default/pricelist.list.xet?rev=56100&r1=56099&r2=56100&view=diff
==============================================================================
--- trunk/projectmanager/templates/default/pricelist.list.xet (original)
+++ trunk/projectmanager/templates/default/pricelist.list.xet Tue May 10 00:05:39 2016
@@ -15,10 +15,10 @@
  <row class="th">
  <nextmatch-sortheader label="Title" id="pl_title"/>
  <vbox>
- <nextmatch-filterheader id="pm_id" no_lang="1" options="Project"/>
+ <nextmatch-filterheader id="pm_id" no_lang="1" options="Project" multiple="false"/>
  <nextmatch-sortheader label="Customer title" id="pl_customertitle"/>
  </vbox>
- <nextmatch-filterheader id="pl_billable" options="Availible"/>
+ <nextmatch-filterheader id="pl_billable" options="Availible" multiple="false"/>
  <vbox>
  <nextmatch-sortheader label="Price / Unit" id="pl_price"/>
  <nextmatch-sortheader label="Valid since" id="pl_validsince"/>


------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
eGroupWare-cvs mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/egroupware-cvs