Add php files

This commit is contained in:
2025-05-12 15:44:39 +00:00
parent c951760058
commit 82d5804ac4
9534 changed files with 2638137 additions and 0 deletions

View File

@@ -0,0 +1,88 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
global $current_user;
$dashletData['MyProjectTaskDashlet']['searchFields'] = array(
'date_entered' => array('default' => ''),
'priority' => array('default' => ''),
'date_start' => array('default' => ''),
'date_finish' => array('default' => ''),
'assigned_user_id' => array('type' => 'assigned_user_name',
'label' => 'LBL_ASSIGNED_TO',
'default' => $current_user->name),
);
$dashletData['MyProjectTaskDashlet']['columns'] = array('name' => array('width' => '45',
'label' => 'LBL_NAME',
'link' => true,
'default' => true),
'priority' => array('width' => '15',
'label' => 'LBL_PRIORITY',
'default' => true,
),
'date_start' => array('width' => '15',
'label' => 'LBL_DATE_START',
'default' => true),
'time_start' => array('width' => '15',
'label' => 'LBL_TIME_START'),
'date_finish' => array('width' => '15',
'label' => 'LBL_DATE_FINISH',
'default' => true),
'time_finish' => array('width' => '15',
'label' => 'LBL_TIME_FINISH'),
'percent_complete' => array('width' => '10',
'label' => 'LBL_PERCENT_COMPLETE',
'default' => true),
'project_name' => array('width' => '30',
'label' => 'LBL_PROJECT_NAME',
'related_fields' => array('project_id')),
'milestone_flag' => array('width' => '10',
'label' => 'LBL_MILESTONE_FLAG'),
'date_entered' => array('width' => '15',
'label' => 'LBL_DATE_ENTERED'),
'date_modified' => array('width' => '15',
'label' => 'LBL_DATE_MODIFIED'),
'created_by' => array('width' => '8',
'label' => 'LBL_CREATED'),
'assigned_user_name' => array('width' => '8',
'label' => 'LBL_LIST_ASSIGNED_USER'),
);
?>

View File

@@ -0,0 +1,46 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
global $app_strings;
$dashletMeta['MyProjectTaskDashlet'] = array('module' => 'ProjectTask',
'title' => translate('LBL_LIST_MY_PROJECT_TASKS', 'ProjectTask'),
'description' => 'A customizable view into Project Tasks',
'category' => 'Module Views');
?>

View File

@@ -0,0 +1,69 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
require_once('include/Dashlets/DashletGeneric.php');
class MyProjectTaskDashlet extends DashletGeneric {
function MyProjectTaskDashlet($id, $def = null) {
global $current_user, $app_strings;
require('modules/ProjectTask/Dashlets/MyProjectTaskDashlet/MyProjectTaskDashlet.data.php');
parent::DashletGeneric($id, $def);
if(empty($def['title'])) $this->title = translate('LBL_LIST_MY_PROJECT_TASKS', 'ProjectTask');
$this->searchFields = $dashletData['MyProjectTaskDashlet']['searchFields'];
$this->columns = $dashletData['MyProjectTaskDashlet']['columns'];
$this->seedBean = new ProjectTask();
}
function buildWhere()
{
$resultArray = parent::buildWhere();
$resultArray[] = $this->seedBean->table_name . '.' . "percent_complete != 100";
return $resultArray;
}
}
?>

87
modules/ProjectTask/Delete.php Executable file
View File

@@ -0,0 +1,87 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
$sugarbean = new ProjectTask();
// perform the delete if given a record to delete
if(empty($_REQUEST['record']))
{
$GLOBALS['log']->info('delete called without a record id specified');
}
else
{
$record = $_REQUEST['record'];
$sugarbean->retrieve($record);
if(!$sugarbean->ACLAccess('Delete')){
ACLController::displayNoAccess(true);
sugar_cleanup(true);
}
$GLOBALS['log']->info("deleting record: $record");
$sugarbean->mark_deleted($record);
}
// handle the return location variables
$return_module = empty($_REQUEST['return_module']) ? 'ProjectTask'
: $_REQUEST['return_module'];
$return_action = empty($_REQUEST['return_action']) ? 'index'
: $_REQUEST['return_action'];
$return_id = empty($_REQUEST['return_id']) ? ''
: $_REQUEST['return_id'];
$return_location = "index.php?module=$return_module&action=$return_action";
// append the return_id if given
if(!empty($return_id))
{
$return_location .= "&record=$return_id";
}
// now that the delete has been performed, return to given location
header("Location: $return_location");
?>

58
modules/ProjectTask/Menu.php Executable file
View File

@@ -0,0 +1,58 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
$module_menu = array();
global $mod_strings;
// Each index of module_menu must be an array of:
// the link url, display text for the link, and the icon name.
if(ACLController::checkAccess('Project', 'edit', true))$module_menu[] = array("index.php?module=Project&action=EditView&return_module=Project&return_action=DetailView",
$mod_strings['LNK_NEW_PROJECT'], 'CreateProject');
if(ACLController::checkAccess('Project', 'list', true))$module_menu[] = array('index.php?module=Project&action=index',
$mod_strings['LNK_PROJECT_LIST'], 'Project');
/*
if(ACLController::checkAccess('ProjectTask', 'edit', true))$module_menu[] = array("index.php?module=ProjectTask&action=EditView&return_module=ProjectTask&return_action=DetailView",
$mod_strings['LNK_NEW_PROJECT_TASK'], 'CreateProjectTask');
*/
if(ACLController::checkAccess('ProjectTask', 'list', true))$module_menu[] = array('index.php?module=ProjectTask&action=index',
$mod_strings['LNK_PROJECT_TASK_LIST'], 'ProjectTask');
?>

View File

@@ -0,0 +1,75 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
global $timedate;
global $app_strings;
global $app_list_strings;
global $current_language, $current_user;
$current_module_strings = return_module_language($current_language, 'ProjectTask');
$today = date($GLOBALS['timedate']->dbDayFormat);
$today = $timedate->handle_offset($today, $timedate->dbDayFormat, false);
$ListView = new ListView();
$seedProjectTask = new ProjectTask();
$where = "project_task.assigned_user_id='{$current_user->id}'"
. " AND (project_task.status IS NULL OR (project_task.status!='Completed' AND project_task.status!='Deferred'))"
. " AND (project_task.date_start IS NULL OR project_task.date_start <= '$today')";
$ListView->initNewXTemplate('modules/ProjectTask/MyProjectTasks.html',
$current_module_strings);
$header_text = '';
if(is_admin($current_user)
&& $_REQUEST['module'] != 'DynamicLayout'
&& !empty($_SESSION['editinplace']))
{
$header_text = "&nbsp;<a href='index.php?action=index&module=DynamicLayout&from_action=MyTasks&from_module=Tasks'>"
. SugarThemeRegistry::current()->getImage("EditLayout","border='0' alt='Edit Layout' align='bottom'")
. '</a>';
}
$ListView->setHeaderTitle($current_module_strings['LBL_LIST_MY_PROJECT_TASKS'].$header_text);
$ListView->setQuery($where, "", "date_due,priority desc", "PROJECT_TASK");
$ListView->processListView($seedProjectTask, "main", "PROJECT_TASK");
?>

46
modules/ProjectTask/Popup.php Executable file
View File

@@ -0,0 +1,46 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
require_once('include/Popups/Popup_picker.php');
$popup = new Popup_Picker();
echo $popup->process_page();
?>

View File

@@ -0,0 +1,370 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
class ProjectTask extends SugarBean {
// database table columns
var $id;
var $date_entered;
var $date_modified;
//var $assigned_user_id;
//var $modified_user_id;
//var $created_by;
var $name;
var $description;
var $project_id;
var $project_task_id;
var $date_start;
var $date_finish;
var $duration;
var $duration_unit;
var $percent_complete;
var $parent_task_id;
var $predecessors;
var $priority;
// related information
var $assigned_user_name;
var $parent_name;
var $depends_on_name;
var $email_id;
var $table_name = 'project_task';
var $object_name = 'ProjectTask';
var $module_dir = 'ProjectTask';
var $field_name_map;
var $new_schema = true;
var $relationship_fields = array(
'email_id' => 'emails',
);
//////////////////////////////////////////////////////////////////
// METHODS
//////////////////////////////////////////////////////////////////
/*
*
*/
function ProjectTask($init=true)
{
parent::SugarBean();
if ($init) {
// default value for a clean instantiation
$this->utilization = 100;
global $current_user;
if(empty($current_user))
{
$this->assigned_user_id = 1;
$admin_user = new User();
$admin_user->retrieve($this->assigned_user_id);
$this->assigned_user_name = $admin_user->user_name;
}
else
{
$this->assigned_user_id = $current_user->id;
$this->assigned_user_name = $current_user->user_name;
}
}
}
function save($check_notify = FALSE){
$id = parent::save($check_notify);
return $id;
}
/**
* overriding the base class function to do a join with users table
*/
/*
*
*/
function fill_in_additional_detail_fields()
{
$this->assigned_user_name = get_assigned_user_name($this->assigned_user_id);
$this->project_name = $this->_get_project_name($this->project_id);
/*
$this->depends_on_name = $this->_get_depends_on_name($this->depends_on_id);
if(empty($this->depends_on_name))
{
$this->depends_on_id = '';
}
$this->parent_name = $this->_get_parent_name($this->parent_id);
if(empty($this->parent_name))
{
$this->parent_id = '';
}
*/
}
/*
*
*/
function fill_in_additional_list_fields()
{
$this->assigned_user_name = get_assigned_user_name($this->assigned_user_id);
//$this->parent_name = $this->_get_parent_name($this->parent_id);
$this->project_name = $this->_get_project_name($this->project_id);
}
/*
*
*/
function get_summary_text()
{
return $this->name;
}
/*
*
*/
function _get_depends_on_name($depends_on_id)
{
$return_value = '';
$query = "SELECT name, assigned_user_id FROM {$this->table_name} WHERE id='{$depends_on_id}'";
$result = $this->db->query($query,true," Error filling in additional detail fields: ");
$row = $this->db->fetchByAssoc($result);
if($row != null)
{
$this->depends_on_name_owner = $row['assigned_user_id'];
$this->depends_on_name_mod = 'ProjectTask';
$return_value = $row['name'];
}
return $return_value;
}
function _get_project_name($project_id)
{
$return_value = '';
$query = "SELECT name, assigned_user_id FROM project WHERE id='{$project_id}'";
$result = $this->db->query($query,true," Error filling in additional detail fields: ");
$row = $this->db->fetchByAssoc($result);
if($row != null)
{
//$this->parent_name_owner = $row['assigned_user_id'];
//$this->parent_name_mod = 'Project';
$return_value = $row['name'];
}
return $return_value;
}
/*
*
*/
function _get_parent_name($parent_id)
{
$return_value = '';
$query = "SELECT name, assigned_user_id FROM project WHERE id='{$parent_id}'";
$result = $this->db->query($query,true," Error filling in additional detail fields: ");
$row = $this->db->fetchByAssoc($result);
if($row != null)
{
$this->parent_name_owner = $row['assigned_user_id'];
$this->parent_name_mod = 'Project';
$return_value = $row['name'];
}
return $return_value;
}
/*
*
*/
function build_generic_where_clause ($the_query_string)
{
$where_clauses = array();
$the_query_string = $GLOBALS['db']->quote($the_query_string);
array_push($where_clauses, "project_task.name like '$the_query_string%'");
$the_where = "";
foreach($where_clauses as $clause)
{
if($the_where != "") $the_where .= " or ";
$the_where .= $clause;
}
return $the_where;
}
function get_list_view_data(){
global $action, $currentModule, $focus, $current_module_strings, $app_list_strings, $timedate, $locale;
$today = $timedate->handle_offset(date($GLOBALS['timedate']->get_db_date_time_format(), time()), $timedate->dbDayFormat, true);
$task_fields =$this->get_list_view_array();
//$date_due = $timedate->to_db_date($task_fields['DATE_DUE'],false);
if (isset($this->parent_type))
$task_fields['PARENT_MODULE'] = $this->parent_type;
/*
if ($this->status != "Completed" && $this->status != "Deferred" ) {
$task_fields['SET_COMPLETE'] = "<a href='index.php?return_module=$currentModule&return_action=$action&return_id=" . ((!empty($focus->id)) ? $focus->id : "") . "&module=ProjectTask&action=EditView&record={$this->id}&status=Completed'>".SugarThemeRegistry::current()->getImage("close_inline","alt='Close' border='0'")."</a>";
}
if( $date_due < $today){
$task_fields['DATE_DUE']= "<font class='overdueTask'>".$task_fields['DATE_DUE']."</font>";
}else if( $date_due == $today ){
$task_fields['DATE_DUE'] = "<font class='todaysTask'>".$task_fields['DATE_DUE']."</font>";
}else{
$task_fields['DATE_DUE'] = "<font class='futureTask'>".$task_fields['DATE_DUE']."</font>";
}
*/
if ( !isset($task_fields["FIRST_NAME"]) )
$task_fields["FIRST_NAME"] = '';
if ( !isset($task_fields["LAST_NAME"]) )
$task_fields["LAST_NAME"] = '';
$task_fields['CONTACT_NAME']= $locale->getLocaleFormattedName($task_fields["FIRST_NAME"],$task_fields["LAST_NAME"]);
$task_fields['TITLE'] = '';
if (!empty($task_fields['CONTACT_NAME'])) {
$task_fields['TITLE'] .= $current_module_strings['LBL_LIST_CONTACT'].": ".$task_fields['CONTACT_NAME'];
}
return $task_fields;
}
function bean_implements($interface){
switch($interface){
case 'ACL':return true;
}
return false;
}
function listviewACLHelper(){
$array_assign = parent::listviewACLHelper();
$is_owner = false;
if(!empty($this->parent_name)){
if(!empty($this->parent_name_owner)){
global $current_user;
$is_owner = $current_user->id == $this->parent_name_owner;
}
}
if(ACLController::checkAccess('Project', 'view', $is_owner)){
$array_assign['PARENT'] = 'a';
}else{
$array_assign['PARENT'] = 'span';
}
$is_owner = false;
if(!empty($this->depends_on_name)){
if(!empty($this->depends_on_name_owner)){
global $current_user;
$is_owner = $current_user->id == $this->depends_on_name_owner;
}
}
if( ACLController::checkAccess('ProjectTask', 'view', $is_owner)){
$array_assign['PARENT_TASK'] = 'a';
}else{
$array_assign['PARENT_TASK'] = 'span';
}
return $array_assign;
}
function create_export_query(&$order_by, &$where, $relate_link_join='')
{
$custom_join = $this->custom_fields->getJOIN(true, true,$where);
if($custom_join)
$custom_join['join'] .= $relate_link_join;
$query = "SELECT
project_task.*,
users.user_name as assigned_user_name ";
if($custom_join){
$query .= $custom_join['select'];
}
$query .= " FROM project_task ";
if($custom_join){
$query .= $custom_join['join'];
}
$query .= " LEFT JOIN users
ON project_task.assigned_user_id=users.id ";
$where_auto = " project_task.deleted=0 ";
if($where != "")
$query .= "where ($where) AND ".$where_auto;
else
$query .= "where ".$where_auto;
if(!empty($order_by)){
//check to see if order by variable already has table name by looking for dot "."
$table_defined_already = strpos($order_by, ".");
if($table_defined_already === false){
//table not defined yet, define accounts to avoid "ambigous column" SQL error
$query .= " ORDER BY $order_by";
}else{
//table already defined, just add it to end of query
$query .= " ORDER BY $order_by";
}
}
return $query;
}
}
function getUtilizationDropdown($focus, $field, $value, $view) {
global $app_list_strings;
if($view == 'EditView') {
global $app_list_strings;
$html = '<select name="'.$field.'">';
$html .= get_select_options_with_id($app_list_strings['project_task_utilization_options'], $value);
$html .= '</select>';
return $html;
}
return translate('project_task_utilization_options', '', $focus->$field);
}
?>

View File

@@ -0,0 +1,101 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
require_once('include/EditView/QuickCreate.php');
class ProjectTaskQuickCreate extends QuickCreate {
var $javascript;
function process() {
global $current_user, $timedate, $app_list_strings, $current_language, $mod_strings;
$mod_strings = return_module_language($current_language, 'ProjectTask');
parent::process();
if($this->viaAJAX) { // override for ajax call
$this->ss->assign('saveOnclick', "onclick='if(check_form(\"projectTaskQuickCreate\")) return SUGAR.subpanelUtils.inlineSave(this.form.id, \"projecttask\"); else return false;'");
$this->ss->assign('cancelOnclick', "onclick='return SUGAR.subpanelUtils.cancelCreate(\"subpanel_projecttask\")';");
}
$this->ss->assign('viaAJAX', $this->viaAJAX);
$this->javascript = new javascript();
$this->javascript->setFormName('projectTaskQuickCreate');
$focus = new ProjectTask();
$this->javascript->setSugarBean($focus);
$this->javascript->addAllFields('');
$this->ss->assign('additionalScripts', $this->javascript->getScript(false));
$json = getJSONobj();
///////////////////////////////////////
///
/// SETUP PARENT POPUP
$popup_request_data = array(
'call_back_function' => 'set_return',
'form_name' => 'projectTypeQuickCreate',
'field_to_name_array' => array(
'id' => 'parent_id',
'name' => 'parent_name',
),
);
$encoded_parent_popup_request_data = $json->encode($popup_request_data);
$this->ss->assign('encoded_parent_popup_request_data', $encoded_parent_popup_request_data);
$popup_request_data = array(
'call_back_function' => 'set_return',
'form_name' => 'projectTaskQuickCreate',
'field_to_name_array' => array(
'id' => 'account_id',
'name' => 'account_name',
),
);
$encoded_popup_request_data = $json->encode($popup_request_data);
$this->ss->assign('encoded_popup_request_data', $encoded_popup_request_data);
}
}
?>

99
modules/ProjectTask/Save.php Executable file
View File

@@ -0,0 +1,99 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
$project = new ProjectTask();
if(!empty($_POST['record']))
{
$project->retrieve($_POST['record']);
}
////
//// save the fields to the ProjectTask object
////
if(isset($_REQUEST['email_id'])) $project->email_id = $_REQUEST['email_id'];
require_once('include/formbase.php');
$project = populateFromPost('', $project);
if(!isset($_REQUEST['milestone_flag']))
{
$project->milestone_flag = '0';
}
$GLOBALS['check_notify'] = false;
if (!empty($_POST['assigned_user_id']) && ($project->assigned_user_id != $_POST['assigned_user_id']) && ($_POST['assigned_user_id'] != $current_user->id)) {
$GLOBALS['check_notify'] = true;
}
if(!$project->ACLAccess('Save')){
ACLController::displayNoAccess(true);
sugar_cleanup(true);
}
if( empty($project->project_id) ) $project->project_id = $_POST['relate_id']; //quick for 5.1 till projects are revamped for 5.5 nsingh- 7/3/08
$project->save($GLOBALS['check_notify']);
if(isset($_REQUEST['form']))
{
// we are doing the save from a popup window
echo '<script>opener.window.location.reload();self.close();</script>';
die();
}
else
{
// need to refresh the page properly
$return_module = empty($_REQUEST['return_module']) ? 'ProjectTask'
: $_REQUEST['return_module'];
$return_action = empty($_REQUEST['return_action']) ? 'index'
: $_REQUEST['return_action'];
$return_id = empty($_REQUEST['return_id']) ? $project->id
: $_REQUEST['return_id'];
//if this navigation is going to list view, do not show the bean id, it will populate the mass update.
if($return_action == 'index') {
$return_id ='';
}
header("Location: index.php?module=$return_module&action=$return_action&record=$return_id");
}
?>

View File

@@ -0,0 +1,104 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
global $app_strings;
global $currentModule;
global $theme;
global $focus;
global $action;
global $focus_list;
//we don't want the parent module's string file, but rather the string file specifc to this subpanel
global $current_language;
$current_module_strings = return_module_language($current_language, 'ProjectTask');
$project_module_strings = return_module_language($current_language, 'Project');
// focus_list is the means of passing data to a SubPanelView.
$button = "<form action='index.php' method='post' name='form' id='form'>\n";
$button .= "<input type='hidden' name='module' value='ProjectTask' />\n";
$button .= "<input type='hidden' name='parent_id' value='{$focus->id}' />\n";
$button .= "<input type='hidden' name='parent_name' value='{$focus->name}' />\n";
$button .= "<input type='hidden' name='project_relation_id' value='{$focus->id}' />\n";
$button .= "<input type='hidden' name='project_relation_type' value='$currentModule' />\n";
$button .= "<input type='hidden' name='return_module' value='$currentModule' />\n";
$button .= "<input type='hidden' name='return_action' value='$action' />\n";
$button .= "<input type='hidden' name='return_id' value='{$focus->id}' />\n";
$button .= "<input type='hidden' name='action' />\n";
$button .= "<input title='"
. $app_strings['LBL_NEW_BUTTON_TITLE']
. "' accessyKey='".$app_strings['LBL_NEW_BUTTON_KEY']
. "' class='button' onclick=\"this.form.action.value='EditView'\" type='submit' name='New' value=' "
. $app_strings['LBL_NEW_BUTTON_LABEL']." ' />\n";
$button .= "</form>\n";
$ListView = new ListView();
$ListView->initNewXTemplate( 'modules/ProjectTask/SubPanelView.html',$current_module_strings);
$ListView->xTemplateAssign("EDIT_INLINE_PNG",
SugarThemeRegistry::current()->getImage('edit_inline','align="absmiddle" alt="'.$app_strings['LNK_EDIT'].'" border="0"'));
$ListView->xTemplateAssign("RETURN_URL",
"&return_module=".$currentModule."&return_action=DetailView&return_id=".$focus->id);
$header_text = '';
if(is_admin($current_user)
&& $_REQUEST['module'] != 'DynamicLayout'
&& !empty($_SESSION['editinplace']))
{
$header_text = " <a href='index.php?action=index"
. "&module=DynamicLayout"
. "&from_action=SubPanelView"
. "&from_module=ProjectTask"
. "'>"
.SugarThemeRegistry::current()->getImage("EditLayout", "border='0' alt='Edit Layout' align='bottom'")."</a>";
}
$ListView->setHeaderTitle($project_module_strings['LBL_PROJECT_TASK_SUBPANEL_TITLE'] . $header_text);
$ListView->setHeaderText($button);
$ListView->setQuery('', '', 'order_number', 'project_task');
$ListView->processListView($focus_list, 'main', 'project_task');
?>

View File

@@ -0,0 +1,85 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
/*********************************************************************************
* Description: Contains field arrays that are used for caching
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
$fields_array['ProjectTask'] = array ('column_fields' => array(
'id',
'date_entered',
'date_modified',
'assigned_user_id',
'modified_user_id',
'created_by',
'name',
'date_start',
'date_finish',
'project_id',
'duration',
'duration_unit',
'priority',
'status',
'description',
'project_task_id',
'actual_duration',
'milestone_flag',
'percent_complete',
'estimated_effort',
'utilization',
'order_number',
'task_number',
'deleted',
),
'list_fields' => array(
'id',
'parent_id',
'parent_name',
'priority',
'name',
'date_start',
'date_finish',
'percent_complete',
'status',
'assigned_user_id',
'assigned_user_name',
),
'required_fields' => array('name'=>1, 'project_id'=>2, 'project_task_id'=>3, 'duration'=>4, 'duration_unit'=>5),
);
?>

View File

@@ -0,0 +1,119 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
$mod_strings = array (
'LBL_MODULE_NAME' => 'Project Tasks',
'LBL_MODULE_TITLE' => 'Project Task: Home',
'LBL_SEARCH_FORM_TITLE' => 'Project Task Search',
'LBL_LIST_FORM_TITLE'=> 'Project Task List',
'LBL_EDIT_TASK_IN_GRID_TITLE'=> 'Edit Task In Grid',
'LBL_ID' => 'Id:',
'LBL_PROJECT_TASK_ID' => 'Project Task Id:',
'LBL_PROJECT_ID' => 'Project Id:',
'LBL_DATE_ENTERED' => 'Date Created:',
'LBL_DATE_MODIFIED' => 'Date Modified:',
'LBL_ASSIGNED_USER_ID' => 'Assigned To:',
'LBL_MODIFIED_USER_ID' => 'Modified User Id:',
'LBL_CREATED_BY' => 'Created By:',
'LBL_TEAM_ID' => 'Team:',
'LBL_NAME' => 'Name:',
'LBL_STATUS' => 'Status:',
'LBL_DATE_DUE' => 'Due Date:',
'LBL_TIME_DUE' => 'Due Time:',
'LBL_RESOURCE' => 'Resource:',
'LBL_PREDECESSORS' => 'Predecessors:',
'LBL_DATE_START' => 'Start Date:',
'LBL_DATE_FINISH' => 'Finish Date:',
'LBL_TIME_START' => 'Start Time:',
'LBL_TIME_FINISH' => 'Finish Time:',
'LBL_DURATION' => 'Duration:',
'LBL_DURATION_UNIT' => 'Duration Unit:',
'LBL_ACTUAL_DURATION' => 'Actual Duration:',
'LBL_PARENT_ID' => 'Project:',
'LBL_PARENT_TASK_ID' => 'Parent Task Id:',
'LBL_PERCENT_COMPLETE' => '% Complete:',
'LBL_PRIORITY' => 'Priority:',
'LBL_DESCRIPTION' => 'Description:',
'LBL_ORDER_NUMBER' => 'Order:',
'LBL_TASK_NUMBER' => 'Task Number:',
'LBL_TASK_ID' => 'Task ID:',
'LBL_DEPENDS_ON_ID' => 'Depends On:',
'LBL_MILESTONE_FLAG' => 'Milestone:',
'LBL_ESTIMATED_EFFORT' => 'Estimated Effort (hrs):',
'LBL_ACTUAL_EFFORT' => 'Actual Effort (hrs):',
'LBL_UTILIZATION' => 'Utilization (%):',
'LBL_DELETED' => 'Deleted:',
'LBL_LIST_ORDER_NUMBER' => 'Order',
'LBL_LIST_NAME' => 'Name',
'LBL_LIST_DAYS' => 'days',
'LBL_LIST_PARENT_NAME' => 'Project',
'LBL_LIST_PERCENT_COMPLETE' => '% Complete',
'LBL_LIST_STATUS' => 'Status',
'LBL_LIST_DURATION' => 'Duration',
'LBL_LIST_ACTUAL_DURATION' => 'Actual Duration',
'LBL_LIST_ASSIGNED_USER_ID' => 'Assigned To',
'LBL_LIST_DATE_DUE' => 'Date Due',
'LBL_LIST_DATE_START' => 'Start Date',
'LBL_LIST_DATE_FINISH' => 'Finish Date',
'LBL_LIST_PRIORITY' => 'Priority',
'LBL_LIST_CLOSE' => 'Close',
'LBL_PROJECT_NAME' => 'Project Name',
'LNK_NEW_PROJECT' => 'Create Project',
'LNK_PROJECT_LIST' => 'Project List',
'LNK_NEW_PROJECT_TASK' => 'Create Project Task',
'LNK_PROJECT_TASK_LIST' => 'Project Tasks',
'LBL_LIST_MY_PROJECT_TASKS' => 'My Project Tasks',
'LBL_DEFAULT_SUBPANEL_TITLE' => 'Project Tasks',
'LBL_NEW_FORM_TITLE' => 'New Project Task',
'LBL_ACTIVITIES_TITLE'=>'Activities',
'LBL_HISTORY_TITLE'=>'History',
'LBL_ACTIVITIES_SUBPANEL_TITLE'=>'Activities',
'LBL_HISTORY_SUBPANEL_TITLE'=>'History',
'DATE_JS_ERROR' => 'Please enter a date corresponding to the time entered',
'LBL_ASSIGNED_USER_NAME' => 'Assigned To',
'LBL_PARENT_NAME' => 'Project Name',
'LBL_LIST_PROJECT_NAME' => 'Projects',
);
?>

View File

@@ -0,0 +1,124 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/**
* Default English language strings
*
* LICENSE: The contents of this file are subject to the SugarCRM Professional
* End User License Agreement ("License") which can be viewed at
* http://www.sugarcrm.com/EULA. By installing or using this file, You have
* unconditionally agreed to the terms and conditions of the License, and You
* may not use this file except in compliance with the License. Under the
* terms of the license, You shall not, among other things: 1) sublicense,
* resell, rent, lease, redistribute, assign or otherwise transfer Your
* rights to the Software, and 2) use the Software for timesharing or service
* bureau purposes such as hosting the Software for commercial gain and/or for
* the benefit of a third party. Use of the Software may be subject to
* applicable fees and any use of the Software without first paying applicable
* fees is strictly prohibited. You do not have the right to remove SugarCRM
* copyrights from the source code or user interface.
*
* All copies of the Covered Code must include on each user interface screen:
* (i) the "Powered by SugarCRM" logo and
* (ii) the SugarCRM copyright notice
* in the same form as they appear in the distribution. See full license for
* requirements.
*
* Your Warranty, Limitations of liability and Indemnity are expressly stated
* in the License. Please refer to the License for the specific language
* governing these rights and limitations under the License. Portions created
* by SugarCRM are Copyright (C) 2005 SugarCRM, Inc.; All Rights Reserved.
*/
/*********************************************************************************
* pl_pl.lang.php,v for SugarCRM 4.5.1-->>
* Translator: Krzysztof Morawski
* All Rights Reserved.
* Any bugs report welcome: krzysiek<at>kmmgroup<dot>pl
* Contributor(s): ______________________________________..
********************************************************************************/
$mod_strings = array (
'LBL_MODULE_NAME' => 'Elementy Projektu',
'LBL_MODULE_TITLE' => 'Elementy Projektu: Strona główna',
'LBL_SEARCH_FORM_TITLE' => 'Szukaj elementu Projektu',
'LBL_LIST_FORM_TITLE'=> 'Lista elementów Projektu',
'LBL_EDIT_TASK_IN_GRID_TITLE'=> 'Edytuj elementy w siatce',
'LBL_ID' => 'ID:',
'LBL_PROJECT_TASK_ID' => 'ID elementu Projektu:',
'LBL_PROJECT_ID' => 'ID Projektu:',
'LBL_DATE_ENTERED' => 'Data rozpoczęcia:',
'LBL_DATE_MODIFIED' => 'Data modyfikacji:',
'LBL_ASSIGNED_USER_ID' => 'Przydzielony do:',
'LBL_MODIFIED_USER_ID' => 'ID użytkownika modyfikującego:',
'LBL_CREATED_BY' => 'Stworzony przez:',
'LBL_TEAM_ID' => 'Zespół:',
'LBL_NAME' => 'Nazwa:',
'LBL_STATUS' => 'Status:',
'LBL_DATE_DUE' => 'Data zakończenia:',
'LBL_TIME_DUE' => 'Czas trwania:',
'LBL_RESOURCE' => 'Źródło:',
'LBL_PREDECESSORS' => 'Poprzednik:',
'LBL_DATE_START' => 'Data rozpoczęcia:',
'LBL_DATE_FINISH' => 'Data zakończenia:',
'LBL_TIME_START' => 'Czas rozpoczęcia:',
'LBL_TIME_FINISH' => 'Czas zakończenia:',
'LBL_DURATION' => 'Czas Trwania:',
'LBL_DURATION_UNIT' => 'Jednostka czasu trwania:',
'LBL_ACTUAL_DURATION' => 'Stan zaawansowania:',
'LBL_PARENT_ID' => 'Realizacja:',
'LBL_PARENT_TASK_ID' => 'ID nadrzędnego elementu:',
'LBL_PERCENT_COMPLETE' => 'Procent zaawansowania (%):',
'LBL_PRIORITY' => 'Priorytet:',
'LBL_DESCRIPTION' => 'Opis:',
'LBL_ORDER_NUMBER' => 'Kolejność:',
'LBL_TASK_NUMBER' => 'Numer Projektu:',
'LBL_TASK_ID' => 'ID elementu:',
'LBL_DEPENDS_ON_ID' => 'Zależy od:',
'LBL_MILESTONE_FLAG' => 'Kamień milowy:',
'LBL_ESTIMATED_EFFORT' => 'Spodziewana liczba roboczogodzin:',
'LBL_ACTUAL_EFFORT' => 'Aktualna liczba roboczogodzin:',
'LBL_UTILIZATION' => 'Użycie (%):',
'LBL_DELETED' => 'Usunięty:',
'LBL_LIST_ORDER_NUMBER' => 'Kolejność',
'LBL_LIST_NAME' => 'Nazwa',
'LBL_LIST_DAYS' => 'dni',
'LBL_LIST_PARENT_NAME' => 'Projekt',
'LBL_LIST_PERCENT_COMPLETE' => 'Zaawansowanie (%)',
'LBL_LIST_STATUS' => 'Status',
'LBL_LIST_DURATION' => 'Czas trwania',
'LBL_LIST_ACTUAL_DURATION' => 'Aktualny stan zaawansowania',
'LBL_LIST_ASSIGNED_USER_ID' => 'Przydzielony do',
'LBL_LIST_DATE_DUE' => 'Okres trwania',
'LBL_LIST_DATE_START' => 'Data rozpoczęcia',
'LBL_LIST_DATE_FINISH' => 'Data zakończenia',
'LBL_LIST_PRIORITY' => 'Priorytet',
'LBL_LIST_CLOSE' => 'Zamknij',
'LBL_PROJECT_NAME' => 'Nazwa Projektu',
'LNK_NEW_PROJECT' => 'Utwórz Projekt',
'LNK_PROJECT_LIST' => 'Lista Projektu',
'LNK_NEW_PROJECT_TASK' => 'Utwórz element Projektu',
'LNK_PROJECT_TASK_LIST' => 'Elementy Projektu',
'LBL_LIST_MY_PROJECT_TASKS' => 'Moje otwarte elementy Projektu',
'LBL_DEFAULT_SUBPANEL_TITLE' => 'elementy Projektu',
'LBL_NEW_FORM_TITLE' => 'Nowy element Projektu',
'LBL_ACTIVITIES_TITLE'=>'Działania',
'LBL_HISTORY_TITLE'=>'Historia',
'LBL_ACTIVITIES_SUBPANEL_TITLE'=>'Działania',
'LBL_HISTORY_SUBPANEL_TITLE'=>'Historia',
'DATE_JS_ERROR' => 'Wprowadź datę odpowiednią dla wprowadzonej godziny',
'LBL_ASSIGNED_USER_NAME' => 'Przydzielone do',
'LBL_PARENT_NAME' => 'Nazwa Projektu',
'LBL_LIST_PROJECT_NAME' => 'Projekty',
// 'LBL_MODIFIED_NAME'=>'Nazwa modyfikującego',
// 'LBL_CREATED' => 'Utworzone przez',
// 'LBL_LIST_TEAM' => 'Zespół',
// 'LBL_TEAM' => 'Zespół:',
);
?>

View File

@@ -0,0 +1,46 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
$searchFields['ProjectTask'] =
array (
'name' => array( 'query_type'=>'default'),
'current_user_only'=> array('query_type'=>'default','db_field'=>array('assigned_user_id'),'my_items'=>true, 'vname' => 'LBL_CURRENT_USER_FILTER', 'type' => 'bool'),
'project_name' => array('query_type'=>'default','db_field'=>array('project.name')),
'assigned_user_id' => array('query_type'=>'default'),
//'status'=> array('query_type'=>'default', 'options' => 'project_task_status_options', 'template_var' => 'STATUS_FILTER')
);
?>

View File

@@ -0,0 +1,67 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
// created: 2005-11-04 15:39:46
$acldefs['ProjectTask'] = array (
'forms' =>
array (
'by_name' =>
array (
'change_project' =>
array (
'display_option' => 'disabled',
'action_option' => 'list',
'app_action' => 'EditView',
'module' => 'Project',
),
'change_parent' =>
array (
'display_option' => 'disabled',
'action_option' => 'list',
'app_action' => 'EditView',
'module' => 'ProjectTask',
),
),
),
'form_names' =>
array (
'by_id' => 'by_id',
'by_name' => 'by_name',
'DetailView' => 'DetailView',
'EditView' => 'EditView',
),
);
?>

View File

@@ -0,0 +1,68 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
function additionalDetailsProjectTask($fields) {
static $mod_strings;
if(empty($mod_strings)) {
global $current_language;
$mod_strings = return_module_language($current_language, 'ProjectTask');
}
$overlib_string = '';
if(!empty($fields['PRIORITY'])) $overlib_string .= '<b>' . $mod_strings['LBL_PRIORITY'] . '</b> ' . $fields['PRIORITY'] . '<br>';
if(!empty($fields['PERCENT_COMPLETE'])) $overlib_string .= '<b>' . $mod_strings['LBL_PERCENT_COMPLETE'] . '</b> ' . $fields['PERCENT_COMPLETE'] . '%<br>';
if(!empty($fields['ESTIMATED_EFFORT'])) $overlib_string .= '<b>' . $mod_strings['LBL_ESTIMATED_EFFORT'] . '</b> ' . $fields['ESTIMATED_EFFORT'] . '<br>';
if(!empty($fields['ACTUAL_EFFORT'])) $overlib_string .= '<b>' . $mod_strings['LBL_ACTUAL_EFFORT'] . '</b> ' . $fields['ACTUAL_EFFORT'] . '<br>';
if(!empty($fields['TASK_NUMBER'])) $overlib_string .= '<b>' . $mod_strings['LBL_TASK_NUMBER'] . '</b> ' . $fields['TASK_NUMBER'] . '<br>';
if(!empty($fields['DATE_START'])) $overlib_string .= '<b>' . $mod_strings['LBL_DATE_START'] . '</b> ' . $fields['DATE_START'] . ' ' . $fields['TIME_START'] . '<br>';
if(!empty($fields['DESCRIPTION'])) {
$overlib_string .= '<b>'. $mod_strings['LBL_DESCRIPTION'] . '</b> ' . substr($fields['DESCRIPTION'], 0, 300);
if(strlen($fields['DESCRIPTION']) > 300) $overlib_string .= '...';
}
return array('fieldToAddTo' => 'NAME',
'string' => $overlib_string,
'editLink' => "index.php?action=EditView&module=ProjectTask&return_module=ProjectTask&record={$fields['ID']}",
'viewLink' => "index.php?action=DetailView&module=ProjectTask&return_module=ProjectTask&record={$fields['ID']}");
}
?>

View File

@@ -0,0 +1,128 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
$viewdefs['ProjectTask']['DetailView'] = array(
'templateMeta' => array('maxColumns' => '2',
'widths' => array(
array('label' => '10', 'field' => '30'),
array('label' => '10', 'field' => '30')
),
'includes'=> array(
array('file'=>'modules/ProjectTask/ProjectTask.js'),
),
'form' => array(
'buttons' => array( 'EDIT',
'DUPLICATE', 'DELETE',
),
'hideAudit' => true,
),
),
'panels' =>array (
'default' =>
array (
array (
'name',
array (
'name' => 'project_task_id',
'label' => 'LBL_TASK_ID',
),
),
array (
'date_start',
'date_finish',
),
array (
array (
'name' => 'assigned_user_name',
'label' => 'LBL_ASSIGNED_USER_ID',
),
array (
),
),
array (
'status',
'priority',
),
array (
'percent_complete',
array (
'name' => 'milestone_flag',
'label' => 'LBL_MILESTONE_FLAG',
),
),
array (
array (
'name' => 'project_name',
'customCode' => '<a href="index.php?module=Project&action=DetailView&record={$fields.project_id.value}">{$fields.project_name.value}&nbsp;</a>',
'label' => 'LBL_PARENT_ID',
),
),
array (
'task_number',
'order_number',
),
array (
'estimated_effort',
'utilization',
),
array (
array (
'name' => 'description',
),
),
),
)
);
?>

View File

@@ -0,0 +1,143 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
$viewdefs['ProjectTask']['EditView'] = array(
'templateMeta' => array('maxColumns' => '2',
'widths' => array(
array('label' => '10', 'field' => '30'),
array('label' => '10', 'field' => '30')
),
'includes'=> array(
array('file'=>'modules/ProjectTask/ProjectTask.js'),
),
),
'panels' =>array (
'default' =>
array (
array (
array (
'name' => 'name',
'label' => 'LBL_NAME',
),
array (
'name' => 'project_task_id',
'label' => 'LBL_TASK_ID',
),
),
array (
array (
'name' => 'date_start',
),
array (
'name' => 'date_finish',
),
),
array (
'name' => 'assigned_user_name',
),
array (
array(
'name' => 'status',
'customCode' => '<select name="{$fields.status.name}" id="{$fields.status.name}" title="" tabindex="s" onchange="update_percent_complete(this.value);">{if isset($fields.status.value) && $fields.status.value != ""}{html_options options=$fields.status.options selected=$fields.status.value}{else}{html_options options=$fields.status.options selected=$fields.status.default}{/if}</select>',
),
'priority',
),
array(
array (
'name' => 'percent_complete',
'customCode' => '<input type="text" name="{$fields.percent_complete.name}" id="{$fields.percent_complete.name}" size="30" value="{$fields.percent_complete.value}" title="" tabindex="0" onChange="update_status(this.value);" /></tr>',
),
),
array (
'milestone_flag',
),
array (
array (
'name' => 'project_name',
'label' => 'LBL_PROJECT_NAME',
),
),
array (
'task_number',
'order_number',
),
array (
'estimated_effort',
'utilization',
),
array (
array (
'name' => 'description',
),
),
array (
array (
'name' => 'duration',
'hideLabel' => true,
'customCode' => '<input type="hidden" name="duration" id="projectTask_duration" value="0" />',
),
),
array (
array (
'name' => 'duration_unit',
'hideLabel' => true,
'customCode' => '<input type="hidden" name="duration_unit" id="projectTask_durationUnit" value="Days" />',
),
),
),
)
);
?>

View File

@@ -0,0 +1,83 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
$listViewDefs['ProjectTask'] = array(
'NAME' => array(
'width' => '40',
'label' => 'LBL_LIST_NAME',
'link' => true,
'default' => true,
'sortable' => true),
'PROJECT_NAME' => array(
'width' => '25',
'label' => 'LBL_PROJECT_NAME',
'id'=>'PROJECT_ID',
'link' => true,
'default' => true,
'sortable' => true,
'module' => 'Project',
'ACLTag' => 'PROJECT',
'related_fields' => array('project_id')),
'DATE_START' => array(
'width' => '10',
'label' => 'LBL_DATE_START',
'default' => true,
'sortable' => true),
'DATE_FINISH' => array(
'width' => '10',
'label' => 'LBL_DATE_FINISH',
'default' => true,
'sortable' => true),
'PRIORITY' => array(
'width' => '10',
'label' => 'LBL_LIST_PRIORITY',
'default' => true,
'sortable' => true),
'PERCENT_COMPLETE' => array(
'width' => '10',
'label' => 'LBL_LIST_PERCENT_COMPLETE',
'default' => true,
'sortable' => true),
'ASSIGNED_USER_NAME' => array(
'width' => '10',
'label' => 'LBL_LIST_ASSIGNED_USER_ID',
'default' => true),
);
?>

View File

@@ -0,0 +1,49 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
$popupMeta = array('moduleMain' => 'ProjectTask',
'varName' => 'PROJECT_TASK',
'orderBy' => 'name',
'whereClauses' =>
array('name' => 'project_task.name'),
'searchInputs' =>
array('name')
);
?>

View File

@@ -0,0 +1,54 @@
<?php
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
$searchdefs['ProjectTask'] = array(
'templateMeta' => array(
'maxColumns' => '3',
'widths' => array('label' => '10', 'field' => '30'),
),
'layout' => array(
'basic_search' => array(
'name',
array('name'=>'current_user_only', 'label'=>'LBL_CURRENT_USER_FILTER', 'type'=>'bool'),
),
'advanced_search' => array(
'name',
array('name' => 'project_name', 'label'=>'LBL_PROJECT_NAME' ),
array('name' => 'assigned_user_id', 'type' => 'enum', 'label' => 'LBL_ASSIGNED_TO', 'function' => array('name' => 'get_user_array', 'params' => array(false))),
),
),
);
?>

View File

@@ -0,0 +1,65 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
$GLOBALS['studioDefs']['ProjectTask'] = array(
'LBL_DETAILVIEW'=>array(
'template'=>'xtpl',
'template_file'=>'modules/ProjectTask/DetailView.html',
'php_file'=>'modules/ProjectTask/DetailView.php',
'type'=>'DetailView',
),
'LBL_EDITVIEW'=>array(
'template'=>'xtpl',
'template_file'=>'modules/ProjectTask/EditView.html',
'php_file'=>'modules/ProjectTask/EditView.php',
'type'=>'EditView',
),
'LBL_LISTVIEW'=>array(
'template'=>'listview',
'meta_file'=>'modules/ProjectTask/listviewdefs.php',
'type'=>'ListView',
),
'LBL_SEARCHFORM'=>array(
'template'=>'xtpl',
'template_file'=>'modules/ProjectTask/SearchForm.html',
'php_file'=>'modules/ProjectTask/ListView.php',
'type'=>'SearchForm',
),
);

View File

@@ -0,0 +1,124 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
$layout_defs['ProjectTask'] = array(
// list of what Subpanels to show in the DetailView
'subpanel_setup' => array(
'activities' => array(
'order' => 20,
'sort_order' => 'desc',
'sort_by' => 'date_start',
'title_key' => 'LBL_ACTIVITIES_SUBPANEL_TITLE',
'type' => 'collection',
'subpanel_name' => 'activities', //this values is not associated with a physical file.
'module'=>'Activities',
'top_buttons' => array(
array('widget_class' => 'SubPanelTopCreateTaskButton'),
array('widget_class' => 'SubPanelTopScheduleMeetingButton'),
array('widget_class' => 'SubPanelTopScheduleCallButton'),
array('widget_class' => 'SubPanelTopComposeEmailButton'),
),
'collection_list' => array(
'meetings' => array(
'module' => 'Meetings',
'subpanel_name' => 'ForActivities',
'get_subpanel_data' => 'meetings',
),
'tasks' => array(
'module' => 'Tasks',
'subpanel_name' => 'ForActivities',
'get_subpanel_data' => 'tasks',
),
'calls' => array(
'module' => 'Calls',
'subpanel_name' => 'ForActivities',
'get_subpanel_data' => 'calls',
),
)
),
'history' => array(
'order' => 30,
'sort_order' => 'desc',
'sort_by' => 'date_modified',
'title_key' => 'LBL_HISTORY_SUBPANEL_TITLE',
'type' => 'collection',
'subpanel_name' => 'history', //this values is not associated with a physical file.
'module'=>'Activities',
'top_buttons' => array(
array('widget_class' => 'SubPanelTopCreateNoteButton'),
array('widget_class' => 'SubPanelTopArchiveEmailButton'),
array('widget_class' => 'SubPanelTopSummaryButton'),
),
'collection_list' => array(
'meetings' => array(
'module' => 'Meetings',
'subpanel_name' => 'ForHistory',
'get_subpanel_data' => 'meetings',
),
'tasks' => array(
'module' => 'Tasks',
'subpanel_name' => 'ForHistory',
'get_subpanel_data' => 'tasks',
),
'calls' => array(
'module' => 'Calls',
'subpanel_name' => 'ForHistory',
'get_subpanel_data' => 'calls',
),
'notes' => array(
'module' => 'Notes',
'subpanel_name' => 'ForHistory',
'get_subpanel_data' => 'notes',
),
'emails' => array(
'module' => 'Emails',
'subpanel_name' => 'ForHistory',
'get_subpanel_data' => 'emails',
),
)
),
),
);
?>

View File

@@ -0,0 +1,64 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
$subpanel_layout = array(
'top_buttons' => array(
),
'where' => '',
'list_fields' => array(
'name'=>array(
'vname' => 'LBL_LIST_NAME',
'widget_class' => 'SubPanelDetailViewLink',
'width' => '70%',
),
'date_start'=>array(
'vname' => 'LBL_DATE_START',
'width' => '15%',
),
'date_finish'=>array(
'vname' => 'LBL_DATE_FINISH',
'width' => '15%',
),
),
);
?>

465
modules/ProjectTask/vardefs.php Executable file
View File

@@ -0,0 +1,465 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
$dictionary['ProjectTask'] = array('audited'=>true,
'table' => 'project_task',
'unified_search' => true,
'unified_search_default_enabled' => false,
'fields' => array(
'id' => array(
'name' => 'id',
'vname' => 'LBL_ID',
'required' => true,
'type' => 'id',
'reportable'=>true,
),
'date_entered' => array(
'name' => 'date_entered',
'vname' => 'LBL_DATE_ENTERED',
'type' => 'datetime',
),
'date_modified' => array(
'name' => 'date_modified',
'vname' => 'LBL_DATE_MODIFIED',
'type' => 'datetime',
),
'project_id' => array(
'name' => 'project_id',
'vname' => 'LBL_PROJECT_ID',
'required' => false,
'type' => 'id',
'reportable' => false,
'importable' => 'required',
'required' => true,
),
'project_task_id' => array(
'name' => 'project_task_id',
'vname' => 'LBL_PROJECT_TASK_ID',
'required' => true,
'type' => 'int',
'reportable' => false,
),
'name' => array(
'name' => 'name',
'vname' => 'LBL_NAME',
'required' => true,
'dbType' => 'varchar',
'type' => 'name',
'len' => 50,
'unified_search' => true,
'importable' => 'required',
'required' => true,
),
'status' => array(
'name' => 'status',
'vname' => 'LBL_STATUS',
'type' => 'enum',
'required' => false,
'options' => 'project_task_status_options',
'audited'=>true,
),
'description' => array(
'name' => 'description',
'vname' => 'LBL_DESCRIPTION',
'required' => false,
'type' => 'text',
),
'predecessors' => array(
'name' => 'predecessors',
'vname' => 'LBL_PREDECESSORS',
'required' => false,
'type' => 'text',
),
'date_start' => array(
'name' => 'date_start',
'vname' => 'LBL_DATE_START',
'type' => 'date',
'validation'=>array('type' => 'isbefore', 'compareto'=>'date_finish', 'blank' => true),
'audited'=>true,
),
'time_start' => array(
'name' => 'time_start',
'vname' => 'LBL_TIME_START',
'type' => 'int',
'reportable'=>false,
//'validation'=>array('type' => 'isbefore', 'compareto'=>'date_due', 'blank' => true),
//'audited'=>true,
),
'time_finish' => array(
'name' => 'time_finish',
'vname' => 'LBL_TIME_FINISH',
'type' => 'int',
'reportable'=>false,
// 'validation'=>array('type' => 'isbefore', 'compareto'=>'date_due', 'blank' => true),
// 'audited'=>true,
),
'date_finish' => array(
'name' => 'date_finish',
'vname' => 'LBL_DATE_FINISH',
'type' => 'date',
'validation'=>array('type' => 'isafter', 'compareto'=>'date_start', 'blank' => true),
'audited'=>true,
),
'duration' => array(
'name' => 'duration',
'vname' => 'LBL_DURATION',
'required' => true,
'type' => 'int',
),
'duration_unit' => array(
'name' => 'duration_unit',
'vname' => 'LBL_DURATION_UNIT',
'options' => 'project_duration_units_dom',
'type' => 'text',
),
'actual_duration' => array(
'name' => 'actual_duration',
'vname' => 'LBL_ACTUAL_DURATION',
'required' => false,
'type' => 'int',
),
'percent_complete' => array(
'name' => 'percent_complete',
'vname' => 'LBL_PERCENT_COMPLETE',
'type' => 'int',
'required' => false,
'audited'=>true,
),
'parent_task_id' => array(
'name' => 'parent_task_id',
'vname' => 'LBL_PARENT_TASK_ID',
'required' => false,
'type' => 'int',
'reportable'=>true,
),
'assigned_user_id' => array(
'name' => 'assigned_user_id',
'rname' => 'user_name',
'id_name' => 'assigned_user_id',
'type' => 'assigned_user_name',
'vname' => 'LBL_ASSIGNED_USER_ID',
'required' => false,
'dbType' => 'id',
'table' => 'users',
'isnull' => false,
'reportable'=>true,
'audited'=>true,
),
'modified_user_id' => array(
'name' => 'modified_user_id',
'rname' => 'user_name',
'id_name' => 'modified_user_id',
'vname' => 'LBL_MODIFIED_USER_ID',
'type' => 'assigned_user_name',
'table' => 'users',
'isnull' => 'false',
'dbType' => 'id',
'reportable'=>true,
),
'modified_by_name' =>
array (
'name' => 'modified_by_name',
'vname' => 'LBL_MODIFIED_NAME',
'type' => 'relate',
'reportable'=>false,
'source'=>'non-db',
'rname'=>'user_name',
'table' => 'users',
'id_name' => 'modified_user_id',
'module'=>'Users',
'link'=>'modified_user_link',
'duplicate_merge'=>'disabled'
),
'priority' => array(
'name' => 'priority',
'vname' => 'LBL_PRIORITY',
'type' => 'enum',
'options' => 'project_task_priority_options',
),
'created_by' => array(
'name' => 'created_by',
'rname' => 'user_name',
'id_name' => 'modified_user_id',
'vname' => 'LBL_CREATED_BY',
'type' => 'assigned_user_name',
'table' => 'users',
'isnull' => 'false',
'dbType' => 'id',
'reportable'=>true,
),
'created_by_name' =>
array (
'name' => 'created_by_name',
'vname' => 'LBL_CREATED',
'type' => 'relate',
'reportable'=>false,
'link' => 'created_by_link',
'rname' => 'user_name',
'source'=>'non-db',
'table' => 'users',
'id_name' => 'created_by',
'module'=>'Users',
'duplicate_merge'=>'disabled',
'importable' => 'false',
),
'milestone_flag' => array(
'name' => 'milestone_flag',
'vname' => 'LBL_MILESTONE_FLAG',
'type' =>'bool',
'required' => false,
),
'order_number' => array(
'name' => 'order_number',
'vname' => 'LBL_ORDER_NUMBER',
'required' => false,
'type' => 'int',
'default' => '1',
),
'task_number' => array(
'name' => 'task_number',
'vname' => 'LBL_TASK_NUMBER',
'required' => false,
'type' => 'int',
),
'estimated_effort' => array(
'name' => 'estimated_effort',
'vname' => 'LBL_ESTIMATED_EFFORT',
'required' => false,
'type' => 'int',
),
'actual_effort' => array(
'name' => 'actual_effort',
'vname' => 'LBL_ACTUAL_EFFORT',
'required' => false,
'type' => 'int',
),
'deleted' => array(
'name' => 'deleted',
'vname' => 'LBL_DELETED',
'type' => 'bool',
'required' => false,
'default' => '0',
'reportable'=>false,
),
'utilization' => array(
'name' => 'utilization',
'vname' => 'LBL_UTILIZATION',
'required' => false,
'type' => 'int',
'validation' => array('type' => 'range', 'min' => 0, 'max' => 100),
//'function' => 'getUtilizationDropdown',
'function' => array('name'=>'getUtilizationDropdown', 'returns'=>'html', 'include'=>'modules/ProjectTask/ProjectTask.php'),
'default' => 100,
),
'project_name'=> array(
'name'=>'project_name',
'rname'=>'name',
'id_name'=>'project_id',
'vname'=>'LBL_PARENT_NAME',
'type'=>'relate',
'join_name'=>'project',
'table'=>'project',
'isnull'=>'true',
'module'=>'Project',
'link'=>'project_name_link',
'massupdate'=>false,
'source'=>'non-db'),
'notes' =>
array (
'name' => 'notes',
'type' => 'link',
'relationship' => 'project_tasks_notes',
'source'=>'non-db',
'vname'=>'LBL_NOTES',
),
'tasks' =>
array (
'name' => 'tasks',
'type' => 'link',
'relationship' => 'project_tasks_tasks',
'source'=>'non-db',
'vname'=>'LBL_TASKS',
),
'meetings' =>
array (
'name' => 'meetings',
'type' => 'link',
'relationship' => 'project_tasks_meetings',
'source'=>'non-db',
'vname'=>'LBL_MEETINGS',
),
'calls' =>
array (
'name' => 'calls',
'type' => 'link',
'relationship' => 'project_tasks_calls',
'source'=>'non-db',
'vname'=>'LBL_CALLS',
),
'emails' =>
array (
'name' => 'emails',
'type' => 'link',
'relationship' => 'emails_project_task_rel',/* reldef in emails */
'source'=>'non-db',
'vname'=>'LBL_EMAILS',
),
'projects' =>
array (
'name' => 'projects',
'type' => 'link',
'relationship' => 'projects_project_tasks',
'source'=>'non-db',
'vname'=>'LBL_LIST_PARENT_NAME',
),
'created_by_link' =>
array (
'name' => 'created_by_link',
'type' => 'link',
'relationship' => 'project_tasks_created_by',
'vname' => 'LBL_CREATED_BY_USER',
'link_type' => 'one',
'module'=>'Users',
'bean_name'=>'User',
'source'=>'non-db',
),
'modified_user_link' =>
array (
'name' => 'modified_user_link',
'type' => 'link',
'relationship' => 'project_tasks_modified_user',
'vname' => 'LBL_MODIFIED_BY_USER',
'link_type' => 'one',
'module'=>'Users',
'bean_name'=>'User',
'source'=>'non-db',
),
'project_name_link' =>
array (
'name' => 'project_name_link',
'type' => 'link',
'relationship' => 'projects_project_tasks',
'vname' => 'LBL_PROJECT_NAME',
'link_type' => 'one',
'module'=>'Projects',
'bean_name'=>'Project',
'source'=>'non-db',
),
'assigned_user_link' =>
array (
'name' => 'assigned_user_link',
'type' => 'link',
'relationship' => 'project_tasks_assigned_user',
'vname' => 'LBL_ASSIGNED_TO_USER',
'link_type' => 'one',
'module'=>'Users',
'bean_name'=>'User',
'source'=>'non-db',
),
'assigned_user_name' =>
array (
'name' => 'assigned_user_name',
'rname' => 'user_name',
'id_name' => 'assigned_user_id',
'vname' => 'LBL_ASSIGNED_USER_NAME',
'type' => 'relate',
'table' => 'users',
'module' => 'Users',
'dbType' => 'varchar',
'link'=>'users',
'len' => '255',
'source'=>'non-db',
),
),
'indices' => array(
array(
'name' =>'proj_tasks_primary_key_idx',
'type' =>'primary',
'fields'=>array('id')
),
),
'relationships' => array (
'project_tasks_notes' => array('lhs_module'=> 'ProjectTask', 'lhs_table'=> 'project_task', 'lhs_key' => 'id',
'rhs_module'=> 'Notes', 'rhs_table'=> 'notes', 'rhs_key' => 'parent_id',
'relationship_type'=>'one-to-many', 'relationship_role_column'=>'parent_type',
'relationship_role_column_value'=>'ProjectTask')
,'project_tasks_tasks' => array('lhs_module'=> 'ProjectTask', 'lhs_table'=> 'project_task', 'lhs_key' => 'id',
'rhs_module'=> 'Tasks', 'rhs_table'=> 'tasks', 'rhs_key' => 'parent_id',
'relationship_type'=>'one-to-many', 'relationship_role_column'=>'parent_type',
'relationship_role_column_value'=>'ProjectTask')
,'project_tasks_meetings' => array('lhs_module'=> 'ProjectTask', 'lhs_table'=> 'project_task', 'lhs_key' => 'id',
'rhs_module'=> 'Meetings', 'rhs_table'=> 'meetings', 'rhs_key' => 'parent_id',
'relationship_type'=>'one-to-many', 'relationship_role_column'=>'parent_type',
'relationship_role_column_value'=>'ProjectTask')
,'project_tasks_calls' => array('lhs_module'=> 'ProjectTask', 'lhs_table'=> 'project_task', 'lhs_key' => 'id',
'rhs_module'=> 'Calls', 'rhs_table'=> 'calls', 'rhs_key' => 'parent_id',
'relationship_type'=>'one-to-many', 'relationship_role_column'=>'parent_type',
'relationship_role_column_value'=>'ProjectTask')
,'project_tasks_emails' => array('lhs_module'=> 'ProjectTask', 'lhs_table'=> 'project_task', 'lhs_key' => 'id',
'rhs_module'=> 'Emails', 'rhs_table'=> 'emails', 'rhs_key' => 'parent_id',
'relationship_type'=>'one-to-many', 'relationship_role_column'=>'parent_type',
'relationship_role_column_value'=>'ProjectTask')
,'project_tasks_assigned_user' =>
array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
'rhs_module'=> 'ProjectTask', 'rhs_table'=> 'project_task', 'rhs_key' => 'assigned_user_id',
'relationship_type'=>'one-to-many')
,'project_tasks_modified_user' =>
array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
'rhs_module'=> 'ProjectTask', 'rhs_table'=> 'project_task', 'rhs_key' => 'modified_user_id',
'relationship_type'=>'one-to-many')
,'project_tasks_created_by' =>
array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
'rhs_module'=> 'ProjectTask', 'rhs_table'=> 'project_task', 'rhs_key' => 'created_by',
'relationship_type'=>'one-to-many')
),
);
VardefManager::createVardef('ProjectTask','ProjectTask', array(
));
?>

View File

@@ -0,0 +1,268 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
/*********************************************************************************
* Description: This file is used to override the default Meta-data EditView behavior
* to provide customization specific to the Calls module.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
require_once('include/MVC/View/views/view.list.php');
class ProjectTaskViewList extends ViewList{
function ProjectTaskViewList(){
parent::ViewList();
}
function display(){
if(!$this->bean->ACLAccess('list')){
ACLController::displayNoAccess();
return;
}
$module = $GLOBALS['module'];
$metadataFile = null;
$foundViewDefs = false;
if(file_exists('custom/modules/' . $module. '/metadata/listviewdefs.php')){
$metadataFile = 'custom/modules/' . $module . '/metadata/listviewdefs.php';
$foundViewDefs = true;
}else{
if(file_exists('custom/modules/'.$module.'/metadata/metafiles.php')){
require_once('custom/modules/'.$module.'/metadata/metafiles.php');
if(!empty($metafiles[$module]['listviewdefs'])){
$metadataFile = $metafiles[$module]['listviewdefs'];
$foundViewDefs = true;
}
}elseif(file_exists('modules/'.$module.'/metadata/metafiles.php')){
require_once('modules/'.$module.'/metadata/metafiles.php');
if(!empty($metafiles[$module]['listviewdefs'])){
$metadataFile = $metafiles[$module]['listviewdefs'];
$foundViewDefs = true;
}
}
}
if(!$foundViewDefs && file_exists('modules/'.$module.'/metadata/listviewdefs.php')){
$metadataFile = 'modules/'.$module.'/metadata/listviewdefs.php';
}
require_once($metadataFile);
$seed = $this->bean;
if(!empty($this->bean->object_name) && isset($_REQUEST[$module.'2_'.strtoupper($this->bean->object_name).'_offset'])) {//if you click the pagination button, it will poplate the search criteria here
if(!empty($_REQUEST['current_query_by_page'])) {//The code support multi browser tabs pagination
$blockVariables = array('mass', 'uid', 'massupdate', 'delete', 'merge', 'selectCount', 'request_data', 'current_query_by_page', $module.'2_'.strtoupper($this->bean->object_name).'_ORDER_BY');
if(isset($_REQUEST['lvso'])){
$blockVariables[] = 'lvso';
}
$current_query_by_page = unserialize(base64_decode($_REQUEST['current_query_by_page']));
foreach($current_query_by_page as $search_key=>$search_value) {
if($search_key != $module.'2_'.strtoupper($this->bean->object_name).'_offset' && !in_array($search_key, $blockVariables)) {
if (!is_array($search_value)) {
$_REQUEST[$search_key] = $GLOBALS['db']->quoteForEmail($search_value);
}
else {
foreach ($search_value as $key=>&$val) {
$val = $GLOBALS['db']->quoteForEmail($val);
}
$_REQUEST[$search_key] = $search_value;
} }
}
}
}
if(!empty($_REQUEST['saved_search_select']) && $_REQUEST['saved_search_select']!='_none') {
if(empty($_REQUEST['button']) && (empty($_REQUEST['clear_query']) || $_REQUEST['clear_query']!='true')) {
$this->saved_search = loadBean('SavedSearch');
$this->saved_search->retrieveSavedSearch($_REQUEST['saved_search_select']);
$this->saved_search->populateRequest();
}
elseif(!empty($_REQUEST['button'])) { // click the search button, after retrieving from saved_search
$_SESSION['LastSavedView'][$_REQUEST['module']] = '';
unset($_REQUEST['saved_search_select']);
unset($_REQUEST['saved_search_select_name']);
}
}
$lv = new ListViewSmarty();
$displayColumns = array();
if(!empty($_REQUEST['displayColumns'])) {
foreach(explode('|', $_REQUEST['displayColumns']) as $num => $col) {
if(!empty($listViewDefs[$module][$col]))
$displayColumns[$col] = $listViewDefs[$module][$col];
}
}
else {
foreach($listViewDefs[$module] as $col => $params) {
if(!empty($params['default']) && $params['default'])
$displayColumns[$col] = $params;
}
}
global $current_user;
if (!is_admin($current_user)){
$params = array( 'massupdate' => false );
$lv->export = false;
}
else{
$params = array( 'massupdate' => true, 'export' => true);
}
if(!empty($_REQUEST['orderBy'])) {
$params['orderBy'] = $_REQUEST['orderBy'];
$params['overrideOrder'] = true;
if(!empty($_REQUEST['sortOrder'])) $params['sortOrder'] = $_REQUEST['sortOrder'];
}
$lv->displayColumns = $displayColumns;
$this->seed = $seed;
$this->module = $module;
$searchForm = null;
$storeQuery = new StoreQuery();
if(!isset($_REQUEST['query'])){
$storeQuery->loadQuery($this->module);
$storeQuery->populateRequest();
}else{
$storeQuery->saveFromRequest($this->module);
}
//search
$view = 'basic_search';
if(!empty($_REQUEST['search_form_view']))
$view = $_REQUEST['search_form_view'];
$headers = true;
if(!empty($_REQUEST['search_form_only']) && $_REQUEST['search_form_only'])
$headers = false;
elseif(!isset($_REQUEST['search_form']) || $_REQUEST['search_form'] != 'false') {
if(isset($_REQUEST['searchFormTab']) && $_REQUEST['searchFormTab'] == 'advanced_search') {
$view = 'advanced_search';
}else {
$view = 'basic_search';
}
}
$use_old_search = true;
if(file_exists('modules/'.$this->module.'/SearchForm.html')){
require_once('include/SearchForm/SearchForm.php');
$searchForm = new SearchForm($this->module, $this->seed);
}else{
$use_old_search = false;
require_once('include/SearchForm/SearchForm2.php');
if (file_exists('custom/modules/'.$this->module.'/metadata/searchdefs.php'))
{
require_once('custom/modules/'.$this->module.'/metadata/searchdefs.php');
}
elseif (!empty($metafiles[$this->module]['searchdefs']))
{
require_once($metafiles[$this->module]['searchdefs']);
}
elseif (file_exists('modules/'.$this->module.'/metadata/searchdefs.php'))
{
require_once('modules/'.$this->module.'/metadata/searchdefs.php');
}
if(!empty($metafiles[$this->module]['searchfields']))
require_once($metafiles[$this->module]['searchfields']);
elseif(file_exists('modules/'.$this->module.'/metadata/SearchFields.php'))
require_once('modules/'.$this->module.'/metadata/SearchFields.php');
$searchForm = new SearchForm($this->seed, $this->module, $this->action);
$searchForm->setup($searchdefs, $searchFields, 'include/SearchForm/tpls/SearchFormGeneric.tpl', $view, $listViewDefs);
$searchForm->lv = $lv;
}
if(isset($this->options['show_title']) && $this->options['show_title']) {
$moduleName = isset($this->seed->module_dir) ? $this->seed->module_dir : $GLOBALS['mod_strings']['LBL_MODULE_NAME'];
echo get_module_title($moduleName, $GLOBALS['mod_strings']['LBL_MODULE_TITLE'], true);
}
$where = '';
if(isset($_REQUEST['query']))
{
// we have a query
if(!empty($_SERVER['HTTP_REFERER']) && preg_match('/action=EditView/', $_SERVER['HTTP_REFERER'])) { // from EditView cancel
$searchForm->populateFromArray($storeQuery->query);
}
else {
$searchForm->populateFromRequest();
}
$where_clauses = $searchForm->generateSearchWhere(true, $this->seed->module_dir);
if (count($where_clauses) > 0 )$where = '('. implode(' ) AND ( ', $where_clauses) . ')';
$GLOBALS['log']->info("List View Where Clause: $where");
}
if($use_old_search){
switch($view) {
case 'basic_search':
$searchForm->setup();
$searchForm->displayBasic($headers);
break;
case 'advanced_search':
$searchForm->setup();
$searchForm->displayAdvanced($headers);
break;
case 'saved_views':
echo $searchForm->displaySavedViews($listViewDefs, $lv, $headers);
break;
}
}else{
echo $searchForm->display($headers);
}
if(!$headers)
return;
if(empty($_REQUEST['search_form_only']) || $_REQUEST['search_form_only'] == false){
if (!is_admin($current_user)){
$lv->setup($seed, 'include/ListView/ListViewNoMassUpdate.tpl', $where, $params);
}
else {
$lv->setup($seed, 'include/ListView/ListViewGeneric.tpl', $where, $params);
}
$savedSearchName = empty($_REQUEST['saved_search_select_name']) ? '' : (' - ' . $_REQUEST['saved_search_select_name']);
echo $lv->display();
}
}
}
?>