Squashed 'public/legacy/' content from commit 817a12dc0

git-subtree-dir: public/legacy
git-subtree-split: 817a12dc0c30c189f56d5cb1f7dc37a9631bdbe3
This commit is contained in:
Dillon-Brown 2021-03-31 15:37:32 +01:00
commit 8e4cc94994
9769 changed files with 1617695 additions and 0 deletions

View file

@ -0,0 +1,108 @@
<?php
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
/**
*
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2018 SalesAgility Ltd.
*
* 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 and "Supercharged by SuiteCRM" logo. If the display of the logos is not
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
global $current_user;
$dashletData['MyTasksDashlet']['searchFields'] = array('name' => array('default' => ''),
'priority' => array('default' => ''),
'status' => array('default' => array('Not Started', 'In Progress', 'Pending Input')),
'date_entered' => array('default' => ''),
'date_start' => array('default' => ''),
'date_due' => array('default' => ''),
'assigned_user_id' => array('type' => 'assigned_user_name',
'label' => 'LBL_ASSIGNED_TO',
'default' => $current_user->name));
$dashletData['MyTasksDashlet']['columns'] = array('set_complete' => array('width' => '1',
'label' => 'LBL_LIST_CLOSE',
'default' => true,
'sortable' => false),
'name' => array('width' => '40',
'label' => 'LBL_SUBJECT',
'link' => true,
'default' => true),
'parent_name' => array('width' => '30',
'label' => 'LBL_LIST_RELATED_TO',
'sortable' => false,
'dynamic_module' => 'PARENT_TYPE',
'link' => true,
'id' => 'PARENT_ID',
'ACLTag' => 'PARENT',
'related_fields' => array('parent_id', 'parent_type'),
'default' => true,
),
'priority' => array('width' => '10',
'label' => 'LBL_PRIORITY',
'default' => true),
'status' => array('width' => '8',
'label' => 'LBL_STATUS',
'default' => true),
'date_start' => array('width' => '15',
'label' => 'LBL_START_DATE',
'default' => true),
'time_start' => array('width' => '15',
'label' => 'LBL_START_TIME',
'default' => false),
'date_due' => array('width' => '15',
'label' => 'LBL_DUE_DATE',
'default' => true),
'date_entered' => array('width' => '15',
'label' => 'LBL_DATE_ENTERED'),
'date_modified' => array('width' => '15',
'label' => 'LBL_DATE_MODIFIED'),
'created_by' => array('width' => '8',
'label' => $GLOBALS['app_strings']['LBL_CREATED'],
'sortable' => false),
'assigned_user_name' => array('width' => '8',
'label' => 'LBL_LIST_ASSIGNED_USER'),
'contact_name' => array('width' => '8',
'label' => 'LBL_LIST_CONTACT',
'link' => true,
'id' => 'CONTACT_ID',//bug # 38712 it gave error on clicking on contacts from
'module' => 'Contacts',//my open tasks dashlet because some of the parameters were not set
'ACLTag' => 'CONTACT',// like id, link etc.
'related_fields' => array('contact_id')),
);

View file

@ -0,0 +1,52 @@
<?php
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
/**
*
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2018 SalesAgility Ltd.
*
* 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 and "Supercharged by SuiteCRM" logo. If the display of the logos is not
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
global $app_strings;
$dashletMeta['MyTasksDashlet'] = array('module' => 'Tasks',
'title' => translate('LBL_LIST_MY_TASKS', 'Tasks'),
'description' => 'A customizable view into Tasks',
'category' => 'Module Views');

View file

@ -0,0 +1,71 @@
<?php
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
/**
*
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2018 SalesAgility Ltd.
*
* 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 and "Supercharged by SuiteCRM" logo. If the display of the logos is not
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
require_once('include/Dashlets/DashletGeneric.php');
class MyTasksDashlet extends DashletGeneric
{
public function __construct($id, $def = null)
{
global $current_user, $app_strings;
require('modules/Tasks/Dashlets/MyTasksDashlet/MyTasksDashlet.data.php');
parent::__construct($id, $def);
if (empty($def['title'])) {
$this->title = translate('LBL_LIST_MY_TASKS', 'Tasks');
}
$this->searchFields = $dashletData['MyTasksDashlet']['searchFields'];
$this->columns = $dashletData['MyTasksDashlet']['columns'];
$this->seedBean = BeanFactory::newBean('Tasks');
}
}

54
modules/Tasks/Menu.php Executable file
View file

@ -0,0 +1,54 @@
<?php
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
/**
*
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2018 SalesAgility Ltd.
*
* 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 and "Supercharged by SuiteCRM" logo. If the display of the logos is not
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
global $mod_strings,$app_strings;
if (ACLController::checkAccess('Tasks', 'edit', true)) {
$module_menu[]=array("index.php?module=Tasks&action=EditView&return_module=Tasks&return_action=DetailView", $mod_strings['LNK_NEW_TASK'],"Create");
}
if (ACLController::checkAccess('Tasks', 'list', true)) {
$module_menu[]=array("index.php?module=Tasks&action=index&return_module=Tasks&return_action=DetailView", $mod_strings['LNK_TASK_LIST'],"List");
}
if (ACLController::checkAccess('Tasks', 'import', true)) {
$module_menu[] =array("index.php?module=Import&action=Step1&import_module=Tasks&return_module=Tasks&return_action=index", $mod_strings['LNK_IMPORT_TASKS'],"Import", 'Contacts');
}

69
modules/Tasks/MyTasks.html Executable file
View file

@ -0,0 +1,69 @@
<!--
/**
*
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2018 SalesAgility Ltd.
*
* 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 and "Supercharged by SuiteCRM" logo. If the display of the logos is not
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
/**
*/
-->
<!-- BEGIN: main -->
<table cellpadding="0" cellspacing="0" width="100%" border="0" class="list view">
<!-- BEGIN: list_nav_row -->
{PAGINATION}
<!-- END: list_nav_row -->
<tr height="20">
<td scope="col" align="left" NOWRAP>{CHECKALL}</td>
<td scope="col" width="3%" align="center" NOWRAP><span><a href="{ORDER_BY}status" class="listViewThLinkS1">{MOD.LBL_LIST_CLOSE}{arrow_start}{status_arrow}{arrow_end}</a></span></td>
<td scope="col" width="57%" align="left" NOWRAP><span><a href="{ORDER_BY}name" class="listViewThLinkS1">{MOD.LBL_LIST_SUBJECT}{arrow_start}{name_arrow}{arrow_end}</a></span></td>
<td scope="col" width="20%" NOWRAP><span><a href="{ORDER_BY}priority" class="listViewThLinkS1">{MOD.LBL_LIST_PRIORITY}{arrow_start}{priority_arrow}{arrow_end}</a></span></td>
<td scope="col" width="20%" NOWRAP><span><a href="{ORDER_BY}date_due" class="listViewThLinkS1">{MOD.LBL_LIST_DUE_DATE}{arrow_start}{date_due_arrow}{arrow_end}</a></span></td>
</tr>
<!-- BEGIN: row -->
<tr height="20" class="{ROW_COLOR}S1">
<td valign='top'>{PREROW}</td>
<td nowrap align=CENTER valign=TOP><span>{TASK.SET_COMPLETE}</span></td>
<td scope="row" valign=TOP><span><{TAG.MAIN} title='{TASK.TITLE}' href="{URL_PREFIX}index.php?action=DetailView&module=Tasks&record={TASK.ID}" >{TASK.NAME}</{TAG.MAIN}></span></td>
<td nowrap valign=TOP><span>{TASK.PRIORITY}</span></td>
<td nowrap valign=TOP><span>{TASK.DATE_DUE}</span></td>
</tr>
<!-- END: row -->
</table>
<!-- END: main -->

69
modules/Tasks/MyTasks.php Executable file
View file

@ -0,0 +1,69 @@
<?php
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
/**
*
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2018 SalesAgility Ltd.
*
* 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 and "Supercharged by SuiteCRM" logo. If the display of the logos is not
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
global $app_strings;
global $app_list_strings;
global $current_language, $current_user, $timedate;
$current_module_strings = return_module_language($current_language, 'Tasks');
$tomorrow = $timedate->getNow()->get("+1 day")->asDb();
$ListView = new ListView();
$seedTasks = BeanFactory::newBean('Tasks');
$where = "tasks.assigned_user_id='". $current_user->id ."' and (tasks.status is NULL or (tasks.status!='Completed' and tasks.status!='Deferred')) ";
$where .= "and (tasks.date_start is NULL or ";
$where .= $seedTasks->db->convert(
$seedTasks->db->convert("tasks.date_start", "date_format", '%Y-%m-%d'),
"CONCAT",
array("' '", $seedTasks->db->convert("tasks.time_start", "time_format"))
). " <= ".$seedTasks->db->quoted($tomorrow);
$ListView->initNewXTemplate('modules/Tasks/MyTasks.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' align='bottom'", null, null, '.gif', $mod_strings['LBL_EDITLAYOUT'])."</a>";
}
$ListView->setHeaderTitle($current_module_strings['LBL_LIST_MY_TASKS'].$header_text);
$ListView->setQuery($where, "", "date_due,priority desc", "TASK");
$ListView->processListView($seedTasks, "main", "TASK");

158
modules/Tasks/Save.php Executable file
View file

@ -0,0 +1,158 @@
<?php
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
/**
*
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2018 SalesAgility Ltd.
*
* 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 and "Supercharged by SuiteCRM" logo. If the display of the logos is not
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
/*********************************************************************************
* Description: Saves an Account record and then redirects the browser to the
* defined return URL.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
$focus = BeanFactory::newBean('Tasks');
if (!isset($prefix)) {
$prefix='';
}
global $timedate;
$time_format = $timedate->get_user_time_format();
$time_separator = ":";
if (preg_match('/\d+([^\d])\d+([^\d]*)/s', $time_format, $match)) {
$time_separator = $match[1];
}
if (!empty($_POST[$prefix.'due_meridiem'])) {
$_POST[$prefix.'time_due'] = $timedate->merge_time_meridiem($_POST[$prefix.'time_due'], $timedate->get_time_format(), $_POST[$prefix.'due_meridiem']);
}
if (!empty($_POST[$prefix.'start_meridiem'])) {
$_POST[$prefix.'time_start'] = $timedate->merge_time_meridiem($_POST[$prefix.'time_start'], $timedate->get_time_format(), $_POST[$prefix.'start_meridiem']);
}
if (isset($_POST[$prefix.'time_due']) && !empty($_POST[$prefix.'time_due'])) {
$_POST[$prefix.'date_due'] = $_POST[$prefix.'date_due'] . ' ' . $_POST[$prefix.'time_due'];
}
if (isset($_POST[$prefix.'time_start']) && !empty($_POST[$prefix.'time_start'])) {
$_POST[$prefix.'date_start'] = $_POST[$prefix.'date_start'] . ' ' . $_POST[$prefix.'time_start'];
}
require_once('include/formbase.php');
$focus = populateFromPost('', $focus);
if (!$focus->ACLAccess('Save')) {
ACLController::displayNoAccess(true);
sugar_cleanup(true);
}
if (isCloseAndCreateNewPressed()) {
$focus->status = 'Completed';
}
if (!isset($_POST['date_due_flag'])) {
$focus->date_due_flag = 0;
}
if (!isset($_POST['date_start_flag'])) {
$focus->date_start_flag = 0;
}
if ($focus->date_due_flag != 'off' && $focus->date_due_flag != 1) {
$focus->date_due = '';
$focus->time_due = '';
}
//if only the time is passed in, without a date, then string length will be 7
if (isset($_REQUEST['date_due']) && strlen(trim($_REQUEST['date_due']))<8) {
//no date set, so clear out field, and set the rest flag to true
$focus->date_due_flag = 1;
$focus->date_due = '';
}
//if only the time is passed in, without a date, then string length will be 7
if (isset($_REQUEST['date_start']) && strlen(trim($_REQUEST['date_start']))<8) {
//no date set, so clear out field, and set the rest flag to true
$focus->date_start_flag = 1;
$focus->date_start = '';
}
///////////////////////////////////////////////////////////////////////////////
//// INBOUND EMAIL HANDLING
///////////////////////////////////////////////////////////////////////////////
if (isset($_REQUEST['inbound_email_id']) && !empty($_REQUEST['inbound_email_id'])) {
// fake this case like it's already saved.
$focus->save();
$email = BeanFactory::newBean('Emails');
$email->retrieve($_REQUEST['inbound_email_id']);
$email->parent_type = 'Tasks';
$email->parent_id = $focus->id;
$email->assigned_user_id = $current_user->id;
$email->status = 'read';
$email->save();
$email->load_relationship('tasks');
$email->tasks->add($focus->id);
header("Location: index.php?&module=Emails&action=EditView&type=out&inbound_email_id=".$_REQUEST['inbound_email_id']."&parent_id=".$email->parent_id."&parent_type=".$email->parent_type.'&start='.$_REQUEST['start'].'&assigned_user_id='.$current_user->id);
exit();
}
//// END INBOUND EMAIL HANDLING
///////////////////////////////////////////////////////////////////////////////
// CCL - Bugs 41103 and 43751. 41103 address the issue where the parent_id is set, but
// the relate_id field overrides the relationship. 43751 fixes the problem where the relate_id and
// parent_id are the same value (in which case it should just use relate_id) by adding the != check
if ((!empty($_REQUEST['relate_id']) && !empty($_REQUEST['parent_id'])) && ($_REQUEST['relate_id'] != $_REQUEST['parent_id'])) {
$_REQUEST['relate_id'] = false;
}
// avoid undefined index
if (!isset($GLOBALS['check_notify'])) {
$GLOBALS['check_notify'] = false;
}
$focus->save($GLOBALS['check_notify']);
$return_id = $focus->id;
handleRedirect($return_id, 'Tasks');

447
modules/Tasks/Task.php Executable file
View file

@ -0,0 +1,447 @@
<?php
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
/**
*
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2018 SalesAgility Ltd.
*
* 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 and "Supercharged by SuiteCRM" logo. If the display of the logos is not
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
// Task is used to store customer information.
class Task extends SugarBean
{
public $field_name_map;
// Stored fields
public $id;
public $date_entered;
public $date_modified;
public $assigned_user_id;
public $modified_user_id;
public $created_by;
public $created_by_name;
public $modified_by_name;
public $description;
public $name;
public $status;
public $date_due_flag;
public $date_due;
public $time_due;
public $date_start_flag;
public $date_start;
public $time_start;
public $priority;
public $parent_type;
public $parent_id;
public $contact_id;
public $parent_name;
public $contact_name;
public $contact_phone;
public $contact_email;
public $assigned_user_name;
//bug 28138 todo
// var $default_task_name_values = array('Assemble catalogs', 'Make travel arrangements', 'Send a letter', 'Send contract', 'Send fax', 'Send a follow-up letter', 'Send literature', 'Send proposal', 'Send quote', 'Call to schedule meeting', 'Setup evaluation', 'Get demo feedback', 'Arrange introduction', 'Escalate support request', 'Close out support request', 'Ship product', 'Arrange reference call', 'Schedule training', 'Send local user group information', 'Add to mailing list');
public $table_name = "tasks";
public $object_name = "Task";
public $module_dir = 'Tasks';
public $importable = true;
// This is used to retrieve related fields from form posts.
public $additional_column_fields = array('assigned_user_name', 'assigned_user_id', 'contact_name', 'contact_phone', 'contact_email', 'parent_name');
public function __construct()
{
parent::__construct();
}
public $new_schema = true;
public function save($check_notify = false)
{
if (empty($this->status)) {
$this->status = $this->getDefaultStatus();
}
return parent::save($check_notify);
}
public function get_summary_text()
{
return (string)$this->name;
}
public function create_export_query($order_by, $where, $relate_link_join='')
{
$custom_join = $this->getCustomJoin(true, true, $where);
$custom_join['join'] .= $relate_link_join;
$contact_required = stristr($where, "contacts");
if ($contact_required) {
$query = "SELECT tasks.*, contacts.first_name, contacts.last_name, users.user_name as assigned_user_name ";
$query .= $custom_join['select'];
$query .= " FROM contacts, tasks ";
$where_auto = "tasks.contact_id = contacts.id AND tasks.deleted=0 AND contacts.deleted=0";
} else {
$query = 'SELECT tasks.*, users.user_name as assigned_user_name ';
$query .= $custom_join['select'];
$query .= ' FROM tasks ';
$where_auto = "tasks.deleted=0";
}
$query .= $custom_join['join'];
$query .= " LEFT JOIN users ON tasks.assigned_user_id=users.id ";
if ($where != "") {
$query .= "where $where AND ".$where_auto;
} else {
$query .= "where ".$where_auto;
}
$order_by = $this->process_order_by($order_by);
if (empty($order_by)) {
$order_by = 'tasks.name';
}
$query .= ' ORDER BY ' . $order_by;
return $query;
}
public function fill_in_additional_detail_fields()
{
parent::fill_in_additional_detail_fields();
global $app_strings;
if (isset($this->contact_id)) {
$contact = BeanFactory::newBean('Contacts');
$contact->retrieve($this->contact_id);
if ($contact->id != "") {
$this->contact_name = $contact->full_name;
$this->contact_name_owner = $contact->assigned_user_id;
$this->contact_name_mod = 'Contacts';
$this->contact_phone = $contact->phone_work;
$this->contact_email = $contact->emailAddress->getPrimaryAddress($contact);
} else {
$this->contact_name_mod = '';
$this->contact_name_owner = '';
$this->contact_name='';
$this->contact_email = '';
$this->contact_id='';
}
}
$this->fill_in_additional_parent_fields();
}
public function fill_in_additional_parent_fields()
{
$this->parent_name = '';
global $app_strings, $beanFiles, $beanList, $locale;
if (! isset($beanList[$this->parent_type])) {
$this->parent_name = '';
return;
}
$beanType = $beanList[$this->parent_type];
require_once($beanFiles[$beanType]);
$parent = new $beanType();
if (is_subclass_of($parent, 'Person')) {
$query = "SELECT first_name, last_name, assigned_user_id parent_name_owner from $parent->table_name where id = '$this->parent_id'";
} else {
if (is_subclass_of($parent, 'File')) {
$query = "SELECT document_name, assigned_user_id parent_name_owner from $parent->table_name where id = '$this->parent_id'";
} else {
$query = "SELECT name ";
if (isset($parent->field_defs['assigned_user_id'])) {
$query .= " , assigned_user_id parent_name_owner ";
} else {
$query .= " , created_by parent_name_owner ";
}
$query .= " from $parent->table_name where id = '$this->parent_id'";
}
}
$result = $this->db->query($query, true, " Error filling in additional detail fields: ");
// Get the id and the name.
$row = $this->db->fetchByAssoc($result);
if ($row && !empty($row['parent_name_owner'])) {
$this->parent_name_owner = $row['parent_name_owner'];
$this->parent_name_mod = $this->parent_type;
}
if (is_subclass_of($parent, 'Person') and $row != null) {
$this->parent_name = $locale->getLocaleFormattedName(stripslashes($row['first_name']), stripslashes($row['last_name']));
} else {
if (is_subclass_of($parent, 'File') && $row != null) {
$this->parent_name = $row['document_name'];
} elseif ($row != null) {
$this->parent_name = stripslashes($row['name']);
} else {
$this->parent_name = '';
}
}
}
protected function formatStartAndDueDates(&$task_fields, $dbtime, $override_date_for_subpanel)
{
global $timedate;
if (empty($dbtime)) {
return;
}
$today = $timedate->nowDbDate();
$task_fields['TIME_DUE'] = $timedate->to_display_time($dbtime);
$task_fields['DATE_DUE'] = $timedate->to_display_date($dbtime);
$date_due = $task_fields['DATE_DUE'];
$dd = $timedate->to_db_date($date_due, false);
$taskClass = 'futureTask';
if ($dd < $today) {
if ($task_fields['STATUS']=='Completed' || $task_fields['STATUS']=='Deferred') {
$taskClass = '';
} else {
$taskClass = 'overdueTask';
}
} else {
if ($dd == $today) {
$taskClass = 'todaysTask';
}
}
$task_fields['DATE_DUE']= "<font class='$taskClass'>$date_due</font>";
if ($override_date_for_subpanel) {
$task_fields['DATE_START']= "<font class='$taskClass'>$date_due</font>";
}
}
public function get_list_view_data()
{
global $mod_strings, $app_list_strings, $timedate;
$override_date_for_subpanel = false;
if (!empty($_REQUEST['module']) && $_REQUEST['module'] !='Calendar' && $_REQUEST['module'] !='Tasks' && $_REQUEST['module'] !='Home') {
//this is a subpanel list view, so override the due date with start date so that collections subpanel works as expected
$override_date_for_subpanel = true;
}
$today = $timedate->nowDb();
$task_fields = $this->get_list_view_array();
if (!isset($task_fields['DATE_DUE'])) {
LoggerManager::getLogger()->warn('Task get_list_view_data: Undefined index: DATE_DUE');
$taskFieldsDateDue = null;
} else {
$taskFieldsDateDue = $task_fields['DATE_DUE'];
}
$dbtime = $timedate->to_db($taskFieldsDateDue);
if ($override_date_for_subpanel) {
$dbtime = $timedate->to_db($task_fields['DATE_START']);
}
if (!empty($dbtime)) {
$task_fields['TIME_DUE'] = $timedate->to_display_time($dbtime);
$task_fields['DATE_DUE'] = $timedate->to_display_date($dbtime);
$this->formatStartAndDueDates($task_fields, $dbtime, $override_date_for_subpanel);
}
if (!empty($this->priority)) {
$task_fields['PRIORITY'] = $app_list_strings['task_priority_dom'][$this->priority];
}
if (isset($this->parent_type)) {
$task_fields['PARENT_MODULE'] = $this->parent_type;
}
if ($this->status != "Completed" && $this->status != "Deferred") {
$setCompleteUrl = "<b><a id='{$this->id}' class='list-view-data-icon' title='".translate('LBL_LIST_CLOSE', 'Tasks')."' onclick='SUGAR.util.closeActivityPanel.show(\"{$this->module_dir}\",\"{$this->id}\",\"Completed\",\"listview\",\"1\");'>";
$task_fields['SET_COMPLETE'] = $setCompleteUrl . "<span class='suitepicon suitepicon-action-clear'></span></a></b>";
}
// make sure we grab the localized version of the contact name, if a contact is provided
if (!empty($this->contact_id)) {
$contact_temp = BeanFactory::getBean("Contacts", $this->contact_id);
if (!empty($contact_temp)) {
// Make first name, last name, salutation and title of Contacts respect field level ACLs
$contact_temp->_create_proper_name_field();
$this->contact_name = $contact_temp->full_name;
$this->contact_phone = $contact_temp->phone_work;
}
}
$task_fields['CONTACT_NAME']= $this->contact_name;
$task_fields['CONTACT_PHONE']= $this->contact_phone;
$task_fields['TITLE'] = '';
if (!empty($task_fields['CONTACT_NAME'])) {
$title = !empty($mod_strings['LBL_LIST_CONTACT']) ? $mod_strings['LBL_LIST_CONTACT'] . ': ' : '';
$task_fields['TITLE'] .= $title . $task_fields['CONTACT_NAME'];
}
if (!empty($this->parent_name)) {
$task_fields['TITLE'] .= "\n".$app_list_strings['parent_type_display'][$this->parent_type].": ".$this->parent_name;
$task_fields['PARENT_NAME']=$this->parent_name;
}
return $task_fields;
}
public function set_notification_body($xtpl, $task)
{
global $app_list_strings;
global $timedate;
$notifyUser = $task->current_notify_user;
$prefDate = $notifyUser->getUserDateTimePreferences();
$xtpl->assign("TASK_SUBJECT", $task->name);
//MFH #13507
$xtpl->assign("TASK_PRIORITY", (isset($task->priority)?$app_list_strings['task_priority_dom'][$task->priority]:""));
if (!empty($task->date_due)) {
$duedate = $timedate->fromDb($task->date_due);
$xtpl->assign("TASK_DUEDATE", $timedate->asUser($duedate, $notifyUser)." ".TimeDate::userTimezoneSuffix($duedate, $notifyUser));
} else {
$xtpl->assign("TASK_DUEDATE", '');
}
$xtpl->assign("TASK_STATUS", (isset($task->status)?$app_list_strings['task_status_dom'][$task->status]:""));
$xtpl->assign("TASK_DESCRIPTION", $task->description);
return $xtpl;
}
public function bean_implements($interface)
{
switch ($interface) {
case 'ACL':return true;
}
return false;
}
public function listviewACLHelper()
{
$array_assign = parent::listviewACLHelper();
$is_owner = false;
$in_group = false; //SECURITY GROUPS
if (!empty($this->parent_name)) {
if (!empty($this->parent_name_owner)) {
global $current_user;
$is_owner = $current_user->id == $this->parent_name_owner;
}
/* BEGIN - SECURITY GROUPS */
//parent_name_owner not being set for whatever reason so we need to figure this out
else {
if (!empty($this->parent_type) && !empty($this->parent_id)) {
global $current_user;
$parent_bean = BeanFactory::getBean($this->parent_type, $this->parent_id);
if ($parent_bean !== false) {
$is_owner = $current_user->id == $parent_bean->assigned_user_id;
}
}
}
require_once("modules/SecurityGroups/SecurityGroup.php");
$in_group = SecurityGroup::groupHasAccess($this->parent_type, $this->parent_id, 'view');
/* END - SECURITY GROUPS */
}
/* BEGIN - SECURITY GROUPS */
/**
if(!ACLController::moduleSupportsACL($this->parent_type) || ACLController::checkAccess($this->parent_type, 'view', $is_owner)){
*/
if (!ACLController::moduleSupportsACL($this->parent_type) || ACLController::checkAccess($this->parent_type, 'view', $is_owner, 'module', $in_group)) {
/* END - SECURITY GROUPS */
$array_assign['PARENT'] = 'a';
} else {
$array_assign['PARENT'] = 'span';
}
$is_owner = false;
$in_group = false; //SECURITY GROUPS
if (!empty($this->contact_name)) {
if (!empty($this->contact_name_owner)) {
global $current_user;
$is_owner = $current_user->id == $this->contact_name_owner;
}
/* BEGIN - SECURITY GROUPS */
//contact_name_owner not being set for whatever reason so we need to figure this out
else {
global $current_user;
$parent_bean = BeanFactory::getBean('Contacts', $this->contact_id);
if ($parent_bean !== false) {
$is_owner = $current_user->id == $parent_bean->assigned_user_id;
}
}
require_once("modules/SecurityGroups/SecurityGroup.php");
$in_group = SecurityGroup::groupHasAccess('Contacts', $this->contact_id, 'view');
/* END - SECURITY GROUPS */
}
/* BEGIN - SECURITY GROUPS */
/**
if( ACLController::checkAccess('Contacts', 'view', $is_owner)){
*/
if (ACLController::checkAccess('Contacts', 'view', $is_owner, 'module', $in_group)) {
/* END - SECURITY GROUPS */
$array_assign['CONTACT'] = 'a';
} else {
$array_assign['CONTACT'] = 'span';
}
return $array_assign;
}
public function getDefaultStatus()
{
$def = $this->field_defs['status'];
if (isset($def['default'])) {
return $def['default'];
} else {
$app = return_app_list_strings_language($GLOBALS['current_language']);
if (isset($def['options']) && isset($app[$def['options']])) {
$keys = array_keys($app[$def['options']]);
return $keys[0];
}
}
return '';
}
}

View file

@ -0,0 +1,106 @@
<?php
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
/**
*
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2018 SalesAgility Ltd.
*
* 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 and "Supercharged by SuiteCRM" logo. If the display of the logos is not
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
require_once('include/EditView/QuickCreate.php');
class TasksQuickCreate extends QuickCreate
{
public $javascript;
public function process()
{
global $current_user, $timedate, $app_list_strings, $current_language, $mod_strings;
$mod_strings = return_module_language($current_language, 'Tasks');
parent::process();
$this->ss->assign("PRIORITY_OPTIONS", get_select_options_with_id($app_list_strings['task_priority_dom'], $app_list_strings['task_priority_default']));
$this->ss->assign("STATUS_OPTIONS", get_select_options_with_id($app_list_strings['task_status_dom'], $app_list_strings['task_status_default']));
$this->ss->assign("TIME_FORMAT", '('. $timedate->get_user_time_format().')');
$focus = BeanFactory::newBean('Tasks');
$time_start_hour = (int)substr($focus->time_start, 0, 2);
$time_start_minutes = substr($focus->time_start, 3, 5);
if ($time_start_minutes > 45) {
$time_start_hour += 1;
}
$time_pref = $timedate->get_time_format();
if (strpos($time_pref, 'a')) {
if (!isset($focus->meridiem_am_values)) {
$focus->meridiem_am_values = array('am'=>'am', 'pm'=>'pm');
}
$this->ss->assign("TIME_MERIDIEM", get_select_options_with_id($focus->meridiem_am_values, $time_start_hour < 12 ? 'am' : 'pm'));
} else {
if (strpos($time_pref, 'A')) {
if (!isset($focus->meridiem_AM_values)) {
$focus->meridiem_AM_values = array('AM'=>'AM', 'PM'=>'PM');
}
$this->ss->assign("TIME_MERIDIEM", get_select_options_with_id($focus->meridiem_AM_values, $time_start_hour < 12 ? 'AM' : 'PM'));
}
} //if-else
$this->ss->assign("USER_DATEFORMAT", '('. $timedate->get_user_date_format().')');
$this->ss->assign("CALENDAR_DATEFORMAT", $timedate->get_cal_date_format());
if ($this->viaAJAX) { // override for ajax call
$this->ss->assign('saveOnclick', "onclick='if(check_form(\"tasksQuickCreate\")) return SUGAR.subpanelUtils.inlineSave(this.form.id, \"activities\"); else return false;'");
$this->ss->assign('cancelOnclick', "onclick='return SUGAR.subpanelUtils.cancelCreate(\"subpanel_activities\")';");
}
$this->ss->assign('viaAJAX', $this->viaAJAX);
$this->javascript = new javascript();
$this->javascript->setFormName('tasksQuickCreate');
$focus = BeanFactory::newBean('Tasks');
$this->javascript->setSugarBean($focus);
$this->javascript->addAllFields('');
$this->ss->assign('additionalScripts', $this->javascript->getScript(false));
}
}

74
modules/Tasks/field_arrays.php Executable file
View file

@ -0,0 +1,74 @@
<?php
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
/**
*
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2018 SalesAgility Ltd.
*
* 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 and "Supercharged by SuiteCRM" logo. If the display of the logos is not
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
/*********************************************************************************
* 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['Task'] = array('column_fields' =>array("id"
, "date_entered"
, "date_modified"
, "assigned_user_id"
, "modified_user_id"
, "created_by"
, "description"
, "name"
, "status"
, "date_due"
, "time_due"
, "date_start_flag"
, "date_start"
, "time_start"
, "priority"
, "date_due_flag"
, "parent_type"
, "parent_id"
, "contact_id"
),
'list_fields' => array('id', 'status', 'name', 'parent_type', 'parent_name', 'parent_id', 'date_due', 'contact_id', 'contact_name', 'assigned_user_name', 'assigned_user_id','first_name','last_name','time_due', 'priority'
),
'required_fields' => array('name'=>1),
);

View file

@ -0,0 +1,100 @@
<?php
/**
*
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2019 SalesAgility Ltd.
*
* 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 and "Supercharged by SuiteCRM" logo. If the display of the logos is not
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
$mod_strings = array(
'LBL_MODULE_NAME' => 'Tasks',
'LBL_MODULE_TITLE' => ' Tasks: Home',
'LBL_SEARCH_FORM_TITLE' => ' Task Search',
'LBL_LIST_FORM_TITLE' => ' Task List',
'LBL_NEW_FORM_TITLE' => ' Create Task',
'LBL_LIST_CLOSE' => 'Close',
'LBL_LIST_SUBJECT' => 'Subject',
'LBL_LIST_CONTACT' => 'Contact',
'LBL_LIST_PRIORITY' => 'Priority',
'LBL_LIST_RELATED_TO' => 'Related to',
'LBL_LIST_DUE_DATE' => 'Due Date',
'LBL_LIST_DUE_TIME' => 'Due Time',
'LBL_SUBJECT' => 'Subject:',
'LBL_STATUS' => 'Status:',
'LBL_DUE_DATE' => 'Due Date:',
'LBL_DUE_TIME' => 'Due Time:',
'LBL_PRIORITY' => 'Priority:',
'LBL_DUE_DATE_AND_TIME' => 'Due Date & Time:',
'LBL_START_DATE_AND_TIME' => 'Start Date & Time:',
'LBL_START_DATE' => 'Start Date:',
'LBL_LIST_START_DATE' => 'Start Date',
'LBL_START_TIME' => 'Start Time:',
'DATE_FORMAT' => '(yyyy-mm-dd)',
'LBL_DAYS_UNTIL_DUE_TASK' => 'This Task is Due in',
'LBL_DAYS_OVERDUE' => 'This Task Is Overdue By ',
'LBL_TASK_COMPLETED' => 'This Task is Completed',
'LBL_NONE' => 'None',
'LBL_CONTACT' => 'Contact:',
'LBL_EMAIL_ADDRESS' => 'Email Address:',
'LBL_PHONE' => 'Phone:',
'LBL_EMAIL' => 'Email Address:',
'LBL_DESCRIPTION' => 'Description:',
'LBL_NAME' => 'Name:',
'LBL_CONTACT_NAME' => 'Contact Name ',
'LBL_LIST_STATUS' => 'Status',
'LBL_DATE_DUE_FLAG' => 'No Due Date',
'LBL_DATE_START_FLAG' => 'No Start Date',
'LBL_LIST_MY_TASKS' => 'My Open Tasks',
'LNK_NEW_TASK' => 'Create Task',
'LNK_TASK_LIST' => 'View Tasks',
'LNK_IMPORT_TASKS' => 'Import Tasks',
'LBL_LIST_ASSIGNED_TO_NAME' => 'Assigned User',
'LBL_ASSIGNED_TO_NAME' => 'Assigned to:',
'LBL_LIST_DATE_MODIFIED' => 'Date Modified',
'LBL_CONTACT_ID' => 'Contact ID:',
'LBL_PARENT_ID' => 'Parent ID:',
'LBL_CONTACT_PHONE' => 'Contact Phone:',
'LBL_PARENT_TYPE' => 'Parent Type:',
'LBL_TASK_INFORMATION' => 'TASK OVERVIEW',
'LBL_EDITLAYOUT' => 'Edit Layout' /*for 508 compliance fix*/,
'LBL_HISTORY_SUBPANEL_TITLE' => 'Notes',
//For export labels
'LBL_DATE_DUE' => 'Date Due',
'LBL_RELATED_TO' => 'Related to:',
);

View file

@ -0,0 +1,82 @@
<?php
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
/**
*
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2018 SalesAgility Ltd.
*
* 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 and "Supercharged by SuiteCRM" logo. If the display of the logos is not
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
$searchFields['Tasks'] =
array(
'name' => array( 'query_type'=>'default'),
'contact_name' => array('query_type' => 'default', 'db_field' => array('contacts.first_name', 'contacts.last_name'), 'force_unifiedsearch' => true),
'current_user_only'=> array('query_type'=>'default','db_field'=>array('assigned_user_id'),'my_items'=>true, 'vname' => 'LBL_CURRENT_USER_FILTER', 'type' => 'bool'),
'assigned_user_id'=> array('query_type'=>'default'),
'status'=> array('query_type'=>'default', 'options' => 'task_status_dom', 'template_var' => 'STATUS_FILTER'),
'open_only' => array(
'query_type'=>'default',
'db_field'=>array('status'),
'operator'=>'not in',
'closed_values' => array('Completed', 'Deferred'),
'type'=>'bool',
),
'favorites_only' => array(
'query_type'=>'format',
'operator' => 'subquery',
'checked_only' => true,
'subquery' => "SELECT favorites.parent_id FROM favorites
WHERE favorites.deleted = 0
and favorites.parent_type = 'Tasks'
and favorites.assigned_user_id = '{1}'",
'db_field'=>array('id')),
//Range Search Support
'range_date_entered' => array('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true),
'start_range_date_entered' => array('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true),
'end_range_date_entered' => array('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true),
'range_date_modified' => array('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true),
'start_range_date_modified' => array('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true),
'end_range_date_modified' => array('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true),
'range_date_start' => array('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true),
'start_range_date_start' => array('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true),
'end_range_date_start' => array('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true),
'range_date_due' => array('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true),
'start_range_date_due' => array('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true),
'end_range_date_due' => array('query_type' => 'default', 'enable_range_search' => true, 'is_date_field' => true),
//Range Search Support
);

View file

@ -0,0 +1,50 @@
<?php
/**
*
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2018 SalesAgility Ltd.
*
* 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 and "Supercharged by SuiteCRM" logo. If the display of the logos is not
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
require_once "include/utils/additional_details.php";
function additionalDetailsTask($fields, SugarBean $bean = null, $params = array())
{
return additional_details($fields, $bean, $params);
}

View file

@ -0,0 +1,207 @@
<?php
/**
*
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2018 SalesAgility Ltd.
*
* 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 and "Supercharged by SuiteCRM" logo. If the display of the logos is not
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
$viewdefs ['Tasks'] =
array(
'DetailView' =>
array(
'templateMeta' =>
array(
'form' =>
array(
'buttons' =>
array(
0 => 'EDIT',
1 => 'DUPLICATE',
2 => 'DELETE',
3 =>
array(
'customCode' => '{if $fields.status.value != "Completed"} <input type="hidden" name="isSaveAndNew" value="false"> <input type="hidden" name="status" value=""> <input id="close_and_create_new_button" title="{$APP.LBL_CLOSE_AND_CREATE_BUTTON_TITLE}" class="button" onclick="this.form.action.value=\'Save\'; this.form.return_module.value=\'Tasks\'; this.form.isDuplicate.value=true; this.form.isSaveAndNew.value=true; this.form.return_action.value=\'EditView\'; this.form.isDuplicate.value=true; this.form.return_id.value=\'{$fields.id.value}\';" name="button" value="{$APP.LBL_CLOSE_AND_CREATE_BUTTON_TITLE}" type="submit">{/if}',
'sugar_html' =>
array(
'type' => 'submit',
'value' => '{$APP.LBL_CLOSE_AND_CREATE_BUTTON_TITLE}',
'htmlOptions' =>
array(
'title' => '{$APP.LBL_CLOSE_AND_CREATE_BUTTON_TITLE}',
'class' => 'button',
'onclick' => 'this.form.action.value=\'Save\'; this.form.return_module.value=\'Tasks\'; this.form.isDuplicate.value=true; this.form.isSaveAndNew.value=true; this.form.return_action.value=\'EditView\'; this.form.isDuplicate.value=true; this.form.return_id.value=\'{$fields.id.value}\';',
'name' => 'button',
'id' => 'close_and_create_new_button',
),
'template' => '{if $fields.status.value != "Completed"}[CONTENT]{/if}',
),
),
4 =>
array(
'customCode' => '{if $fields.status.value != "Completed"} <input type="hidden" name="isSave" value="false"> <input title="{$APP.LBL_CLOSE_BUTTON_TITLE}" id="close_button" class="button" onclick="this.form.status.value=\'Completed\'; this.form.action.value=\'Save\';this.form.return_module.value=\'Tasks\';this.form.isSave.value=true;this.form.return_action.value=\'DetailView\'; this.form.return_id.value=\'{$fields.id.value}\'" name="button1" value="{$APP.LBL_CLOSE_BUTTON_TITLE}" type="submit">{/if}',
'sugar_html' =>
array(
'type' => 'submit',
'value' => '{$APP.LBL_CLOSE_BUTTON_TITLE}',
'htmlOptions' =>
array(
'title' => '{$APP.LBL_CLOSE_BUTTON_TITLE}',
'class' => 'button',
'onclick' => 'this.form.status.value=\'Completed\'; this.form.action.value=\'Save\';this.form.return_module.value=\'Tasks\';this.form.isSave.value=true;this.form.return_action.value=\'DetailView\'; this.form.return_id.value=\'{$fields.id.value}\'',
'name' => 'button1',
'id' => 'close_button',
),
'template' => '{if $fields.status.value != "Completed"}[CONTENT]{/if}'
),
),
),
'hidden' =>
array(
0 => '<input type="hidden" name="isSaveAndNew">',
1 => '<input type="hidden" name="status" value="">',
2 => '<input type="hidden" name="isSave">',
),
),
'maxColumns' => '2',
'widths' =>
array(
0 =>
array(
'label' => '10',
'field' => '30',
),
1 =>
array(
'label' => '10',
'field' => '30',
),
),
'useTabs' => true,
'tabDefs' =>
array(
'LBL_TASK_INFORMATION' =>
array(
'newTab' => true,
'panelDefault' => 'expanded',
),
'LBL_PANEL_ASSIGNMENT' =>
array(
'newTab' => true,
'panelDefault' => 'expanded',
),
),
),
'topWidget' => [
'type' => 'statistics',
'options' => [
'statistics' => [
[
'labelKey' => 'LBL_DAYS_UNTIL_DUE_TASK',
'type' => 'days-until-due-task',
'endLabelKey' => 'LBL_STAT_DAYS'
],
],
]
],
'panels' =>
array(
'lbl_task_information' =>
array(
0 =>
array(
0 =>
array(
'name' => 'name',
'label' => 'LBL_SUBJECT',
),
1 => 'status',
),
1 =>
array(
0 => 'date_start',
1 =>
array(
'name' => 'parent_name',
'customLabel' => '{sugar_translate label=\'LBL_MODULE_NAME\' module=$fields.parent_type.value}',
),
),
2 =>
array(
0 => 'date_due',
1 =>
array(
'name' => 'contact_name',
'label' => 'LBL_CONTACT',
),
),
3 =>
array(
0 => 'priority',
),
4 =>
array(
0 => 'description',
),
),
'LBL_PANEL_ASSIGNMENT' =>
array(
0 =>
array(
0 =>
array(
'name' => 'assigned_user_name',
'label' => 'LBL_ASSIGNED_TO',
),
),
1 =>
array(
0 =>
array(
'name' => 'date_entered',
'customCode' => '{$fields.date_entered.value} {$APP.LBL_BY} {$fields.created_by_name.value}',
'label' => 'LBL_DATE_ENTERED',
),
1 =>
array(
'name' => 'date_modified',
'customCode' => '{$fields.date_modified.value} {$APP.LBL_BY} {$fields.modified_by_name.value}',
'label' => 'LBL_DATE_MODIFIED',
),
),
),
),
),
);

View file

@ -0,0 +1,167 @@
<?php
/**
*
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2018 SalesAgility Ltd.
*
* 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 and "Supercharged by SuiteCRM" logo. If the display of the logos is not
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
$viewdefs ['Tasks'] =
array(
'EditView' =>
array(
'templateMeta' =>
array(
'form' =>
array(
'hidden' =>
array(
'<input type="hidden" name="isSaveAndNew" value="false">',
),
'buttons' =>
array(
'SAVE',
'CANCEL',
array(
'customCode' => '{if $fields.status.value != "Completed"}<input title="{$APP.LBL_CLOSE_AND_CREATE_BUTTON_TITLE}" class="button" onclick="document.getElementById(\'status\').value=\'Completed\'; this.form.action.value=\'Save\'; this.form.return_module.value=\'Tasks\'; this.form.isDuplicate.value=true; this.form.isSaveAndNew.value=true; this.form.return_action.value=\'EditView\'; this.form.return_id.value=\'{$fields.id.value}\'; if(check_form(\'EditView\'))SUGAR.ajaxUI.submitForm(this.form);" type="button" name="button" value="{$APP.LBL_CLOSE_AND_CREATE_BUTTON_LABEL}">{/if}',
),
),
),
'maxColumns' => '2',
'widths' =>
array(
array(
'label' => '10',
'field' => '30',
),
array(
'label' => '10',
'field' => '30',
),
),
'useTabs' => false,
),
'panels' =>
array(
'lbl_task_information' =>
array(
array(
array(
'name' => 'name',
'displayParams' =>
array(
'required' => true,
),
),
array(
'name' => 'status',
'displayParams' =>
array(
'required' => true,
),
),
),
array(
array(
'name' => 'date_start',
'type' => 'datetimecombo',
'displayParams' =>
array(
'showNoneCheckbox' => true,
'showFormats' => true,
),
),
array(
'name' => 'parent_name',
'label' => 'LBL_LIST_RELATED_TO',
),
),
array(
array(
'name' => 'date_due',
'type' => 'datetimecombo',
'displayParams' =>
array(
'showNoneCheckbox' => true,
'showFormats' => true,
),
),
array(
'name' => 'contact_name',
'label' => 'LBL_CONTACT_NAME',
),
),
array(
array(
'name' => 'priority',
'displayParams' =>
array(
'required' => true,
),
),
),
array(
array(
'name' => 'description',
),
),
),
'LBL_PANEL_ASSIGNMENT' => array(
array(
'assigned_user_name',
),
),
),
),
);

View file

@ -0,0 +1,111 @@
<?php
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
/**
*
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2018 SalesAgility Ltd.
*
* 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 and "Supercharged by SuiteCRM" logo. If the display of the logos is not
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
$listViewDefs['Tasks'] = array(
'SET_COMPLETE' => array(
'width' => '1',
'label' => 'LBL_LIST_CLOSE',
'link' => true,
'sortable' => false,
'default' => true,
'related_fields' => array('status')),
'NAME' => array(
'width' => '40',
'label' => 'LBL_LIST_SUBJECT',
'link' => true,
'default' => true),
'CONTACT_NAME' => array(
'width' => '20',
'label' => 'LBL_LIST_CONTACT',
'link' => true,
'id' => 'CONTACT_ID',
'module' => 'Contacts',
'default' => true,
'ACLTag' => 'CONTACT',
'related_fields' => array('contact_id')),
'PARENT_NAME' => array(
'width' => '20',
'label' => 'LBL_LIST_RELATED_TO',
'dynamic_module' => 'PARENT_TYPE',
'id' => 'PARENT_ID',
'link' => true,
'default' => true,
'sortable' => false,
'ACLTag' => 'PARENT',
'related_fields' => array('parent_id', 'parent_type')),
'DATE_DUE' => array(
'width' => '15',
'label' => 'LBL_LIST_DUE_DATE',
'link' => false,
'default' => true),
'TIME_DUE' => array(
'width' => '15',
'label' => 'LBL_LIST_DUE_TIME',
'sortable' => false,
'link' => false,
'default' => true),
'ASSIGNED_USER_NAME' => array(
'width' => '2',
'label' => 'LBL_LIST_ASSIGNED_TO_NAME',
'module' => 'Employees',
'id' => 'ASSIGNED_USER_ID',
'default' => true),
'DATE_START' => array(
'width' => '5',
'label' => 'LBL_LIST_START_DATE',
'link' => false,
'default' => false),
'STATUS' => array(
'width' => '10',
'label' => 'LBL_LIST_STATUS',
'link' => false,
'default' => false),
'DATE_ENTERED' => array(
'width' => '10',
'label' => 'LBL_DATE_ENTERED',
'default' => true),
);

View file

@ -0,0 +1,169 @@
<?php
/**
*
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2018 SalesAgility Ltd.
*
* 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 and "Supercharged by SuiteCRM" logo. If the display of the logos is not
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
$viewdefs ['Tasks'] =
array(
'QuickCreate' =>
array(
'templateMeta' =>
array(
'form' =>
array(
'hidden' =>
array(
'<input type="hidden" name="isSaveAndNew" value="false">',
),
'buttons' =>
array(
'SAVE',
'CANCEL',
array(
'customCode' => '{if $fields.status.value != "Completed"}<input title="{$APP.LBL_CLOSE_AND_CREATE_BUTTON_TITLE}" class="button" onclick="document.getElementById(\'status\').value=\'Completed\'; this.form.action.value=\'Save\'; this.form.return_module.value=\'Tasks\'; this.form.isDuplicate.value=true; this.form.isSaveAndNew.value=true; this.form.return_action.value=\'EditView\'; this.form.return_id.value=\'{$fields.id.value}\'; return check_form(\'EditView\');" type="submit" name="button" value="{$APP.LBL_CLOSE_AND_CREATE_BUTTON_LABEL}">{/if}',
),
),
),
'maxColumns' => '2',
'widths' =>
array(
array(
'label' => '10',
'field' => '30',
),
array(
'label' => '10',
'field' => '30',
),
),
'useTabs' => false,
),
'panels' =>
array(
'default' =>
array(
array(
array(
'name' => 'name',
'displayParams' =>
array(
'required' => true,
),
),
array(
'name' => 'status',
'displayParams' =>
array(
'required' => true,
),
),
),
array(
array(
'name' => 'date_start',
'type' => 'datetimecombo',
'displayParams' =>
array(
'showNoneCheckbox' => true,
'showFormats' => true,
),
),
array(
'name' => 'parent_name',
'label' => 'LBL_LIST_RELATED_TO',
),
),
array(
array(
'name' => 'date_due',
'type' => 'datetimecombo',
'displayParams' =>
array(
'showNoneCheckbox' => true,
'showFormats' => true,
),
),
array(
'name' => 'contact_name',
'label' => 'LBL_CONTACT_NAME',
),
),
array(
array(
'name' => 'priority',
'displayParams' =>
array(
'required' => true,
),
),
),
array(
array(
'name' => 'assigned_user_name',
'label' => 'LBL_ASSIGNED_TO_NAME',
),
),
array(
array(
'name' => 'description',
'displayParams' =>
array(
'rows' => 8,
'cols' => 60,
),
),
),
),
),
),
);

View file

@ -0,0 +1,132 @@
<?php
/**
*
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2018 SalesAgility Ltd.
*
* 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 and "Supercharged by SuiteCRM" logo. If the display of the logos is not
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
$searchdefs ['Tasks'] =
array(
'layout' =>
array(
'basic_search' =>
array(
'name' =>
array(
'name' => 'name',
'default' => true,
'width' => '10%',
),
'current_user_only' =>
array(
'name' => 'current_user_only',
'label' => 'LBL_CURRENT_USER_FILTER',
'type' => 'bool',
'default' => true,
'width' => '10%',
),
array('name' => 'open_only', 'label' => 'LBL_OPEN_ITEMS', 'type' => 'bool', 'default' => false, 'width' => '10%'),
array('name' => 'favorites_only','label' => 'LBL_FAVORITES_FILTER','type' => 'bool',),
),
'advanced_search' =>
array(
'name' =>
array(
'name' => 'name',
'default' => true,
'width' => '10%',
),
'contact_name' =>
array(
'name' => 'contact_name',
'label' => 'LBL_CONTACT_NAME',
'type' => 'name',
'default' => true,
'width' => '10%',
),
'current_user_only' =>
array(
'name' => 'current_user_only',
'label' => 'LBL_CURRENT_USER_FILTER',
'type' => 'bool',
'default' => true,
'width' => '10%',
),
'status' =>
array(
'name' => 'status',
'default' => true,
'width' => '10%',
),
'parent_name' =>
array(
'type' => 'parent',
'label' => 'LBL_LIST_RELATED_TO',
'width' => '10%',
'default' => true,
'name' => 'parent_name',
),
'assigned_user_id' =>
array(
'name' => 'assigned_user_id',
'type' => 'enum',
'label' => 'LBL_ASSIGNED_TO',
'function' =>
array(
'name' => 'get_user_array',
'params' =>
array(
0 => false,
),
),
'default' => true,
'width' => '10%',
),
),
),
'templateMeta' =>
array(
'maxColumns' => '3',
'maxColumnsBasic' => '4',
'widths' =>
array(
'label' => '10',
'field' => '30',
),
),
);

View file

@ -0,0 +1,72 @@
<?php
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
/**
*
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2018 SalesAgility Ltd.
*
* 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 and "Supercharged by SuiteCRM" logo. If the display of the logos is not
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
$GLOBALS['studioDefs']['Tasks'] = array(
'LBL_DETAILVIEW'=>array(
'template'=>'xtpl',
'template_file'=>'modules/Tasks/DetailView.html',
'php_file'=>'modules/Tasks/DetailView.php',
'type'=>'DetailView',
),
'LBL_EDITVIEW'=>array(
'template'=>'xtpl',
'template_file'=>'modules/Tasks/EditView.html',
'php_file'=>'modules/Tasks/EditView.php',
'type'=>'EditView',
),
'LBL_LISTVIEW'=>array(
'template'=>'listview',
'meta_file'=>'modules/Tasks/listviewdefs.php',
'type'=>'ListView',
),
'LBL_SEARCHFORM'=>array(
'template'=>'xtpl',
'template_file'=>'modules/Tasks/SearchForm.html',
'php_file'=>'modules/Tasks/ListView.php',
'type'=>'SearchForm',
),
);

View file

@ -0,0 +1,81 @@
<?php
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
/**
*
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2018 SalesAgility Ltd.
*
* 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 and "Supercharged by SuiteCRM" logo. If the display of the logos is not
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
$layout_defs['Tasks'] = array(
// sets up which panels to show, in which order, and with what linked_fields
'subpanel_setup' => array(
'history' => array(
'order' => 40,
'title_key' => 'LBL_HISTORY_SUBPANEL_TITLE',
'type' => 'collection',
'subpanel_name' => 'history', //this values is not associated with a physical file.
'sort_order' => 'desc',
'sort_by' => 'date_entered',
'header_definition_from_subpanel' => 'calls',
'module' => 'History',
'top_buttons' => array(
array('widget_class' => 'SubPanelTopCreateNoteButton'),
),
'collection_list' => array(
'notes' => array(
'module' => 'Notes',
'subpanel_name' => 'ForTasks',
'get_subpanel_data' => 'notes',
),
),
), /* end history subpanel def */
'securitygroups' => array(
'top_buttons' => array(array('widget_class' => 'SubPanelTopSelectButton', 'popup_module' => 'SecurityGroups', 'mode' => 'MultiSelect'),),
'order' => 900,
'sort_by' => 'name',
'sort_order' => 'asc',
'module' => 'SecurityGroups',
'refresh_page' => 1,
'subpanel_name' => 'default',
'get_subpanel_data' => 'SecurityGroups',
'add_subpanel_data' => 'securitygroup_id',
'title_key' => 'LBL_SECURITYGROUPS_SUBPANEL_TITLE',
),
),
);

View file

@ -0,0 +1,107 @@
<?php
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
/**
*
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2018 SalesAgility Ltd.
*
* 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 and "Supercharged by SuiteCRM" logo. If the display of the logos is not
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
$subpanel_layout = [
'where' => "(tasks.status != 'Completed' AND tasks.status != 'Deferred')",
'list_fields' => [
'object_image' => [
'vname' => 'LBL_OBJECT_IMAGE',
'widget_class' => 'SubPanelIcon',
'width' => '2%',
],
'name' => [
'vname' => 'LBL_LIST_SUBJECT',
'widget_class' => 'SubPanelDetailViewLink',
'width' => '30%',
],
'status' => [
'widget_class' => 'SubPanelActivitiesStatusField',
'vname' => 'LBL_LIST_STATUS',
'width' => '15%',
],
'contact_name' => [
'widget_class' => 'SubPanelDetailViewLink',
'target_record_key' => 'contact_id',
'target_module' => 'Contacts',
'module' => 'Contacts',
'vname' => 'LBL_LIST_CONTACT',
'width' => '11%',
],
'date_due' => [
'vname' => 'LBL_LIST_DUE_DATE',
'width' => '10%',
'alias' => 'date_end',
'sort_by' => 'date_end',
],
'assigned_user_name' => [
'name' => 'assigned_user_name',
'vname' => 'LBL_LIST_ASSIGNED_TO_NAME',
'widget_class' => 'SubPanelDetailViewLink',
'target_record_key' => 'assigned_user_id',
'target_module' => 'Employees',
'width' => '22%',
],
'edit_button' => [
'vname' => 'LBL_EDIT_BUTTON',
'widget_class' => 'SubPanelEditButton',
'width' => '2%',
],
'close_button' => [
'widget_class' => 'SubPanelCloseButton',
'vname' => 'LBL_LIST_CLOSE',
'width' => '6%',
'sortable' => false,
],
'remove_button' => [
'vname' => 'LBL_REMOVE',
'widget_class' => 'SubPanelRemoveButton',
'width' => '2%',
],
'time_due' => [
'usage' => 'query_only',
'alias' => 'time_start'
],
],
];

View file

@ -0,0 +1,113 @@
<?php
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
/**
*
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2018 SalesAgility Ltd.
*
* 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 and "Supercharged by SuiteCRM" logo. If the display of the logos is not
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
$subpanel_layout = array(
//Removed button because this layout def is a component of
//the activities sub-panel.
'where' => "",
'list_fields' => array(
'object_image'=>array(
'vname' => 'LBL_OBJECT_IMAGE',
'widget_class' => 'SubPanelIcon',
'width' => '2%',
),
'name'=>array(
'vname' => 'LBL_LIST_SUBJECT',
'widget_class' => 'SubPanelDetailViewLink',
'width' => '30%',
),
'status'=>array(
'widget_class' => 'SubPanelActivitiesStatusField',
'vname' => 'LBL_LIST_STATUS',
'width' => '15%',
),
'contact_name'=>array(
'widget_class' => 'SubPanelDetailViewLink',
'target_record_key' => 'contact_id',
'target_module' => 'Contacts',
'module' => 'Contacts',
'vname' => 'LBL_LIST_CONTACT',
'width' => '11%',
),
'parent_name'=>array(
'vname' => 'LBL_LIST_RELATED_TO',
'width' => '22%',
'target_record_key' => 'parent_id',
'target_module_key'=>'parent_type',
'widget_class' => 'SubPanelDetailViewLink',
'sortable'=>false,
),
'date_modified'=>array(
'vname' => 'LBL_LIST_DATE_MODIFIED',
'width' => '10%',
),
'edit_button'=>array(
'vname' => 'LBL_EDIT_BUTTON',
'widget_class' => 'SubPanelEditButton',
'width' => '2%',
),
'remove_button'=>array(
'vname' => 'LBL_REMOVE',
'widget_class' => 'SubPanelRemoveButton',
'width' => '2%',
),
'parent_id'=>array(
'usage'=>'query_only',
),
'parent_type'=>array(
'usage'=>'query_only',
),
'filename'=>array(
'usage'=>'query_only',
'force_exists'=>true
),
),
);

View file

@ -0,0 +1,123 @@
<?php
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
/**
*
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2018 SalesAgility Ltd.
*
* 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 and "Supercharged by SuiteCRM" logo. If the display of the logos is not
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
$subpanel_layout = [
'where' => "(tasks.status='Completed' OR tasks.status='Deferred')",
'list_fields' => [
'object_image' => [
'vname' => 'LBL_OBJECT_IMAGE',
'widget_class' => 'SubPanelIcon',
'width' => '2%',
],
'name' => [
'vname' => 'LBL_LIST_SUBJECT',
'widget_class' => 'SubPanelDetailViewLink',
'width' => '30%',
],
'status' => [
'widget_class' => 'SubPanelActivitiesStatusField',
'vname' => 'LBL_LIST_STATUS',
'width' => '15%',
],
'reply_to_status' => [
'usage' => 'query_only',
'force_exists' => true,
'force_default' => 0,
],
'contact_name' => [
'widget_class' => 'SubPanelDetailViewLink',
'target_record_key' => 'contact_id',
'target_module' => 'Contacts',
'module' => 'Contacts',
'vname' => 'LBL_LIST_CONTACT',
'width' => '11%',
],
'parent_id' => [
'usage' => 'query_only',
'force_exists' => true
],
'parent_type' => [
'usage' => 'query_only',
'force_exists' => true
],
'date_modified' => [
'vname' => 'LBL_LIST_DATE_MODIFIED',
'width' => '10%',
],
'date_entered' => [
'vname' => 'LBL_LIST_DATE_ENTERED',
'width' => '10%',
],
'date_due' => [
'vname' => 'LBL_LIST_DUE_DATE',
'width' => '10%',
'alias' => 'date_end',
'sort_by' => 'date_end',
],
'assigned_user_name' => [
'name' => 'assigned_user_name',
'vname' => 'LBL_LIST_ASSIGNED_TO_NAME',
'widget_class' => 'SubPanelDetailViewLink',
'target_record_key' => 'assigned_user_id',
'target_module' => 'Employees',
'width' => '10%',
],
'edit_button' => [
'vname' => 'LBL_EDIT_BUTTON',
'widget_class' => 'SubPanelEditButton',
'width' => '2%',
],
'remove_button' => [
'vname' => 'LBL_REMOVE',
'widget_class' => 'SubPanelRemoveButton',
'width' => '2%',
],
'filename' => [
'usage' => 'query_only',
'force_exists' => true
],
],
];

View file

@ -0,0 +1,120 @@
<?php
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
/**
*
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2018 SalesAgility Ltd.
*
* 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 and "Supercharged by SuiteCRM" logo. If the display of the logos is not
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
$subpanel_layout = array(
//Removed button because this layout def is a component of
//the activities sub-panel.
'top_buttons' => array(
array(
'widget_class'=>'SubPanelTopCreateButton',
),
array(
'widget_class'=>'SubPanelTopSelectButton', 'popup_module' => 'Tasks'
),
),
'list_fields' => array(
'object_image'=>array(
'vname' => 'LBL_OBJECT_IMAGE',
'widget_class' => 'SubPanelIcon',
'width' => '2%',
),
'name'=>array(
'vname' => 'LBL_LIST_SUBJECT',
'widget_class' => 'SubPanelDetailViewLink',
'width' => '30%',
),
'status'=>array(
'widget_class' => 'SubPanelActivitiesStatusField',
'vname' => 'LBL_LIST_STATUS',
'width' => '15%',
),
'contact_name'=>array(
'widget_class' => 'SubPanelDetailViewLink',
'target_record_key' => 'contact_id',
'target_module' => 'Contacts',
'module' => 'Contacts',
'vname' => 'LBL_LIST_CONTACT',
'width' => '11%',
),
'parent_name'=>array(
'vname' => 'LBL_LIST_RELATED_TO',
'width' => '22%',
'target_record_key' => 'parent_id',
'target_module_key'=>'parent_type',
'widget_class' => 'SubPanelDetailViewLink',
'sortable'=>false,
),
'date_modified'=>array(
'vname' => 'LBL_LIST_DATE_MODIFIED',
'width' => '10%',
),
'edit_button'=>array(
'vname' => 'LBL_EDIT_BUTTON',
'widget_class' => 'SubPanelEditButton',
'width' => '2%',
),
'remove_button'=>array(
'vname' => 'LBL_REMOVE',
'widget_class' => 'SubPanelRemoveButton',
'width' => '2%',
),
'parent_id'=>array(
'usage'=>'query_only',
),
'parent_type'=>array(
'usage'=>'query_only',
),
'filename'=>array(
'usage'=>'query_only',
'force_exists'=>true
),
),
);

View file

@ -0,0 +1,210 @@
{*
/**
*
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2018 SalesAgility Ltd.
*
* 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 and "Supercharged by SuiteCRM" logo. If the display of the logos is not
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
*}
<form name="tasksQuickCreate" id="tasksQuickCreate" method="POST" action="index.php">
<input type="hidden" name="module" value="Tasks">
<input type="hidden" name="record" value="">
<input type="hidden" name="lead_id" value="{$REQUEST.lead_id}">
<input type="hidden" name="contact_id" value="{$REQUEST.contact_id}">
<input type="hidden" name="contact_name" value="{$REQUEST.contact_name}">
<input type="hidden" name="email_id" value="{$REQUEST.email_id}">
<input type="hidden" name="account_id" value="{$REQUEST.account_id}">
<input type="hidden" name="opportunity_id" value="{$REQUEST.opportunity_id}">
<input type="hidden" name="acase_id" value="{$REQUEST.acase_id}">
<input type="hidden" name="return_action" value="{$REQUEST.return_action}">
<input type="hidden" name="return_module" value="{$REQUEST.return_module}">
<input type="hidden" name="return_id" value="{$REQUEST.return_id}">
<input type="hidden" name="action" value='Save'>
<input type="hidden" name="duplicate_parent_id" value="{$REQUEST.duplicate_parent_id}">
<!--
CL: Bug fix for 9291 and 9427 - parent_id should be parent_type, not the module type (if set)
-->
{if $REQUEST.parent_id}
<input type="hidden" name="parent_id" value="{$REQUEST.parent_id}">
{else}
<input type="hidden" name="parent_id" value="{$REQUEST.return_id}">
{/if}
{if $REQUEST.parent_type}
<input type="hidden" name="parent_type" value="{$REQUEST.parent_type}">
{else}
<input type="hidden" name="parent_type" value="{$REQUEST.return_module}">
{/if}
<input type="hidden" name="parent_name" value="{$REQUEST.parent_name}">
<input id='assigned_user_id' name='assigned_user_id' type="hidden" value="{$ASSIGNED_USER_ID}" />
<input type="hidden" name="to_pdf" value='1'>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td align="left" style="padding-bottom: 2px;">
<input title="{$APP.LBL_SAVE_BUTTON_TITLE}" accessKey="{$APP.LBL_SAVE_BUTTON_KEY}" class="button" type="submit" name="button" {$saveOnclick|default:"onclick=\"return check_form('TasksQuickCreate');\""} value=" {$APP.LBL_SAVE_BUTTON_LABEL} " >
<input title="{$APP.LBL_CANCEL_BUTTON_TITLE}" accessKey="{$APP.LBL_CANCEL_BUTTON_KEY}" class="button" type="submit" name="button" {$cancelOnclick|default:"onclick=\"this.form.action.value='$RETURN_ACTION'; this.form.module.value='$RETURN_MODULE'; this.form.record.value='$RETURN_ID'\""} value=" {$APP.LBL_CANCEL_BUTTON_LABEL} ">
<input title="{$APP.LBL_FULL_FORM_BUTTON_TITLE}" accessKey="{$APP.LBL_FULL_FORM_BUTTON_KEY}" class="button" type="submit" name="button" onclick="this.form.to_pdf.value='0';this.form.action.value='EditView'; this.form.module.value='Tasks';" value=" {$APP.LBL_FULL_FORM_BUTTON_LABEL} "></td>
<td align="right" nowrap><span class="required">{$APP.LBL_REQUIRED_SYMBOL}</span> {$APP.NTC_REQUIRED}</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="edit view">
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<th align="left" scope="row" colspan="4"><h4><span>{$MOD.LBL_NEW_FORM_TITLE}</span></h4></th>
</tr>
<tr>
<td valign="top" scope="row" rowspan="2"><span>{$MOD.LBL_SUBJECT} <span class="required">{$APP.LBL_REQUIRED_SYMBOL}</span></span></td>
<td rowspan="2"><span><textarea name='name' cols="50" tabindex='1' rows="1">{$NAME}</textarea></span></td>
<td scope="row" width="15%"><span>{$MOD.LBL_PRIORITY} <span class="required">{$APP.LBL_REQUIRED_SYMBOL}</span></span></td>
<td nowrap width="35%"><span><select tabindex='2' name='priority'>{$PRIORITY_OPTIONS}</select></span></td>
</tr>
<tr>
<td scope="row" width="15%"><span>{$MOD.LBL_STATUS} <span class="required">{$APP.LBL_REQUIRED_SYMBOL}</span></span></td>
<td width="35%"><span><select tabindex='2' name='status'>{$STATUS_OPTIONS}</select></span></td>
</tr>
<tr>
<td valign="top" scope="row" rowspan="2"><span>{$MOD.LBL_DESCRIPTION}</span></td>
<td rowspan="2"><span><textarea name='description' tabindex='1' cols="50" rows="4">{$DESCRIPTION}</textarea></span></td>
<td scope="row"><span>{$MOD.LBL_DUE_DATE_AND_TIME}</span></td>
<td nowrap="nowrap"><span>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td nowrap="nowrap"><input name='date_due' id='jscal_field' onblur="parseDate(this, '{$USER_DATEFORMAT}');" tabindex='2' maxlength='10' size='11' {$READONLY} type="text" value="{$DATE_DUE}">
<span id="jscal_trigger" class="suitepicon suitepicon-module-calendar" title="{$APP.LBL_ENTER_DATE}"></span>
</td>
<td nowrap="nowrap"><input name='time_due' size='5' maxlength='5' tabindex='2' {$READONLY} type="text" value='{$TIME_DUE}'>{$DUE_TIME_MERIDIEM} </td>
{if $TIME_MERIDIEM}
<td><select name='due_meridiem' tabindex="2">{$TIME_MERIDIEM}</select></td>
{/if}
<td nowrap="nowrap">&nbsp;<input name='date_due_flag'class="checkbox" type='checkbox' tabindex="1" onClick="set_date_due_values(this.form);">&nbsp;{$MOD.LBL_NONE}</td>
</tr>
<tr>
<td nowrap="nowrap"><span class="dateFormat">{$USER_DATEFORMAT}</span></td>
<td nowrap="nowrap"><span class="dateFormat">{$TIME_FORMAT}</span></td>
</tr>
</table></span>
</td>
</tr>
<tr>
<td scope="row"><span>{$MOD.LBL_START_DATE_AND_TIME}</span></td>
<td nowrap="nowrap"><span>
<table border="0" cellpadding="0" cellspacing="0">
<tr>
<td nowrap="nowrap"><input name='date_start' id='date_start' onblur="parseDate(this, '{$CALENDAR_DATEFORMAT}');" tabindex='2' maxlength='10' size='11' {$READONLY} type="text" value="{$DATE_START}"> <span id="date_start_trigger" class="suitepicon suitepicon-module-calendar" title="{$APP.LBL_ENTER_DATE}""></span>&nbsp;</td>
<td nowrap="nowrap"><input name='time_start' size='5' maxlength='5' tabindex='2' {$READONLY} type="text" value='{$TIME_START}'>{$START_TIME_MERIDIEM} </td>
{if $TIME_MERIDIEM}
<td><select name='start_meridiem' tabindex="2">{$TIME_MERIDIEM}</select></td>
{/if}
<td nowrap="nowrap">&nbsp;<input name='date_start_flag' class="checkbox" type='checkbox' tabindex="1" onClick="set_date_start_values(this.form);">&nbsp;{$MOD.LBL_NONE}</td>
</tr>
<tr>
<td nowrap="nowrap"><span class="dateFormat">{$USER_DATEFORMAT}</span></td>
<td nowrap="nowrap"><span class="dateFormat">{$TIME_FORMAT}</span></td>
</tr>
</table></span>
</td>
</tr>
</table>
</form>
<script type="text/javascript">
{literal}
Calendar.setup ({
inputField : "jscal_field", daFormat : "{/literal}{$CALENDAR_FORMAT}{literal}", showsTime : false, button : "jscal_trigger", singleClick : true, step : 1, startWeekday: {/literal}{$CALENDAR_FDOW|default:'0'}{literal}, weekNumbers:false
});
Calendar.setup ({
inputField : "date_start", daFormat : "{/literal}{$CALENDAR_FORMAT}{literal}", showsTime : false, button : "date_start_trigger", singleClick : true, step : 1, startWeekday: {/literal}{$CALENDAR_FDOW|default:'0'}{literal}, weekNumbers:false
});
{/literal}
{$additionalScripts}
</script>
<script type="text/javascript">
{literal}
function set_date_due_values(form) {
if (form.date_due_flag.checked) {
form.date_due_flag.value='on';
form.date_due.value="";
form.time_due.value="";
form.date_due.readOnly=true;
form.time_due.readOnly=true;
if(typeof(form.due_meridiem) != 'undefined') form.due_meridiem.disabled=true;
document.images.jscal_trigger.width = 18;
document.images.jscal_trigger.height = 18;
}
else {
form.date_due_flag.value='off';
form.date_due.readOnly=false;
form.time_due.readOnly=false;
if(typeof(form.due_meridiem) != 'undefined') form.due_meridiem.disabled=false;
document.images.jscal_trigger.width = 18;
document.images.jscal_trigger.height = 18;
}
}
function set_date_start_values(form) {
if (form.date_start_flag.checked) {
form.date_start_flag.value='on';
form.date_start.value="";
form.time_start.value="";
form.date_start.readOnly=true;
form.time_start.readOnly=true;
if(typeof(form.start_meridiem) != 'undefined') form.start_meridiem.disabled=true;
document.images.date_start_trigger.width = 18;
document.images.date_start_trigger.height = 18;
}
else {
form.date_start_flag.value='off';
form.date_start.readOnly=false;
form.time_start.readOnly=false;
if(typeof(form.start_meridiem) != 'undefined') form.start_meridiem.disabled=false;
document.images.date_start_trigger.width = 18;
document.images.date_start_trigger.height = 18;
}
}
{/literal}
set_date_due_values(document.tasksQuickCreate);
set_date_start_values(document.tasksQuickCreate);
</script>

View file

@ -0,0 +1,53 @@
<input id="type" type="hidden" value="{$OBJECT_NAME}"/>
{if !empty($FIELD.ID)}
<input id="id" type="hidden" value="{$FIELD.ID}"/>
{/if}
{if !empty($FIELD.NAME)}
<div>
<strong>{$MOD.LBL_SUBJECT}</strong>
<a href="index.php?action=DetailView&module={$MODULE_NAME}&record={$FIELD.ID}">{$FIELD.NAME}</a>
</div>
{/if}
{if !empty($FIELD.DATE_START)}
<div data-field="DATE_START" data-date="{$FIELD.DB_DATE_START}">
<strong>{$MOD.LBL_DATE_TIME}</strong>
{$FIELD.DATE_START}
</div>
{/if}
{if !empty($FIELD.DATE_DUE)}
<div data-field="DATE_DUE">
<strong>{$MOD.LBL_DUE_DATE_AND_TIME}</strong>
{$FIELD.DATE_DUE}
</div>
{/if}
{if !empty($FIELD.PRIORITY)}
<div data-field="PRIORITY">
<strong>{$MOD.LBL_PRIORITY}</strong>
{$FIELD.PRIORITY}
</div>
{/if}
{if !empty($FIELD.PARENT_ID)}
<div>
<strong>{$MOD.LBL_RELATED_TO}</strong>
<a href="index.php?module={$FIELD.PARENT_TYPE}&action=DetailView&record={$FIELD.PARENT_ID}">{$FIELD.PARENT_TYPE} - {$FIELD.PARENT_NAME}</a>
</div>
{/if}
{if !empty($FIELD.STATUS)}
<div>
<strong>{$MOD.LBL_STATUS}</strong>
{$FIELD.STATUS}
</div>
{/if}
{if !empty($FIELD.DESCRIPTION)}
<div>
<strong>{$MOD.LBL_DESCRIPTION}</strong>
{$FIELD.DESCRIPTION}
</div>
{/if}

View file

@ -0,0 +1,11 @@
<div id="qtip-6-title" class="qtip-title" aria-atomic="true">
<div class="qtip-title-text">
{$FIELD.NAME}
</div>
{if $PARAM.show_buttons != "false"}
<div class="qtip-title-buttons">
{if $ACL_EDIT_VIEW == true}<a href="index.php?action=DetailView&module={$MODULE_NAME}&record={$FIELD.ID}" class="btn btn-xs"><span class="glyphicon glyphicon-eye-open"></span></a>{/if}
{if $ACL_DETAIL_VIEW == true}<a href="index.php?action=EditView&module={$MODULE_NAME}&record={$FIELD.ID}" class="btn btn-xs"><span class="glyphicon glyphicon-pencil"></span></a>{/if}
</div>
{/if}
</div>

372
modules/Tasks/vardefs.php Executable file
View file

@ -0,0 +1,372 @@
<?php
/**
*
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2018 SalesAgility Ltd.
*
* 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 and "Supercharged by SuiteCRM" logo. If the display of the logos is not
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
$dictionary['Task'] = array(
'table' => 'tasks',
'unified_search' => true,
'full_text_search' => true,
'fields' => array(
'name' =>
array(
'name' => 'name',
'vname' => 'LBL_SUBJECT',
'dbType' => 'varchar',
'type' => 'name',
'len' => '50',
'unified_search' => true,
'full_text_search' => array('boost' => 3),
'importable' => 'required',
'required' => 'true',
),
'status' =>
array(
'name' => 'status',
'vname' => 'LBL_STATUS',
'type' => 'enum',
'options' => 'task_status_dom',
'len' => 100,
'required' => 'true',
'default' => 'Not Started',
),
'date_due_flag' =>
array(
'name' => 'date_due_flag',
'vname' => 'LBL_DATE_DUE_FLAG',
'type' => 'bool',
'default' => 0,
'group' => 'date_due',
'studio' => false,
),
'date_due' =>
array(
'name' => 'date_due',
'vname' => 'LBL_DUE_DATE',
'type' => 'datetimecombo',
'dbType' => 'datetime',
'group' => 'date_due',
'studio' => array('required' => true, 'no_duplicate' => true),
'enable_range_search' => true,
'options' => 'date_range_search_dom',
),
'time_due' =>
array(
'name' => 'time_due',
'vname' => 'LBL_DUE_TIME',
'type' => 'datetime',
//'db_concat_fields'=> array(0=>'date_due'),
'source' => 'non-db',
'importable' => 'false',
'massupdate' => false,
),
'date_start_flag' =>
array(
'name' => 'date_start_flag',
'vname' => 'LBL_DATE_START_FLAG',
'type' => 'bool',
'group' => 'date_start',
'default' => 0,
'studio' => false,
),
'date_start' =>
array(
'name' => 'date_start',
'vname' => 'LBL_START_DATE',
'type' => 'datetimecombo',
'dbType' => 'datetime',
'group' => 'date_start',
'validation' => array('type' => 'isbefore', 'compareto' => 'date_due', 'blank' => false),
'studio' => array('required' => true, 'no_duplicate' => true),
'enable_range_search' => true,
'options' => 'date_range_search_dom',
),
'parent_type' =>
array(
'name' => 'parent_type',
'vname' => 'LBL_PARENT_TYPE',
'type' => 'parent_type',
'dbType' => 'varchar',
'group' => 'parent_name',
'options' => 'parent_type_display',
'required' => false,
'len' => '255',
'comment' => 'The Sugar object to which the call is related',
'options' => 'parent_type_display',
),
'parent_name' =>
array(
'name' => 'parent_name',
'parent_type' => 'record_type_display',
'type_name' => 'parent_type',
'id_name' => 'parent_id',
'vname' => 'LBL_LIST_RELATED_TO',
'type' => 'parent',
'group' => 'parent_name',
'source' => 'non-db',
'options' => 'parent_type_display',
),
'parent_id' =>
array(
'name' => 'parent_id',
'type' => 'id',
'group' => 'parent_name',
'reportable' => false,
'vname' => 'LBL_PARENT_ID',
),
'contact_id' =>
array(
'name' => 'contact_id',
'type' => 'id',
'group' => 'contact_name',
'reportable' => false,
'vname' => 'LBL_CONTACT_ID',
),
'contact_name' =>
array(
'name' => 'contact_name',
'rname' => 'name',
'db_concat_fields' => array(0 => 'first_name', 1 => 'last_name'),
'source' => 'non-db',
'len' => '510',
'group' => 'contact_name',
'vname' => 'LBL_CONTACT_NAME',
'reportable' => false,
'id_name' => 'contact_id',
'join_name' => 'contacts',
'type' => 'relate',
'module' => 'Contacts',
'link' => 'contacts',
'table' => 'contacts',
),
'contact_phone' =>
array(
'name' => 'contact_phone',
'type' => 'phone',
'source' => 'non-db',
'vname' => 'LBL_CONTACT_PHONE',
'studio' => array('listview' => true)
),
'contact_email' =>
array(
'name' => 'contact_email',
'type' => 'varchar',
'vname' => 'LBL_EMAIL_ADDRESS',
'source' => 'non-db',
'studio' => false
),
'priority' =>
array(
'name' => 'priority',
'vname' => 'LBL_PRIORITY',
'type' => 'enum',
'options' => 'task_priority_dom',
'len' => 100,
'required' => 'true',
),
'contacts' => array(
'name' => 'contacts',
'type' => 'link',
'relationship' => 'contact_tasks',
'source' => 'non-db',
'side' => 'right',
'vname' => 'LBL_CONTACT',
),
'accounts' =>
array(
'name' => 'accounts',
'type' => 'link',
'relationship' => 'account_tasks',
'source' => 'non-db',
'vname' => 'LBL_ACCOUNT',
),
'opportunities' =>
array(
'name' => 'opportunities',
'type' => 'link',
'relationship' => 'opportunity_tasks',
'source' => 'non-db',
'vname' => 'LBL_OPPORTUNITY',
),
'cases' =>
array(
'name' => 'cases',
'type' => 'link',
'relationship' => 'case_tasks',
'source' => 'non-db',
'vname' => 'LBL_CASE',
),
'bugs' =>
array(
'name' => 'bugs',
'type' => 'link',
'relationship' => 'bug_tasks',
'source' => 'non-db',
'vname' => 'LBL_BUGS',
),
'leads' =>
array(
'name' => 'leads',
'type' => 'link',
'relationship' => 'lead_tasks',
'source' => 'non-db',
'vname' => 'LBL_LEADS',
),
'projects' =>
array(
'name' => 'projects',
'type' => 'link',
'relationship' => 'projects_tasks',
'source' => 'non-db',
'vname' => 'LBL_PROJECTS',
),
'project_tasks' =>
array(
'name' => 'project_tasks',
'type' => 'link',
'relationship' => 'project_tasks_tasks',
'source' => 'non-db',
'vname' => 'LBL_PROJECT_TASKS',
),
'aos_contracts' =>
array(
'name' => 'aos_contracts',
'type' => 'link',
'relationship' => 'aos_contracts_tasks',
'source' => 'non-db',
'vname' => 'LBL_CONTRACT',
),
'notes' =>
array(
'name' => 'notes',
'type' => 'link',
'relationship' => 'tasks_notes',
'module' => 'Notes',
'bean_name' => 'Note',
'source' => 'non-db',
'vname' => 'LBL_NOTES',
),
'contact_parent' =>
array(
'name' => 'contact_parent',
'type' => 'link',
'relationship' => 'contact_tasks_parent',
'source' => 'non-db',
'reportable' => false
),
)
,
'relationships' => array(
'tasks_notes' => array(
'lhs_module' => 'Tasks',
'lhs_table' => 'tasks',
'lhs_key' => 'id',
'rhs_module' => 'Notes',
'rhs_table' => 'notes',
'rhs_key' => 'parent_id',
'relationship_type' => 'one-to-many',
),
'tasks_assigned_user' =>
array(
'lhs_module' => 'Users',
'lhs_table' => 'users',
'lhs_key' => 'id',
'rhs_module' => 'Tasks',
'rhs_table' => 'tasks',
'rhs_key' => 'assigned_user_id',
'relationship_type' => 'one-to-many'
)
,
'tasks_modified_user' =>
array(
'lhs_module' => 'Users',
'lhs_table' => 'users',
'lhs_key' => 'id',
'rhs_module' => 'Tasks',
'rhs_table' => 'tasks',
'rhs_key' => 'modified_user_id',
'relationship_type' => 'one-to-many'
)
,
'tasks_created_by' =>
array(
'lhs_module' => 'Users',
'lhs_table' => 'users',
'lhs_key' => 'id',
'rhs_module' => 'Tasks',
'rhs_table' => 'tasks',
'rhs_key' => 'created_by',
'relationship_type' => 'one-to-many'
)
)
,
'indices' => array(
array('name' => 'idx_tsk_name', 'type' => 'index', 'fields' => array('name')),
array('name' => 'idx_task_con_del', 'type' => 'index', 'fields' => array('contact_id', 'deleted')),
array(
'name' => 'idx_task_par_del',
'type' => 'index',
'fields' => array('parent_id', 'parent_type', 'deleted')
),
array('name' => 'idx_task_assigned', 'type' => 'index', 'fields' => array('assigned_user_id')),
array('name' => 'idx_task_status', 'type' => 'index', 'fields' => array('status')),
)
//This enables optimistic locking for Saves From EditView
,
'optimistic_locking' => true,
);
VardefManager::createVardef('Tasks', 'Task', array(
'default',
'assignable',
'security_groups',
));

View file

@ -0,0 +1,72 @@
<?php
if (!defined('sugarEntry') || !sugarEntry) {
die('Not A Valid Entry Point');
}
/**
*
* SugarCRM Community Edition is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2013 SugarCRM Inc.
*
* SuiteCRM is an extension to SugarCRM Community Edition developed by SalesAgility Ltd.
* Copyright (C) 2011 - 2018 SalesAgility Ltd.
*
* 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 and "Supercharged by SuiteCRM" logo. If the display of the logos is not
* reasonably feasible for technical reasons, the Appropriate Legal Notices must
* display the words "Powered by SugarCRM" and "Supercharged by SuiteCRM".
*/
class TasksViewEdit extends ViewEdit
{
/**
* @see SugarView::preDisplay()
*/
public function preDisplay()
{
if ($_REQUEST['module'] != 'Tasks' && isset($_REQUEST['status']) && empty($_REQUEST['status'])) {
$this->bean->status = '';
} //if
if (!empty($_REQUEST['status']) && ($_REQUEST['status'] == 'Completed')) {
$this->bean->status = 'Completed';
}
parent::preDisplay();
}
/**
* @see SugarView::display()
*/
public function display()
{
if ($this->ev->isDuplicate) {
$this->bean->status = $this->bean->getDefaultStatus();
} //if
parent::display();
}
}