Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use skills #1

Open
wants to merge 33 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
51a39ba
Fix missing milestone class
nathangray Nov 16, 2017
62b4d87
Update test to match timesheet changes
nathangray Nov 27, 2017
3c1b7fd
* Projectmanager - add ACL check on timesheet before offering it as a…
nathangray Dec 5, 2017
b7e4073
Add test for creating new projects from template
nathangray Dec 8, 2017
be5084f
Fix bug where ACL check did not fully use provided user
nathangray Dec 12, 2017
3f4f0c2
* Allow private custom fields in notifications, with filtering accord…
nathangray Jan 10, 2018
6acbb6b
Rework template test to also check for updated and custom from on the…
nathangray Jan 16, 2018
18bdd66
Clean up template test, infolog specific stuff moved to its own
nathangray Jan 23, 2018
8443558
Switch phrase to one already translated - it fits better
nathangray Jan 29, 2018
c58c6f8
* ProjectManager: stop sending mail notifications with empty body whe…
ralfbecker Mar 15, 2018
d69f6ba
Add some translations, thanks to Evgen Vodopivec.
hnategh Apr 5, 2018
989ea4c
* ProjectManager: fix "used" elements filter did not contain all not …
ralfbecker Apr 27, 2018
c9a5f62
Adjust tests for removal of pe_status field
nathangray May 3, 2018
584ccf4
Adjust tests for removal of pe_status field
nathangray May 3, 2018
ed081ca
Translations from Ilias Chasapakis
ralfbecker May 14, 2018
7dfc4b9
Fix missing icon on Add element cancel button, add width to dialog
nathangray May 14, 2018
d2f0166
* Timesheet - Fix general price list items unavailable after clicking…
nathangray Jun 4, 2018
a9edcd8
* Projectmanager - Make project title a link to element list
nathangray Jun 4, 2018
675baa6
Fix link title placeholders not working
nathangray Oct 4, 2018
f8b82b3
pending translations from our translation server
ralfbecker Oct 26, 2018
d0454c8
Import/Export - change signature of method that gets options to allow…
nathangray Nov 29, 2018
7c6e2c4
Import/Export - change signature of method that gets options to allow…
nathangray Nov 29, 2018
b41f86b
Import/Export - change signature of method that gets options to allow…
nathangray Nov 29, 2018
5813533
Import/Export - change signature of method that gets options to allow…
nathangray Nov 30, 2018
736b0ac
converting turkish translations to utf-8
ralfbecker Dec 10, 2018
9487555
* Projectmanager: move format for ID generation from config to settin…
ralfbecker Jan 10, 2019
01b3d8f
Fix permission issues with private projects and groups as project mem…
nathangray Feb 6, 2019
0cef63a
WIP EGroupware installation via Composer instead of myrepos
ralfbecker Feb 11, 2019
9606e3a
Make sure template is loaded before we try to show its DOMContainer, …
nathangray Mar 25, 2019
a7dd878
Always show projectmanager UI, no need for ACL check for that
nathangray Mar 26, 2019
456a6fb
pending translations from our translation server
ralfbecker Jun 6, 2019
a92c247
Exclude ignored entries from cumulation
nathangray Jun 3, 2019
023b264
Projectmanager - Fix error "Too few arguments..." when creating a con…
nathangray Jun 13, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 24 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
"name": "egroupware/projectmanager",
"description": "EGroupware project-management application",
"type": "egroupware-app",
"homepage": "https://www.egroupware.org/",
"license": "GPL-2.0-or-later",
"authors": [
{
"name": "Ralf Becker",
"email": "rb@egroupware.org"
},
{
"name": "Hadi Nategh",
"email": "hn@egroupware.org"
},
{
"name": "Nathan Gray",
"email": "ng@egroupware.org"
}
],
"require": {
"egroupware/egroupware": "self.version"
}
}
137 changes: 87 additions & 50 deletions inc/class.projectmanager_bo.inc.php

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion inc/class.projectmanager_datasource.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ function get($data_id)
// return the projectmembers as resources
$ds['pe_resources'] = $data['pm_members'] ? array_keys($data['pm_members']) : array($data['pm_creator']);
$ds['pe_details'] = $data['pm_description'];
$ds['pe_status'] = $data['pm_status'];

// use completition calculated by times, if completion is only set from the elements
// if re is set, use this
Expand Down
21 changes: 11 additions & 10 deletions inc/class.projectmanager_elements_bo.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ class projectmanager_elements_bo extends projectmanager_elements_so
*/
var $status_filter = array(
'all' => false,
'used' => array('new','regular'),
'used' => '!ignore',
'new' => 'new',
'ignored' => 'ignore',
);
Expand Down Expand Up @@ -261,12 +261,8 @@ function &update($app,$id,$pe_id=0,$pm_id=null,$update_project=true,$extra_keys=
$this->data['pm_id'] = $pm_id;
$this->data['pe_id'] = $pe_id;
$this->data['pe_overwrite'] = 0; // none set so far
$this->data['pe_status']= 'new';

// only set status if it's not set by the datasource
if (!isset($this->data['pe_status']))
{
$this->data['pe_status']= 'new';
}
// if user linking has no ADD rights, the entry is set to ignored
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')
Expand Down Expand Up @@ -563,11 +559,11 @@ function save($keys=null,$touch_modified=true,$update_project=-1)
* deletes a project-element or all project-elements of a project, reimplemented to remove the link too
*
* @param array/int $keys if given array with pm_id and/or pe_id or just an integer pe_id
* @param boolean $delete_sources=false true=delete datasources of the elements too (if supported by the datasource), false dont do it
* @param boolean $unlink = false Internal use only, passing false will skip the unlinking steps
* @param boolean $delete_sources =false true=delete datasources of the elements too (if supported by the datasource), false dont do it
* @param boolean $unlink =true Internal use only, passing false will skip the unlinking steps
* @return int affected rows, should be 1 if ok, 0 if an error
*/
function delete($keys=null,$delete_sources=false, $unlink = true)
function delete($keys=null,$delete_sources=false, $unlink=true)
{
if ((int) static::DEBUG >= 1 || static::DEBUG === 'delete') {
projectmanager_bo::debug_message("projectmanager_elements_bo::delete(" . print_r($keys, true) . ",$delete_sources) this->data[pm_id] = " . $this->data['pm_id']);
Expand Down Expand Up @@ -927,7 +923,12 @@ function search($criteria,$only_keys=True,$order_by='',$extra_cols='',$wildcard=
}
if ($cumulate_in) // do we have something (timesheets) to cumulate
{
foreach(parent::search(array('pe_id' => array_keys($cumulate_in)),false) as $to_cumulate)
foreach(parent::search(
array('pe_id' => array_keys($cumulate_in))
,false,'','','',False, 'AND',false,array(
'pe_status != "ignore"'
)
) as $to_cumulate)
{
// get the row, where the entry cumulates
if (($k = array_search($cumulate_in[$to_cumulate['pe_id']],$row_pe_ids)) !== false)
Expand Down
27 changes: 20 additions & 7 deletions inc/class.projectmanager_elements_ui.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -508,6 +508,12 @@ function get_rows(&$query_in,&$rows,&$readonlys)
if ($this->status_filter[$query['filter']])
{
$query['col_filter']['pe_status'] = $this->status_filter[$query['filter']];

if ($query['col_filter']['pe_status'][0] === '!')
{
$query['col_filter'][] = 'pe_status != '.$this->db->quote(substr($query['col_filter']['pe_status'], 1));
unset($query['col_filter']['pe_status']);
}
}
else
{
Expand Down Expand Up @@ -816,15 +822,22 @@ protected function get_actions()
'checkbox' => true,
'isChecked' => 'javaScript:app.projectmanager.is_ignored',
'onExecute' => 'javaScript:app.projectmanager.ignore_action'
),
'timesheet' => array(
)
);
$group++;
if ($GLOBALS['egw_info']['user']['apps']['timesheet'])
{
$actions['timesheet'] = array(
'icon' => 'timesheet/navbar',
'caption' => 'Timesheet',
'egw_open' => 'add-timesheet',
'allowOnMultiple' => false,
'group' => ++$group,
),
'infolog-subs' => array(
'group' => $group,
);
}
if ($GLOBALS['egw_info']['user']['apps']['infolog'])
{
$actions['infolog-subs'] = array(
'icon' => 'infolog/navbar',
'caption' => 'View subs',
'hint' => 'View all subs of this entry',
Expand All @@ -835,8 +848,8 @@ protected function get_actions()
'url' => 'menuaction=infolog.infolog_ui.index&action=sp&action_id=$id',
'targetapp' => 'infolog',
'hideOnDisabled' => true
),
);
);
}
if ($GLOBALS['egw_info']['user']['apps']['filemanager'])
{
$actions['filemanager'] = array(
Expand Down
67 changes: 47 additions & 20 deletions inc/class.projectmanager_export_elements_csv.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
/**
* export project elements to CSV
*/
class projectmanager_export_elements_csv implements importexport_iface_export_plugin {
class projectmanager_export_elements_csv implements importexport_iface_export_plugin
{

// Used in conversions
static $types = array(
Expand All @@ -37,20 +38,25 @@ class projectmanager_export_elements_csv implements importexport_iface_export_pl
*
* @param egw_record $_definition
*/
public function export( $_stream, importexport_definition $_definition) {
public function export( $_stream, importexport_definition $_definition)
{
$options = $_definition->plugin_options;
$no_project = true;

if($options['pm_id']) {
if($options['pm_id'])
{
$_REQUEST['pm_id'] = $options['pm_id'];
$no_project = false;
} elseif(!$GLOBALS['egw_info']['user']['preferences']['projectmanager']['current_project']) {
}
elseif(!$GLOBALS['egw_info']['user']['preferences']['projectmanager']['current_project'])
{
// Fake a pm_id so elements_ui works
$_REQUEST['pm_id'] = 1;
}
$ui = new projectmanager_elements_ui();
$selection = array();
if ($options['selection'] == 'selected') {
if ($options['selection'] == 'selected')
{
// ui selection with 'Use search results'
$query = $old_query = Api\Cache::getSession('projectmanager', 'projectelements_list');
$query['num_rows'] = -1; // all
Expand Down Expand Up @@ -161,23 +167,28 @@ public function export( $_stream, importexport_definition $_definition) {

// $options['selection'] is array of identifiers as this plugin doesn't
// support other selectors atm.
foreach ($selection as $record) {
foreach ($selection as $record)
{
if(!is_array($record) || !$record['pe_id']) continue;
if(is_array($record['pe_resources'])) {
if(is_array($record['pe_resources']))
{
$resources = array();
foreach($record['pe_resources'] as $resource) {
foreach($record['pe_resources'] as $resource)
{
$resources[] = Api\Accounts::username($resource);
}
$record['pe_resources'] = implode(',', $resources);
}
$element = new projectmanager_egw_record_element();
$element->set_record($record);
if($options['mapping']['pm_title']) {
if($options['mapping']['pm_title'])
{
$project = ExecMethod('projectmanager.projectmanager_bo.read', $element->pm_id);
$element->pm_title = $project['pm_title'];
}

if($options['convert']) {
if($options['convert'])
{
importexport_export_csv::convert($element, self::$types);
}
$this->convert($element, $options);
Expand All @@ -192,7 +203,8 @@ public function export( $_stream, importexport_definition $_definition) {
*
* @return string name
*/
public static function get_name() {
public static function get_name()
{
return lang('Project element CSV export');
}

Expand All @@ -201,7 +213,8 @@ public static function get_name() {
*
* @return string descriprion
*/
public static function get_description() {
public static function get_description()
{
return lang("Exports a list of project elements to a CSV File.");
}

Expand All @@ -210,11 +223,13 @@ public static function get_description() {
*
* @return string suffix
*/
public static function get_filesuffix() {
public static function get_filesuffix()
{
return 'csv';
}

public static function get_mimetype() {
public static function get_mimetype()
{
return 'text/csv';
}

Expand All @@ -234,18 +249,29 @@ public function get_filename()
}

/**
* return Api\Html for options.
* this way the plugin has all opportunities for options tab
* Return array of settings for export dialog
*
* @param $definition Specific definition
*
* @return array (
* name => string,
* content => array,
* sel_options => array,
* readonlys => array,
* preserv => array,
* )
*/
public function get_options_etpl() {
public function get_options_etpl(importexport_definition &$definition = NULL)
{
return false;
}

/**
* returns selectors information
*
*/
public function get_selectors_etpl() {
public function get_selectors_etpl()
{
return array(
'name' => 'projectmanager.export_elements_csv_selectors',
'content' => array(
Expand All @@ -261,7 +287,8 @@ public function get_selectors_etpl() {
*
* @param projectmanager_egw_record_project $record Record to be converted
*/
protected static function convert(projectmanager_egw_record_element &$record, array $options = array()) {
protected static function convert(projectmanager_egw_record_element &$record, array $options = array())
{
foreach(array('pe_used_time', 'pe_planned_time', 'pe_replanned_time') as $duration) {
switch($options[$duration]) {
case 'd':
Expand All @@ -281,7 +308,7 @@ public static function get_egw_record_class()
{
return 'projectmanager_egw_record_element';
}

/**
* Adjust automatically generated filter fields
*/
Expand Down
16 changes: 13 additions & 3 deletions inc/class.projectmanager_export_projects_csv.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -236,11 +236,21 @@ public function get_filename()
}

/**
* return html for options.
* this way the plugin has all opportunities for options tab
* Return array of settings for export dialog
*
* @param $definition Specific definition
*
* @return array (
* name => string,
* content => array,
* sel_options => array,
* readonlys => array,
* preserv => array,
* )
*/
public function get_options_etpl() {
public function get_options_etpl(importexport_definition &$definition = NULL)
{
return false;
}

/**
Expand Down