Add php files

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

View File

@@ -0,0 +1,92 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/**
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2009 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
*/
global $current_user;
$dashletData['MyMeetingsDashlet']['searchFields'] = array('name' => array('default' => ''),
'date_start' => array('default' => ''),
'status' => array('default' => array('Planned')),
'assigned_user_id' => array('type' => 'assigned_user_name',
'default' => $current_user->name));
$dashletData['MyMeetingsDashlet']['columns'] = array('set_complete' => array('width' => '1',
'label' => 'LBL_LIST_CLOSE',
'default' => true,
'sortable' => false,
'related_fields' => array('status')),
'name' => array('width' => '40',
'label' => 'LBL_SUBJECT',
'link' => true,
'default' => true),
'parent_name' => array('width' => '29',
'label' => 'LBL_LIST_RELATED_TO',
'sortable' => false,
'link' => true,
'id' => 'parent_id',
'ACLTag' => 'PARENT',
'related_fields' => array('parent_id', 'parent_type')),
'duration' => array('width' => '15',
'label' => 'LBL_DURATION',
'default' => true,
'sortable' => false,
'related_fields' => array('duration_hours', 'duration_minutes')),
'date_start' => array('width' => '15',
'label' => 'LBL_DATE',
'default' => true,
'related_fields' => array('time_start')),
'status' => array('width' => '8',
'label' => 'LBL_STATUS'),
'date_entered' => array('width' => '15',
'label' => 'LBL_DATE_ENTERED'),
'date_modified' => array('width' => '15',
'label' => 'LBL_DATE_MODIFIED'),
'created_by' => array('width' => '8',
'label' => 'LBL_CREATED'),
'assigned_user_name' => array('width' => '8',
'label' => 'LBL_LIST_ASSIGNED_USER'),
);
?>

View File

@@ -0,0 +1,46 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/**
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2009 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
*/
global $app_strings;
$dashletMeta['MyMeetingsDashlet'] = array('module' => 'Meetings',
'title' => translate('LBL_LIST_MY_MEETINGS', 'Meetings'),
'description' => 'A customizable view into Meetings',
'category' => 'Module Views');
?>

View File

@@ -0,0 +1,174 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/**
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2009 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
*/
require_once('include/Dashlets/DashletGeneric.php');
require_once('modules/Meetings/Meeting.php');
class MyMeetingsDashlet extends DashletGeneric {
function MyMeetingsDashlet($id, $def = null) {
global $current_user, $app_strings;
require('modules/Meetings/Dashlets/MyMeetingsDashlet/MyMeetingsDashlet.data.php');
parent::DashletGeneric($id, $def);
if(empty($def['title'])) $this->title = translate('LBL_LIST_MY_MEETINGS', 'Meetings');
$this->searchFields = $dashletData['MyMeetingsDashlet']['searchFields'];
if(empty($def['filters'])){
if(isset($this->searchFields['status'])){
if(!empty($this->searchFields['status']['default'])){
$this->filters['status'] = $this->searchFields['status']['default'];
}
}
}
$this->columns = $dashletData['MyMeetingsDashlet']['columns'];
$this->columns['set_accept_links']= array('width' => '10',
'label' => translate('LBL_ACCEPT_THIS', 'Meetings'),
'sortable' => false,
'default' => true,
'related_fields' => array('status'));
$this->hasScript = true; // dashlet has javascript attached to it
$this->seedBean = new Meeting();
}
function process() {
global $current_language, $app_list_strings, $image_path, $current_user;
$mod_strings = return_module_language($current_language, 'Meetings');
if($this->myItemsOnly) { // handle myitems only differently
$lvsParams = array(
'custom_from' => ' INNER JOIN meetings_users ON meetings.id = meetings_users.meeting_id ',
'custom_where' => ' AND meetings_users.deleted = 0 AND (meetings.assigned_user_id = \'' . $current_user->id . '\' OR meetings_users.user_id = \'' . $current_user->id . '\') ',
'distinct' => true
);
} else {
$lvsParams = array();
}
$this->myItemsOnly = false;
parent::process($lvsParams);
$keys = array();
foreach($this->lvs->data['data'] as $num => $row) {
$keys[] = $row['ID'];
}
// grab meeting status
if(!empty($keys)){
$query = "SELECT meeting_id, accept_status FROM meetings_users WHERE user_id = '" . $current_user->id . "' AND meeting_id IN ('" . implode("','", $keys) . "')";
$result = $GLOBALS['db']->query($query);
}
while($row = $GLOBALS['db']->fetchByAssoc($result)) {
$rowNums = $this->lvs->data['pageData']['idIndex'][$row['meeting_id']]; // figure out which rows have this guid
foreach($rowNums as $rowNum) {
$this->lvs->data['data'][$rowNum]['ACCEPT_STATUS'] = $row['accept_status'];
}
}
foreach($this->lvs->data['data'] as $rowNum => $row) {
if(empty($this->lvs->data['data'][$rowNum]['DURATION_HOURS'])) $this->lvs->data['data'][$rowNum]['DURATION'] = '0' . $mod_strings['LBL_HOURS_ABBREV'];
else $this->lvs->data['data'][$rowNum]['DURATION'] = $this->lvs->data['data'][$rowNum]['DURATION_HOURS'] . $mod_strings['LBL_HOURS_ABBREV'];
if(empty($this->lvs->data['data'][$rowNum]['DURATION_MINUTES']) || empty($this->seedBean->minutes_values[$this->lvs->data['data'][$rowNum]['DURATION_MINUTES']])) {
$this->lvs->data['data'][$rowNum]['DURATION'] .= '00';
}
else {
$this->lvs->data['data'][$rowNum]['DURATION'] .= $this->seedBean->minutes_values[$this->lvs->data['data'][$rowNum]['DURATION_MINUTES']];
}
$this->lvs->data['data'][$rowNum]['DURATION'] .= $mod_strings['LBL_MINSS_ABBREV'];
if (!empty($this->lvs->data['data'][$rowNum]['STATUS']) && $this->lvs->data['data'][$rowNum]['STATUS'] == $app_list_strings['meeting_status_dom']['Planned'])
{
if ($this->lvs->data['data'][$rowNum]['ACCEPT_STATUS'] == '' ||
$this->lvs->data['data'][$rowNum]['ACCEPT_STATUS'] == 'none')
{
$this->lvs->data['data'][$rowNum]['SET_ACCEPT_LINKS'] = "<div id=\"accept".$this->id."\"><a title=\"".
$app_list_strings['dom_meeting_accept_options']['accept'].
"\" href=\"javascript:SUGAR.util.retrieveAndFill('index.php?module=Activities&to_pdf=1&action=SetAcceptStatus&id=".$this->id."&object_type=Meeting&object_id=".$this->lvs->data['data'][$rowNum]['ID'] . "&accept_status=accept', null, null, SUGAR.mySugar.retrieveDashlet, '{$this->id}');\">".
get_image($image_path."accept_inline","alt='".$app_list_strings['dom_meeting_accept_options']['accept'].
"' border='0'"). "</a>&nbsp;<a title=\"".$app_list_strings['dom_meeting_accept_options']['tentative'].
"\" href=\"javascript:SUGAR.util.retrieveAndFill('index.php?module=Activities&to_pdf=1&action=SetAcceptStatus&id=".$this->id."&object_type=Meeting&object_id=".$this->lvs->data['data'][$rowNum]['ID'] . "&accept_status=tentative', null, null, SUGAR.mySugar.retrieveDashlet, '{$this->id}');\">".
get_image($image_path."tentative_inline","alt='".$app_list_strings['dom_meeting_accept_options']['tentative']."' border='0'").
"</a>&nbsp;<a title=\"".$app_list_strings['dom_meeting_accept_options']['decline'].
"\" href=\"javascript:SUGAR.util.retrieveAndFill('index.php?module=Activities&to_pdf=1&action=SetAcceptStatus&id=".$this->id."&object_type=Meeting&object_id=".$this->lvs->data['data'][$rowNum]['ID'] . "&accept_status=decline', null, null, SUGAR.mySugar.retrieveDashlet, '{$this->id}');\">".
get_image($image_path."decline_inline","alt='".$app_list_strings['dom_meeting_accept_options']['decline'].
"' border='0'")."</a></div>";
}
else
{
$this->lvs->data['data'][$rowNum]['SET_ACCEPT_LINKS'] = $app_list_strings['dom_meeting_accept_status'][$this->lvs->data['data'][$rowNum]['ACCEPT_STATUS']];
}
}
}
$this->displayColumns[]= "set_accept_links";
}
/**
* Displays the javascript for the dashlet
*
* @return string javascript to use with this dashlet
*/
function displayScript() {
}
function displayOptions() {
$this->processDisplayOptions();
$this->configureSS->assign('strings', array('general' => $GLOBALS['mod_strings']['LBL_DASHLET_CONFIGURE_GENERAL'],
'filters' => $GLOBALS['mod_strings']['LBL_DASHLET_CONFIGURE_FILTERS'],
'myItems' => translate('LBL_LIST_MY_MEETINGS', 'Meetings'),
'displayRows' => $GLOBALS['mod_strings']['LBL_DASHLET_CONFIGURE_DISPLAY_ROWS'],
'title' => $GLOBALS['mod_strings']['LBL_DASHLET_CONFIGURE_TITLE'],
'save' => $GLOBALS['app_strings']['LBL_SAVE_BUTTON_LABEL']));
return $this->configureSS->fetch($this->configureTpl);
}
function saveStatus()
{
}
}
?>

37
modules/Meetings/Forms.php Executable file
View File

@@ -0,0 +1,37 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2009 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
*********************************************************************************/
require_once('include/EditView/SideQuickCreate.php');

747
modules/Meetings/Meeting.php Executable file
View File

@@ -0,0 +1,747 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2009 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
/*********************************************************************************
* Description: TODO: To be written.
* Portions created by SugarCRM are Copyright(C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
require_once('data/SugarBean.php');
require_once('modules/Contacts/Contact.php');
require_once('modules/Users/User.php');
require_once('modules/Calendar/DateTimeUtil.php');
// Meeting is used to store customer information.
class Meeting extends SugarBean {
// Stored fields
var $id;
var $date_entered;
var $date_modified;
var $assigned_user_id;
var $modified_user_id;
var $created_by;
var $created_by_name;
var $modified_by_name;
var $description;
var $name;
var $location;
var $status;
var $date_start;
var $time_start;
var $date_end;
var $duration_hours;
var $duration_minutes;
var $time_meridiem;
var $parent_type;
var $parent_type_options;
var $parent_id;
var $field_name_map;
var $contact_id;
var $user_id;
var $meeting_id;
var $reminder_time;
var $reminder_checked;
var $required;
var $accept_status;
var $parent_name;
var $contact_name;
var $contact_phone;
var $contact_email;
var $account_id;
var $opportunity_id;
var $case_id;
var $assigned_user_name;
var $outlook_id;
var $update_vcal = true;
var $contacts_arr;
var $users_arr;
var $meetings_arr;
// when assoc w/ a user/contact:
var $default_meeting_name_values = array('Follow-up on proposal', 'Initial discussion', 'Review needs', 'Discuss pricing', 'Demo', 'Introduce all players',);
var $minutes_value_default = 15;
var $minutes_values = array('0'=>'00','15'=>'15','30'=>'30','45'=>'45');
var $table_name = "meetings";
var $rel_users_table = "meetings_users";
var $rel_contacts_table = "meetings_contacts";
var $rel_leads_table = "meetings_leads";
var $module_dir = "Meetings";
var $object_name = "Meeting";
var $importable = true;
// This is used to retrieve related fields from form posts.
var $additional_column_fields = array('assigned_user_name', 'assigned_user_id', 'contact_id', 'user_id', 'contact_name', 'accept_status');
var $relationship_fields = array('account_id'=>'accounts','opportunity_id'=>'opportunity','case_id'=>'case',
'assigned_user_id'=>'users','contact_id'=>'contacts', 'user_id'=>'users', 'meeting_id'=>'meetings');
// so you can run get_users() twice and run query only once
var $cached_get_users = null;
var $new_schema = true;
/**
* sole constructor
*/
function Meeting() {
parent::SugarBean();
$this->setupCustomFields('Meetings');
foreach($this->field_defs as $field) {
$this->field_name_map[$field['name']] = $field;
}
// $this->fill_in_additional_detail_fields();
}
/**
* Stub for integration
* @return bool
*/
function hasIntegratedMeeting() {
return false;
}
// save date_end by calculating user input
// this is for calendar
function save($check_notify = FALSE) {
require_once('modules/vCals/vCal.php');
global $timedate;
global $current_user;
global $disable_date_format;
$this->date_start = $_POST['date_start'];
if(isset($this->date_start)
&& isset($this->duration_hours)
&& isset($this->duration_minutes))
{
$date_start_in_db_fmt=$timedate->swap_formats($this->date_start, $timedate->get_date_time_format(true, $current_user), $timedate->get_db_date_time_format());
$date_start_array=split(" ",trim($date_start_in_db_fmt));
$date_time_start =DateTimeUtil::get_time_start($date_start_array[0],$date_start_array[1]);
$date_start_timestamp=mktime($date_time_start->hour,$date_time_start->min,$date_time_start->sec,$date_time_start->month,$date_time_start->day);
$date_start_timestamp+= (( $this->duration_hours * 3600 )+ ($this->duration_minutes * 60));
$this->date_end=date ($timedate->get_date_time_format(true, $current_user),$date_start_timestamp);
// Need to convert it to the db date right here so that we don't miss the time calculation
$this->date_end = $timedate->to_db_date($this->date_end);
if(empty($disable_date_format)){
$this->date_end = $timedate->swap_formats($this->date_end, $timedate->dbDayFormat, $timedate->get_date_format());
}
}
$check_notify =(!empty($_REQUEST['send_invites']) && $_REQUEST['send_invites'] == '1') ? true : false;
/*nsingh 7/3/08 commenting out as bug #20814 is invalid
if($current_user->getPreference('reminder_time')!= -1 && isset($_POST['reminder_checked']) && isset($_POST['reminder_time']) && $_POST['reminder_checked']==0 && $_POST['reminder_time']==-1){
$this->reminder_checked = '1';
$this->reminder_time = $current_user->getPreference('reminder_time');
}*/
if (empty($this->status) ) {
$mod_strings = return_module_language($GLOBALS['current_language'], $this->module_dir);
$this->status = $mod_strings['LBL_DEFAULT_STATUS'];
}
parent::save($check_notify);
if($this->update_vcal) {
vCal::cache_sugar_vcal($current_user);
}
}
// this is for calendar
function mark_deleted($id) {
require_once('modules/vCals/vCal.php');
global $current_user;
parent::mark_deleted($id);
if($this->update_vcal) {
vCal::cache_sugar_vcal($current_user);
}
}
function get_summary_text() {
return "$this->name";
}
function create_list_query($order_by, $where, $show_deleted = 0) {
$custom_join = $this->custom_fields->getJOIN();
$query = "SELECT ";
$query .= "$this->table_name.*,";
if(preg_match("/meetings_users\.user_id/",$where)) {
$query .= "meetings_users.required, meetings_users.accept_status,";
}
$query .= "users.user_name as assigned_user_name";
// added to generate a GMT metric to compare against a locale's timezone
/*
if(( $this->db->dbType == 'mysql') or( $this->db->dbType == 'oci8')) {
$query .= ", CONCAT( meetings.date_start, CONCAT(' ', meetings.time_start)) AS datetime ";
} elseif($this->db->dbType == 'mssql') {
$query .= ", meetings.date_start + ' ' + meetings.time_start AS datetime ";
}
*/
if($custom_join) {
$query .= $custom_join['select'];
}
$query .= " FROM meetings ";
if(preg_match("/meetings_users\.user_id/",$where)) {
$query .= " LEFT JOIN meetings_users ON meetings_users.meeting_id=meetings.id and meetings_users.deleted=0 ";
}
$query .= " LEFT JOIN users ON meetings.assigned_user_id=users.id ";
if($custom_join) {
$query .= $custom_join['join'];
}
if(preg_match("/contacts/",$where)) {
$query .= " LEFT JOIN meetings_contacts ON meetings.id=meetings_contacts.meeting_id LEFT JOIN contacts ON meetings_contacts.contact_id=contacts.id ";
}
$where_auto = '1=1';
if($show_deleted == 0) {
$where_auto = " meetings.deleted=0 ";
} elseif($show_deleted == 1) {
$where_auto = " meetings.deleted=1 ";
}
if($where != "")
$query .= " WHERE $where AND ".$where_auto;
else
$query .= " WHERE ".$where_auto;
if($order_by != "") {
$query .= " ORDER BY ". $this->process_order_by($order_by, null);
} else {
$query .= " ORDER BY meetings.name";
}
return $query;
}
function create_export_query(&$order_by, &$where) {
$contact_required = ereg("contacts", $where);
$custom_join = $this->custom_fields->getJOIN(true, true);
if($contact_required) {
$query = "SELECT meetings.*, contacts.first_name, contacts.last_name, contacts.assigned_user_id contact_name_owner ";
if($custom_join) {
$query .= $custom_join['select'];
}
$query .= " FROM contacts, meetings, meetings_contacts ";
$where_auto = " meetings_contacts.contact_id = contacts.id AND meetings_contacts.meeting_id = meetings.id AND meetings.deleted=0 AND contacts.deleted=0";
} else {
$query = 'SELECT meetings.*';
if($custom_join) {
$query .= $custom_join['select'];
}
$query .= ' FROM meetings ';
$where_auto = "meetings.deleted=0";
}
if($custom_join) {
$query .= $custom_join['join'];
}
if($where != "")
$query .= " where $where AND ".$where_auto;
else
$query .= " where ".$where_auto;
if($order_by != "") {
$query .= " ORDER BY $order_by";
} else {
$alternate_order_by = $this->process_order_by($order_by, null);
if($alternate_order_by != "")
$query .= " ORDER BY ". $alternate_order_by;
}
return $query;
}
function fill_in_additional_list_fields() {
parent::fill_in_additional_list_fields();
//$this->fill_in_additional_detail_fields();
//$this->fill_in_additional_parent_fields();
}
function fill_in_additional_detail_fields() {
// Fill in the assigned_user_name
$this->assigned_user_name = get_assigned_user_name($this->assigned_user_id);
$query = "SELECT contacts.first_name, contacts.last_name, contacts.phone_work, contacts.id , contacts.assigned_user_id contact_name_owner FROM contacts, meetings_contacts ";
$query .= " WHERE meetings_contacts.contact_id=contacts.id AND meetings_contacts.meeting_id='$this->id' AND meetings_contacts.deleted=0 AND contacts.deleted=0";
$result =$this->db->query($query,true," Error filling in additional detail fields: ");
// Get the id and the name.
$row = $this->db->fetchByAssoc($result);
$GLOBALS['log']->info($row);
if($row != null) {
$this->contact_name = return_name($row, 'first_name', 'last_name');
$this->contact_phone = $row['phone_work'];
$this->contact_id = $row['id'];
$this->contact_name_owner = $row['contact_name_owner'];
$GLOBALS['log']->debug("Call($this->id): contact_name = $this->contact_name");
$GLOBALS['log']->debug("Call($this->id): contact_phone = $this->contact_phone");
$GLOBALS['log']->debug("Call($this->id): contact_id = $this->contact_id");
} else {
$this->contact_name = '';
$this->contact_phone = '';
$this->contact_id = '';
$GLOBALS['log']->debug("Call($this->id): contact_name = $this->contact_name");
$GLOBALS['log']->debug("Call($this->id): contact_phone = $this->contact_phone");
$GLOBALS['log']->debug("Call($this->id): contact_id = $this->contact_id");
}
$this->created_by_name = get_assigned_user_name($this->created_by);
$this->modified_by_name = get_assigned_user_name($this->modified_user_id);
$this->fill_in_additional_parent_fields();
if (!isset($this->time_hour_start)) {
$this->time_start_hour = intval(substr($this->time_start, 0, 2));
} //if-else
if (isset($this->time_minute_start)) {
$time_start_minutes = $this->time_minute_start;
} else {
$time_start_minutes = substr($this->time_start, 3, 5);
if ($time_start_minutes > 0 && $time_start_minutes < 15) {
$time_start_minutes = "15";
} else if ($time_start_minutes > 15 && $time_start_minutes < 30) {
$time_start_minutes = "30";
} else if ($time_start_minutes > 30 && $time_start_minutes < 45) {
$time_start_minutes = "45";
} else if ($time_start_minutes > 45) {
$this->time_start_hour += 1;
$time_start_minutes = "00";
} //if-else
} //if-else
if (isset($this->time_hour_start)) {
$time_start_hour = $this->time_hour_start;
} else {
$time_start_hour = intval(substr($this->time_start, 0, 2));
}
global $timedate;
$this->time_meridiem = $timedate->AMPMMenu('', $this->time_start, 'onchange="SugarWidgetScheduler.update_time();"');
$hours_arr = array ();
$num_of_hours = 13;
$start_at = 1;
if (empty ($time_meridiem)) {
$num_of_hours = 24;
$start_at = 0;
} //if
for ($i = $start_at; $i < $num_of_hours; $i ++) {
$i = $i."";
if (strlen($i) == 1) {
$i = "0".$i;
}
$hours_arr[$i] = $i;
} //for
if (!isset($this->duration_minutes)) {
$this->duration_minutes = $this->minutes_value_default;
}
//setting default date and time
if (is_null($this->date_start))
$this->date_start = $timedate->to_display_date_time(gmdate($GLOBALS['timedate']->get_db_date_time_format()));
if (is_null($this->time_start))
$this->time_start = $timedate->to_display_time(gmdate($GLOBALS['timedate']->get_db_date_time_format()), true);
if (is_null($this->duration_hours)) {
$this->duration_hours = "0";
}
if (is_null($this->duration_minutes))
$this->duration_minutes = "1";
global $current_user;
$reminder_t = $current_user->getPreference('reminder_time');
if (!empty ($this->reminder_time)) {
$reminder_t = $this->reminder_time;
}
global $app_list_strings;
$parent_types = $app_list_strings['record_type_display'];
$disabled_parent_types = ACLController::disabledModuleList($parent_types,false, 'list');
foreach($disabled_parent_types as $disabled_parent_type){
if($disabled_parent_type != $this->parent_type){
unset($parent_types[$disabled_parent_type]);
}
}
$this->parent_type_options = get_select_options_with_id($parent_types, $this->parent_type);
if (empty($this->reminder_time)) {
$this->reminder_time = -1;
}
$this->reminder_checked = $this->reminder_time == -1 ? false : true;
if (isset ($_REQUEST['parent_type'])) {
$this->parent_type = $_REQUEST['parent_type'];
} elseif (is_null($this->parent_type)) {
$this->parent_type = $app_list_strings['record_type_default_key'];
}
}
function fill_in_additional_parent_fields() {
global $app_strings, $beanFiles, $beanList;
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 {
$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 = '';
if($row['first_name'] != '') $this->parent_name .= stripslashes($row['first_name']). ' ';
if($row['last_name'] != '') $this->parent_name .= stripslashes($row['last_name']);
}
elseif($row != null)
{
$this->parent_name = stripslashes($row['name']);
}
else {
$this->parent_name = '';
}
}
function get_list_view_data() {
$meeting_fields = $this->get_list_view_array();
global $app_list_strings, $focus, $action, $currentModule, $image_path;
if(isset($this->parent_type))
$meeting_fields['PARENT_MODULE'] = $this->parent_type;
if($this->status == "Planned") {
//cn: added this if() to deal with sequential Closes in Meetings. this is a hack to a hack(formbase.php->handleRedirect)
if(empty($action)) { $action = "index"; }
$meeting_fields['SET_COMPLETE'] = "<a href='index.php?return_module=$currentModule&return_action=$action&return_id=$this->id&action=EditView&status=Held&module=Meetings&record=$this->id&status=Held'>".get_image($image_path."close_inline","title=".translate('LBL_LIST_CLOSE','Meetings')." border='0'")."</a>";
}
global $timedate;
$today = gmdate($GLOBALS['timedate']->get_db_date_time_format(), time());
$nextday = gmdate($GLOBALS['timedate']->dbDayFormat, time() + 3600*24);
$mergeTime = $meeting_fields['DATE_START']; //$timedate->merge_date_time($meeting_fields['DATE_START'], $meeting_fields['TIME_START']);
$date_db = $timedate->to_db($mergeTime);
if($date_db < $today ) {
$meeting_fields['DATE_START']= "<font class='overdueTask'>".$meeting_fields['DATE_START']."</font>";
}else if($date_db < $nextday) {
$meeting_fields['DATE_START'] = "<font class='todaysTask'>".$meeting_fields['DATE_START']."</font>";
} else {
$meeting_fields['DATE_START'] = "<font class='futureTask'>".$meeting_fields['DATE_START']."</font>";
}
$this->fill_in_additional_detail_fields();
$meeting_fields['CONTACT_ID'] = $this->contact_id;
$meeting_fields['CONTACT_NAME'] = $this->contact_name;
$meeting_fields['PARENT_NAME'] = $this->parent_name;
return $meeting_fields;
}
function set_notification_body($xtpl, &$meeting) {
global $sugar_config;
global $app_list_strings;
global $current_user;
global $timedate;
// cn: bug 9494 - passing a contact breaks this call
$notifyUser =($meeting->current_notify_user->object_name == 'User') ? $meeting->current_notify_user : $current_user;
// cn: bug 8078 - fixed call to $timedate
$prefDate = User::getUserDateTimePreferences($notifyUser);
if(strtolower(get_class($meeting->current_notify_user)) == 'contact') {
$xtpl->assign("ACCEPT_URL", $sugar_config['site_url'].
'/index.php?entryPoint=acceptDecline&module=Meetings&contact_id='.$meeting->current_notify_user->id.'&record='.$meeting->id);
} elseif(strtolower(get_class($meeting->current_notify_user)) == 'lead') {
$xtpl->assign("ACCEPT_URL", $sugar_config['site_url'].
'/index.php?entryPoint=acceptDecline&module=Meetings&lead_id='.$meeting->current_notify_user->id.'&record='.$meeting->id);
} else {
$xtpl->assign("ACCEPT_URL", $sugar_config['site_url'].
'/index.php?entryPoint=acceptDecline&module=Meetings&user_id='.$meeting->current_notify_user->id.'&record='.$meeting->id);
}
$xtpl->assign("MEETING_TO", $meeting->current_notify_user->new_assigned_user_name);
$xtpl->assign("MEETING_SUBJECT", trim($meeting->name));
$xtpl->assign("MEETING_STATUS",(isset($meeting->status)? $app_list_strings['meeting_status_dom'][$meeting->status]:""));
$xtpl->assign("MEETING_STARTDATE", $timedate->to_display_date_time($meeting->date_start,true,true,$notifyUser)." ".$prefDate['userGmt']);
$xtpl->assign("MEETING_HOURS", $meeting->duration_hours);
$xtpl->assign("MEETING_MINUTES", $meeting->duration_minutes);
$xtpl->assign("MEETING_DESCRIPTION", $meeting->description);
return $xtpl;
}
function get_meeting_users() {
$template = new User();
// First, get the list of IDs.
$query = "SELECT meetings_users.required, meetings_users.accept_status, meetings_users.user_id from meetings_users where meetings_users.meeting_id='$this->id' AND meetings_users.deleted=0";
$GLOBALS['log']->debug("Finding linked records $this->object_name: ".$query);
$result = $this->db->query($query, true);
$list = Array();
while($row = $this->db->fetchByAssoc($result)) {
$template = new User(); // PHP 5 will retrieve by reference, always over-writing the "old" one
$record = $template->retrieve($row['user_id']);
$template->required = $row['required'];
$template->accept_status = $row['accept_status'];
if($record != null) {
// this copies the object into the array
$list[] = $template;
}
}
return $list;
}
function get_invite_meetings(&$user) {
$template = $this;
// First, get the list of IDs.
$GLOBALS['log']->debug("Finding linked records $this->object_name: ".$query);
$query = "SELECT meetings_users.required, meetings_users.accept_status, meetings_users.meeting_id from meetings_users where meetings_users.user_id='$user->id' AND( meetings_users.accept_status IS NULL OR meetings_users.accept_status='none') AND meetings_users.deleted=0";
$result = $this->db->query($query, true);
$list = Array();
while($row = $this->db->fetchByAssoc($result)) {
$record = $template->retrieve($row['meeting_id']);
$template->required = $row['required'];
$template->accept_status = $row['accept_status'];
if($record != null)
{
// this copies the object into the array
$list[] = $template;
}
}
return $list;
}
function set_accept_status(&$user,$status)
{
if($user->object_name == 'User')
{
$relate_values = array('user_id'=>$user->id,'meeting_id'=>$this->id);
$data_values = array('accept_status'=>$status);
$this->set_relationship($this->rel_users_table, $relate_values, true, true,$data_values);
global $current_user;
require_once('modules/vCals/vCal.php');
if($this->update_vcal)
{
vCal::cache_sugar_vcal($user);
}
}
else if($user->object_name == 'Contact')
{
$relate_values = array('contact_id'=>$user->id,'meeting_id'=>$this->id);
$data_values = array('accept_status'=>$status);
$this->set_relationship($this->rel_contacts_table, $relate_values, true, true,$data_values);
}
else if($user->object_name == 'Lead')
{
$relate_values = array('lead_id'=>$user->id,'meeting_id'=>$this->id);
$data_values = array('accept_status'=>$status);
$this->set_relationship($this->rel_leads_table, $relate_values, true, true,$data_values);
}
}
function get_notification_recipients() {
$list = array();
if(!is_array($this->contacts_arr)) {
$this->contacts_arr = array();
}
if(!is_array($this->users_arr)) {
$this->users_arr = array();
}
if(!is_array($this->leads_arr)) {
$this->leads_arr = array();
}
foreach($this->users_arr as $user_id) {
$notify_user = new User();
$notify_user->retrieve($user_id);
$notify_user->new_assigned_user_name = $notify_user->full_name;
$GLOBALS['log']->info("Notifications: recipient is $notify_user->new_assigned_user_name");
$list[] = $notify_user;
}
foreach($this->contacts_arr as $contact_id) {
$notify_user = new Contact();
$notify_user->retrieve($contact_id);
$notify_user->new_assigned_user_name = $notify_user->full_name;
$GLOBALS['log']->info("Notifications: recipient is $notify_user->new_assigned_user_name");
$list[] = $notify_user;
}
foreach($this->leads_arr as $lead_id) {
$notify_user = new Lead();
$notify_user->retrieve($lead_id);
$notify_user->new_assigned_user_name = $notify_user->full_name;
$GLOBALS['log']->info("Notifications: recipient is $notify_user->new_assigned_user_name");
$list[] = $notify_user;
}
return $list;
}
function bean_implements($interface) {
switch($interface) {
case 'ACL':return true;
}
return false;
}
function listviewACLHelper() {
$array_assign = parent::listviewACLHelper();
$is_owner = false;
if(!empty($this->parent_name)) {
if(!empty($this->parent_name_owner)) {
global $current_user;
$is_owner = $current_user->id == $this->parent_name_owner;
}
}
if(!ACLController::moduleSupportsACL($this->parent_type) || ACLController::checkAccess($this->parent_type, 'view', $is_owner)) {
$array_assign['PARENT'] = 'a';
} else {
$array_assign['PARENT'] = 'span';
}
$is_owner = false;
if(!empty($this->contact_name)) {
if(!empty($this->contact_name_owner)) {
global $current_user;
$is_owner = $current_user->id == $this->contact_name_owner;
}
}
if(ACLController::checkAccess('Contacts', 'view', $is_owner)) {
$array_assign['CONTACT'] = 'a';
} else {
$array_assign['CONTACT'] = 'span';
}
return $array_assign;
}
function save_relationship_changes($is_update) {
parent::save_relationship_changes($is_update, array('contact_id', 'user_id'));
}
} // end class def
?>

View File

@@ -0,0 +1,421 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2009 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
/*********************************************************************************
* $Id$
* Description: Base Form For Meetings
* Portions created by SugarCRM are Copyright(C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
class MeetingFormBase{
function getFormBody($prefix, $mod='', $formname=''){
if(!ACLController::checkAccess('Meetings', 'edit', true)){
return '';
}
require_once('include/time.php');
global $mod_strings;
global $app_strings;
global $app_list_strings;
global $current_user;
global $theme;
global $timedate;
$temp_strings = $mod_strings;
if(!empty($mod)){
global $current_language;
$mod_strings = return_module_language($current_language, $mod);
}
// Unimplemented until jscalendar language files are fixed
// global $current_language;
// global $default_language;
// global $cal_codes;
$cal_lang = "en";
$cal_dateformat = $timedate->get_cal_date_format();
$lbl_required_symbol = $app_strings['LBL_REQUIRED_SYMBOL'];
$lbl_date = $mod_strings['LBL_DATE'];
$lbl_time = $mod_strings['LBL_TIME'];
$ntc_date_format = $timedate->get_user_date_format();
$ntc_time_format = '('.$timedate->get_user_time_format().')';
$user_id = $current_user->id;
$default_status = $app_list_strings['meeting_status_default'];
$default_parent_type= $app_list_strings['record_type_default_key'];
$default_date_start = $timedate->to_display_date(date('Y-m-d'),false);
$default_time_start = $timedate->to_display_time((date('H:i')), true, false);
$time_ampm = $timedate->AMPMMenu($prefix,date('H:i'));
// Unimplemented until jscalendar language files are fixed
// $cal_lang =(empty($cal_codes[$current_language])) ? $cal_codes[$default_language] : $cal_codes[$current_language];
$form = <<<EOF
<input type="hidden" name="${prefix}record" value="">
<input type="hidden" name="${prefix}status" value="${default_status}">
<input type="hidden" name="${prefix}parent_type" value="${default_parent_type}">
<input type="hidden" name="${prefix}assigned_user_id" value='${user_id}'>
<input type="hidden" name="${prefix}duration_hours" value="1">
<input type="hidden" name="${prefix}duration_minutes" value="00">
<p>$lbl_subject<span class="required">$lbl_required_symbol</span><br>
<input name='${prefix}name' size='25' maxlength='255' type="text"><br>
$lbl_date&nbsp;<span class="required">$lbl_required_symbol</span>&nbsp;<span class="dateFormat">$ntc_date_format</span><br>
<input name='${prefix}date_start' id='jscal_field' onblur="parseDate(this, '$cal_dateformat');" type="text" maxlength="10" value="${default_date_start}"> <img src="themes/default/images/jscalendar.gif" alt="{$app_strings['LBL_ENTER_DATE']}" id="jscal_trigger" align="absmiddle"><br>
$lbl_time&nbsp;<span class="required">$lbl_required_symbol</span>&nbsp;<span class="dateFormat">$ntc_time_format</span><br>
<input name='${prefix}time_start' type="text" maxlength='5' value="${default_time_start}">{$time_ampm}</p>
<script type="text/javascript">
Calendar.setup({
inputField : "jscal_field", daFormat : "$cal_dateformat", ifFormat : "$cal_dateformat", showsTime : false, button : "jscal_trigger", singleClick : true, step : 1
});
</script>
EOF;
require_once('include/javascript/javascript.php');
require_once('modules/Meetings/Meeting.php');
$javascript = new javascript();
$javascript->setFormName($formname);
$javascript->setSugarBean(new Meeting());
$javascript->addRequiredFields($prefix);
$form .=$javascript->getScript();
$mod_strings = $temp_strings;
return $form;
}
function getForm($prefix, $mod='Meetings'){
if(!ACLController::checkAccess('Meetings', 'edit', true)){
return '';
}
global $app_strings;
global $app_list_strings;
if(!empty($mod)){
global $current_language;
$mod_strings = return_module_language($current_language, $mod);
} else {
global $mod_strings;
}
$lbl_save_button_title = $app_strings['LBL_SAVE_BUTTON_TITLE'];
$lbl_save_button_key = $app_strings['LBL_SAVE_BUTTON_KEY'];
$lbl_save_button_label = $app_strings['LBL_SAVE_BUTTON_LABEL'];
$the_form = get_left_form_header($mod_strings['LBL_NEW_FORM_TITLE']);
$the_form .= <<<EOQ
<form name="${prefix}MeetingSave" onSubmit="return check_form('${prefix}MeetingSave')" method="POST" action="index.php">
<input type="hidden" name="${prefix}module" value="Meetings">
<input type="hidden" name="${prefix}action" value="Save">
EOQ;
$the_form .= $this->getFormBody($prefix, 'Meetings',"${prefix}MeetingSave" );
$the_form .= <<<EOQ
<p><input title="$lbl_save_button_title" accessKey="$lbl_save_button_key" class="button" type="submit" name="button" value=" $lbl_save_button_label " ></p>
</form>
EOQ;
$the_form .= get_left_form_footer();
$the_form .= get_validate_record_js();
return $the_form;
}
/**
* handles save functionality for meetings
* @param string prefix
* @param bool redirect default True
* @param bool useRequired default True
*/
function handleSave($prefix,$redirect=true, $useRequired=false) {
require_once('include/TimeDate.php');
require_once('modules/Meetings/Meeting.php');
require_once('include/formbase.php');
global $current_user;
global $timedate;
$focus = new Meeting();
if($useRequired && !checkRequired($prefix, array_keys($focus->required_fields))) {
return null;
}
if( !isset($_POST['reminder_checked']) or ( isset($_POST['reminder_checked']) && $_POST['reminder_checked'] == '0')) {
$_POST['reminder_time'] = null;
}
if(!isset($_POST['reminder_time'])) {
$_POST['reminder_time'] = $current_user->getPreference('reminder_time');
$_POST['reminder_checked']=1;
}
$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.'time_hour_start']) && empty($_POST['time_start'])) {
$_POST[$prefix.'time_start'] = $_POST[$prefix.'time_hour_start']. $time_separator .$_POST[$prefix.'time_minute_start'];
}
if(isset($_POST[$prefix.'meridiem']) && !empty($_POST[$prefix.'meridiem'])) {
$_POST[$prefix.'time_start'] = $timedate->merge_time_meridiem($_POST[$prefix.'time_start'],$timedate->get_time_format(true), $_POST[$prefix.'meridiem']);
}
if(isset($_POST[$prefix.'time_start']) && strlen($_POST[$prefix.'date_start']) == 10) {
$_POST[$prefix.'date_start'] = $_POST[$prefix.'date_start'] . ' ' . $_POST[$prefix.'time_start'];
}
// retrieve happens here
$focus = populateFromPost($prefix, $focus);
if(!$focus->ACLAccess('Save')) {
ACLController::displayNoAccess(true);
sugar_cleanup(true);
}
if(isset($_POST['isSaveFromDetailView']) && $_POST['isSaveFromDetailView'] == 'true'){
$focus->save(true);
$return_id = $focus->id;
}else{
///////////////////////////////////////////////////////////////////////////
//// REMOVE INVITEE RELATIONSHIPS
if(!empty($_POST['user_invitees'])) {
$userInvitees = explode(',', trim($_POST['user_invitees'], ','));
} else {
$userInvitees = array();
}
// Calculate which users to flag as deleted and which to add
$deleteUsers = array();
$focus->load_relationship('users');
// Get all users for the meeting
$q = 'SELECT mu.user_id, mu.accept_status FROM meetings_users mu WHERE mu.meeting_id = \''.$focus->id.'\'';
$r = $focus->db->query($q);
$acceptStatusUsers = array();
while($a = $focus->db->fetchByAssoc($r)) {
if(!in_array($a['user_id'], $userInvitees)) {
$deleteUsers[$a['user_id']] = $a['user_id'];
} else {
$acceptStatusUsers[$a['user_id']] = $a['accept_status'];
}
}
if(count($deleteUsers) > 0) {
$sql = '';
foreach($deleteUsers as $u) {
$sql .= ",'" . $u . "'";
}
$sql = substr($sql, 1);
// We could run a delete SQL statement here, but will just mark as deleted instead
$sql = "UPDATE meetings_users set deleted = 1 where user_id in ($sql) AND meeting_id = '". $focus->id . "'";
$focus->db->query($sql);
}
// Get all contacts for the meeting
if(!empty($_POST['contact_invitees'])) {
$contactInvitees = explode(',', trim($_POST['contact_invitees'], ','));
} else {
$contactInvitees = array();
}
$deleteContacts = array();
$focus->load_relationship('contacts');
$q = 'SELECT mu.contact_id, mu.accept_status FROM meetings_contacts mu WHERE mu.meeting_id = \''.$focus->id.'\'';
$r = $focus->db->query($q);
$acceptStatusContacts = array();
while($a = $focus->db->fetchByAssoc($r)) {
if(!in_array($a['contact_id'], $contactInvitees)) {
$deleteContacts[$a['contact_id']] = $a['contact_id'];
} else {
$acceptStatusContacts[$a['contact_id']] = $a['accept_status'];
}
}
if(count($deleteContacts) > 0) {
$sql = '';
foreach($deleteContacts as $u) {
$sql .= ",'" . $u . "'";
}
$sql = substr($sql, 1);
// We could run a delete SQL statement here, but will just mark as deleted instead
$sql = "UPDATE meetings_contacts set deleted = 1 where contact_id in ($sql) AND meeting_id = '". $focus->id . "'";
$focus->db->query($sql);
}
if(!empty($_POST['lead_invitees'])) {
$leadInvitees = explode(',', trim($_POST['lead_invitees'], ','));
} else {
$leadInvitees = array();
}
$deleteLeads = array();
$focus->load_relationship('leads');
$q = 'SELECT mu.lead_id, mu.accept_status FROM meetings_leads mu WHERE mu.meeting_id = \''.$focus->id.'\'';
$r = $focus->db->query($q);
$acceptStatusLeads = array();
while($a = $focus->db->fetchByAssoc($r)) {
if(!in_array($a['lead_id'], $leadInvitees)) {
$deleteLeads[$a['lead_id']] = $a['lead_id'];
} else {
$acceptStatusLeads[$a['lead_id']] = $a['accept_status'];
}
}
if(count($deleteLeads) > 0) {
$sql = '';
foreach($deleteLeads as $u) {
$sql .= ",'" . $u . "'";
}
$sql = substr($sql, 1);
// We could run a delete SQL statement here, but will just mark as deleted instead
$sql = "UPDATE meetings_leads set deleted = 1 where lead_id in ($sql) AND meeting_id = '". $focus->id . "'";
$focus->db->query($sql);
}
//// END REMOVE
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
//// REBUILD INVITEE RELATIONSHIPS
$focus->users_arr = array();
$focus->users_arr = $userInvitees;
$focus->contacts_arr = array();
$focus->contacts_arr = $contactInvitees;
$focus->leads_arr = array();
$focus->leads_arr = $leadInvitees;
if(!empty($_POST['parent_id']) && $_POST['parent_type'] == 'Contacts') {
$focus->contacts_arr[] = $_POST['parent_id'];
}
if(!empty($_POST['parent_id']) && $_POST['parent_type'] == 'Leads') {
$focus->leads_arr[] = $_POST['parent_id'];
}
// Call the Meeting module's save function to handle saving other fields besides
// the users and contacts relationships
$focus->save(true);
$return_id = $focus->id;
// Process users
$existing_users = array();
if(!empty($_POST['existing_invitees'])) {
$existing_users = explode(",", trim($_POST['existing_invitees'], ','));
}
foreach($focus->users_arr as $user_id) {
if(empty($user_id) || isset($existing_users[$user_id]) || isset($deleteUsers[$user_id])) {
continue;
}
if(!isset($acceptStatusUsers[$user_id])) {
$focus->users->add($user_id);
} else {
// update query to preserve accept_status
$qU = 'UPDATE meetings_users SET deleted = 0, accept_status = \''.$acceptStatusUsers[$user_id].'\' ';
$qU .= 'WHERE meeting_id = \''.$focus->id.'\' ';
$qU .= 'AND user_id = \''.$user_id.'\'';
$focus->db->query($qU);
}
}
// Process contacts
$existing_contacts = array();
if(!empty($_POST['existing_contact_invitees'])) {
$existing_contacts = explode(",", trim($_POST['existing_contact_invitees'], ','));
}
foreach($focus->contacts_arr as $contact_id) {
if(empty($contact_id) || isset($exiting_contacts[$contact_id]) || isset($deleteContacts[$contact_id])) {
continue;
}
if(!isset($acceptStatusContacts[$contact_id])) {
$focus->contacts->add($contact_id);
} else {
// update query to preserve accept_status
$qU = 'UPDATE meetings_contacts SET deleted = 0, accept_status = \''.$acceptStatusContacts[$contact_id].'\' ';
$qU .= 'WHERE meeting_id = \''.$focus->id.'\' ';
$qU .= 'AND contact_id = \''.$contact_id.'\'';
$focus->db->query($qU);
}
}
// Process leads
$existing_leads = array();
if(!empty($_POST['existing_lead_invitees'])) {
$existing_leads = explode(",", trim($_POST['existing_lead_invitees'], ','));
}
foreach($focus->leads_arr as $lead_id) {
if(empty($lead_id) || isset($exiting_leads[$lead_id]) || isset($deleteLeads[$lead_id])) {
continue;
}
if(!isset($acceptStatusLeads[$lead_id])) {
$focus->leads->add($lead_id);
} else {
// update query to preserve accept_status
$qU = 'UPDATE meetings_leads SET deleted = 0, accept_status = \''.$acceptStatusLeads[$lead_id].'\' ';
$qU .= 'WHERE meeting_id = \''.$focus->id.'\' ';
$qU .= 'AND lead_id = \''.$lead_id.'\'';
$focus->db->query($qU);
}
}
// set organizer to auto-accept
$focus->set_accept_status($current_user, 'accept');
//// END REBUILD INVITEE RELATIONSHIPS
///////////////////////////////////////////////////////////////////////////
}
if (isset($_REQUEST['return_module']) && $_REQUEST['return_module'] == 'Home'){
header("Location: index.php?module=Home&action=index");
}
else if($redirect) {
handleRedirect($return_id, 'Meetings');
} else {
return $focus;
}
} // end handleSave();
} // end Class def
?>

View File

@@ -0,0 +1,164 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2009 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
require_once('include/EditView/QuickCreate.php');
require_once('modules/Meetings/Meeting.php');
require_once('include/javascript/javascript.php');
class MeetingsQuickCreate extends QuickCreate {
var $javascript;
function process() {
global $current_user, $timedate, $app_list_strings, $current_language, $mod_strings, $timeMeridiem;
$mod_strings = return_module_language($current_language, 'Meetings');
parent::process();
$this->ss->assign("STATUS_OPTIONS", get_select_options_with_id($app_list_strings['meeting_status_dom'], $app_list_strings['meeting_status_default']));
$this->ss->assign("CALENDAR_DATEFORMAT", $timedate->get_cal_date_format());
$this->ss->assign("TIME_FORMAT", '('. $timedate->get_user_time_format().')');
$this->ss->assign("USER_DATEFORMAT", '('. $timedate->get_user_date_format().')');
if($this->viaAJAX) { // override for ajax call
$this->ss->assign('saveOnclick', "onclick='if(check_form(\"meetingsQuickCreate\")) 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('meetingsQuickCreate');
$focus = new Meeting();
$this->javascript->setSugarBean($focus);
$this->javascript->addAllFields('');
if (is_null($focus->date_start))
$focus->date_start = $timedate->to_display_date(gmdate($GLOBALS['timedate']->get_db_date_time_format()));
if (is_null($focus->time_start))
$focus->time_start = $timedate->to_display_time(gmdate($GLOBALS['timedate']->get_db_date_time_format()), true);
if (!isset ($focus->duration_hours))
$focus->duration_hours = "1";
$date_start_array=split(" ",trim($focus->date_start));
if (count($date_start_array)==2) {
$focus->time_start = $timedate->to_db_time($date_start_array[1], false);
//$focus->date_start = $date_start_array[0];
}
$this->ss->assign("DATE_START", $focus->date_start);
$this->ss->assign("TIME_START", substr($focus->time_start,0,5));
$time_start_hour = intval(substr($focus->time_start, 0, 2));
$time_start_minutes = substr($focus->time_start, 3, 5);
if ($time_start_minutes > 0 && $time_start_minutes < 15) {
$time_start_minutes = "15";
} else
if ($time_start_minutes > 15 && $time_start_minutes < 30) {
$time_start_minutes = "30";
} else
if ($time_start_minutes > 30 && $time_start_minutes < 45) {
$time_start_minutes = "45";
} else
if ($time_start_minutes > 45) {
$time_start_hour += 1;
$time_start_minutes = "00";
}
// We default the to assume that the time preference is set to 11:00 (i.e. without meridiem)
$hours_arr = array ();
$num_of_hours = 24;
$start_at = 0;
$time_pref = $timedate->get_time_format();
if(strpos($time_pref, 'a') || strpos($time_pref, 'A')) {
$num_of_hours = 13;
$start_at = 1;
}
/*
// Seems to be problematic... $time_meridiem is always empty
if (empty ($time_meridiem)) {
$num_of_hours = 24;
$start_at = 0;
}
*/
for ($i = $start_at; $i < $num_of_hours; $i ++) {
$i = $i."";
if (strlen($i) == 1) {
$i = "0".$i;
}
$hours_arr[$i] = $i;
}
$this->ss->assign("TIME_START_HOUR_OPTIONS", get_select_options_with_id($hours_arr, $time_start_hour));
$this->ss->assign("TIME_START_MINUTE_OPTIONS", get_select_options_with_id($focus->minutes_values, $time_start_minutes));
$this->ss->assign("DURATION_HOURS", $focus->duration_hours);
$this->ss->assign("DURATION_MINUTES_OPTIONS", get_select_options_with_id($focus->minutes_values, $focus->duration_minutes));
// Test to see if time format is 11:00am; otherwise it's 11:00AM
if($num_of_hours == 13) {
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(!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('additionalScripts', $this->javascript->getScript(false));
}
}
?>

72
modules/Meetings/Menu.php Executable file
View File

@@ -0,0 +1,72 @@
<?php
//2008-10-08, Dawid Karlowicz, Section1
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
/*********************************************************************************
* Description: TODO To be written.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
global $mod_strings;
//<Section1>
//Before
/*
if(ACLController::checkAccess('Calls', 'edit', true))$module_menu[]=Array("index.php?module=Calls&action=EditView&return_module=Calls&return_action=DetailView", $mod_strings['LNK_NEW_CALL'],"CreateCalls");
if(ACLController::checkAccess('Meetings', 'edit', true))$module_menu[]=Array("index.php?module=Meetings&action=EditView&return_module=Meetings&return_action=DetailView", $mod_strings['LNK_NEW_MEETING'],"CreateMeetings");
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'],"CreateTasks");
if(ACLController::checkAccess('Notes', 'edit', true))$module_menu[]=Array("index.php?module=Notes&action=EditView&return_module=Notes&return_action=DetailView", $mod_strings['LNK_NEW_NOTE'],"CreateNotes");
if(ACLController::checkAccess('Emails', 'edit', true))$module_menu[]=Array("index.php?module=Emails&action=Compose", $mod_strings['LNK_NEW_EMAIL'],"CreateEmails");
if(ACLController::checkAccess('Calls', 'list', true))$module_menu[]=Array("index.php?module=Calls&action=index&return_module=Calls&return_action=DetailView", $mod_strings['LNK_CALL_LIST'],"Calls");
if(ACLController::checkAccess('Meetings', 'list', true))$module_menu[]=Array("index.php?module=Meetings&action=index&return_module=Meetings&return_action=DetailView", $mod_strings['LNK_MEETING_LIST'],"Meetings");
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'],"Tasks");
if(ACLController::checkAccess('Notes', 'list', true))$module_menu[]=Array("index.php?module=Notes&action=index&return_module=Notes&return_action=DetailView", $mod_strings['LNK_NOTE_LIST'],"Notes");
if(ACLController::checkAccess('Emails', 'list', true))$module_menu[]=Array("index.php?module=Emails&action=index&return_module=Emails&return_action=DetailView", $mod_strings['LNK_EMAIL_LIST'],"Emails");
if(ACLController::checkAccess('Calendar', 'list', true))$module_menu[]=Array("index.php?module=Calendar&action=index&view=day", $mod_strings['LNK_VIEW_CALENDAR'],"Calendar");
if(ACLController::checkAccess('Meetings','list', true)) $module_menu[] = Array('#', '<span style="display: none">wp_shortcut_fill_0</span>', '');
*/
//After
if(ACLController::checkAccess('Meetings', 'edit', true))$module_menu[]=Array("index.php?module=Meetings&action=EditView&return_module=Meetings&return_action=DetailView", $mod_strings['LNK_NEW_MEETING'],"CreateMeetings");
if(ACLController::checkAccess('Meetings', 'list', true))$module_menu[]=Array("index.php?module=Meetings&action=index&return_module=Meetings&return_action=DetailView", $mod_strings['LNK_MEETING_LIST'],"Meetings");
if(ACLController::checkAccess('Meetings','list', true)) $module_menu[] = Array('#', '<span style="display: none">wp_shortcut_fill_0</span>', '');
//</Section1>
?>

49
modules/Meetings/Save.php Executable file
View File

@@ -0,0 +1,49 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2009 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
/*********************************************************************************
* Description: 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): ______________________________________..
********************************************************************************/
require_once('modules/Meetings/MeetingFormBase.php');
$formBase = new MeetingFormBase();
$formBase->handleSave('', true, false);
?>

View File

@@ -0,0 +1,151 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2009 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
/*********************************************************************************
* Description: TODO: To be written.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
require_once('XTemplate/xtpl.php');
global $currentModule;
global $mod_strings;
global $app_strings;
global $theme;
global $focus;
global $action;
$theme_path="themes/".$theme."/";
$image_path=$theme_path."images/";
// focus_list is the means of passing data to a SubPanelView.
global $focus_list;
$button = "<table cellspacing='0' cellpadding='1' border='0'><form border='0' action='index.php' method='post' name='form' id='form'>\n";
$button .= "<input type='hidden' name='module' value='Contacts'>\n";
if ($currentModule == 'Accounts') $button .= "<input type='hidden' name='account_id' value='$focus->id'>\n<input type='hidden' name='account_name' value='$focus->name'>\n";
$button .= "<input type='hidden' name='return_module' value='".$currentModule."'>\n";
$button .= "<input type='hidden' name='return_action' value='".$action."'>\n";
$button .= "<input type='hidden' name='return_id' value='".$focus->id."'>\n";
$button .= "<input type='hidden' name='action'>\n";
$button .= "<tr><td>&nbsp;</td>";
if ($focus->parent_type == "Accounts") $button .= "<td><input title='".$app_strings['LBL_SELECT_CONTACT_BUTTON_TITLE']."' accessKey='".$app_strings['LBL_SELECT_CONTACT_BUTTON_KEY']."' type='button' class='button' value='".$app_strings['LBL_SELECT_CONTACT_BUTTON_LABEL']."' name='button' LANGUAGE=javascript onclick='window.open(\"index.php?module=Contacts&action=Popup&html=Popup_picker&form=DetailView&form_submit=true&query=true&account_id=$focus->parent_id&account_name=".urlencode($focus->parent_name)."\",\"new\",\"width=600,height=400,resizable=1,scrollbars=1\");'></td>\n";
else $button .= "<td><input title='".$app_strings['LBL_SELECT_CONTACT_BUTTON_TITLE']."' accessKey='".$app_strings['LBL_SELECT_CONTACT_BUTTON_KEY']."' type='button' class='button' value='".$app_strings['LBL_SELECT_CONTACT_BUTTON_LABEL']."' name='button' LANGUAGE=javascript onclick='window.open(\"index.php?module=Contacts&action=Popup&html=Popup_picker&form=DetailView&form_submit=true\",\"new\",\"width=600,height=400,resizable=1,scrollbars=1\");'></td>\n";
$button .= "<td><input title='".$app_strings['LBL_SELECT_USER_BUTTON_TITLE']."' accessKey='".$app_strings['LBL_SELECT_USER_BUTTON_KEY']."' type='button' class='button' value='".$app_strings['LBL_SELECT_USER_BUTTON_LABEL']."' name='button' LANGUAGE=javascript onclick='window.open(\"index.php?module=Users&action=Popup&html=Popup_picker&form=DetailView&form_submit=true\",\"new\",\"width=600,height=400,resizable=1,scrollbars=1\");'></td>\n";
$button .= "</tr></form></table>\n";
// Stick the form header out there.
echo get_form_header($mod_strings['LBL_INVITEE'], $button, false);
$xtpl=new XTemplate ('modules/Meetings/SubPanelViewInvitees.html');
$xtpl->assign("MOD", $mod_strings);
$xtpl->assign("APP", $app_strings);
$xtpl->assign("IMAGE_PATH", $image_path);
$xtpl->assign("RETURN_URL", "&return_module=$currentModule&return_action=DetailView&return_id=$focus->id");
$xtpl->assign("MEETING_ID", $focus->id);
$oddRow = true;
foreach($focus_users_list as $user)
{
$user_fields = array(
'USER_NAME' => $user->user_name,
'FULL_NAME' => $user->first_name." ".$user->last_name,
'ID' => $user->id,
'EMAIL' => $user->email1,
'PHONE_WORK' => $user->phone_work
);
$xtpl->assign("USER", $user_fields);
if($oddRow)
{
//todo move to themes
$xtpl->assign("ROW_COLOR", 'oddListRow');
}
else
{
//todo move to themes
$xtpl->assign("ROW_COLOR", 'evenListRow');
}
$oddRow = !$oddRow;
$xtpl->parse("users.row");
// Put the rows in.
}
$xtpl->parse("users");
$xtpl->out("users");
$oddRow = true;
foreach($focus_contacts_list as $contact)
{
$contact_fields = array(
'FIRST_NAME' => $contact->first_name,
'LAST_NAME' => $contact->last_name,
'ACCOUNT_NAME' => $contact->account_name,
'ID' => $contact->id,
'EMAIL' => $contact->email1,
'PHONE_WORK' => $contact->phone_work
);
$xtpl->assign("CONTACT", $contact_fields);
if($oddRow)
{
//todo move to themes
$xtpl->assign("ROW_COLOR", 'oddListRow');
}
else
{
//todo move to themes
$xtpl->assign("ROW_COLOR", 'evenListRow');
}
$oddRow = !$oddRow;
$xtpl->parse("contacts.row");
// Put the rows in.
}
$xtpl->parse("contacts");
$xtpl->out("contacts");
?>

View File

@@ -0,0 +1,75 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2009 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
/*********************************************************************************
* Description: Contains field arrays that are used for caching
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
$fields_array['Meeting'] = array ('column_fields' => Array("id"
, "date_entered"
, "date_modified"
, "assigned_user_id"
, "modified_user_id"
, "created_by"
, "description"
, "name"
, "status"
, "location"
, "date_start"
, "time_start"
, "date_end"
, "duration_hours"
, "duration_minutes"
, "parent_type"
, "parent_id"
, 'reminder_time'
,'outlook_id'
),
'list_fields' => Array('id', 'location', 'duration_hours', 'name ', 'status', 'parent_type', 'parent_name', 'parent_id', 'date_start', 'time_start', 'assigned_user_name', 'assigned_user_id', 'contact_name', 'contact_id','first_name','last_name','required','accept_status','outlook_id','duration_minutes'
),
'required_fields' => array("name"=>1, "date_start"=>2, "time_start"=>3, "duration_hours"=>4),
);
?>

View File

@@ -0,0 +1,128 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2009 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
/*********************************************************************************
* Description: Defines the English language pack for the base application.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
$mod_strings = array (
'ERR_DELETE_RECORD' => 'A record number must be specified to delete the meeting.',
'LBL_ACCEPT_THIS'=>'Accept?',
'LBL_ADD_BUTTON'=> 'Add',
'LBL_ADD_INVITEE' => 'Add Invitees',
'LBL_COLON' => ':',
'LBL_CONTACT_NAME' => 'Contact:',
'LBL_CONTACTS_SUBPANEL_TITLE' => 'Contacts',
'LBL_CREATED_BY'=>'Created by',
'LBL_DATE_END'=>'Date End',
'LBL_DATE_TIME' => 'Start Date & Time:',
'LBL_DATE' => 'Start Date:',
'LBL_DEFAULT_STATUS' => 'Planned',
'LBL_DEFAULT_SUBPANEL_TITLE' => 'Meetings',
'LBL_DEL'=> 'Del',
'LBL_DESCRIPTION_INFORMATION' => 'Description Information',
'LBL_DESCRIPTION' => 'Description:',
'LBL_DURATION_HOURS' => 'Duration Hours:',
'LBL_DURATION_MINUTES' => 'Duration Minutes:',
'LBL_DURATION' => 'Duration:',
'LBL_EMAIL' => 'Email',
'LBL_FIRST_NAME' => 'First Name',
'LBL_HISTORY_SUBPANEL_TITLE' => 'Notes',
'LBL_HOURS_ABBREV' => 'h',
'LBL_HOURS_MINS' => '(hours/minutes)',
'LBL_INVITEE' => 'Invitees',
'LBL_LAST_NAME' => 'Last Name',
'LBL_ASSIGNED_TO_NAME'=>'Assigned to:',
'LBL_LIST_ASSIGNED_TO_NAME' => 'Assigned User',
'LBL_LIST_CLOSE' => 'Close',
'LBL_LIST_CONTACT' => 'Contact',
'LBL_LIST_DATE_MODIFIED'=>'Date Modified',
'LBL_LIST_DATE' => 'Start Date',
'LBL_LIST_DUE_DATE'=>'Due Date',
'LBL_LIST_FORM_TITLE' => 'Meeting List',
'LBL_LIST_MY_MEETINGS' => 'My Meetings',
'LBL_LIST_RELATED_TO' => 'Related to',
'LBL_LIST_STATUS'=>'Status',
'LBL_LIST_SUBJECT' => 'Subject',
'LBL_LIST_TIME' => 'Start Time',
'LBL_LEADS_SUBPANEL_TITLE' => 'Leads',
'LBL_LOCATION' => 'Location:',
'LBL_MEETING' => 'Meeting:',
'LBL_MINSS_ABBREV' => 'm',
'LBL_MODIFIED_BY'=>'Modified by',
'LBL_MODULE_NAME' => 'Meetings',
'LBL_MODULE_TITLE' => 'Meetings: Home',
'LBL_NAME' => 'Name',
'LBL_NEW_FORM_TITLE' => 'Create Appointment',
'LBL_OUTLOOK_ID' => 'Outlook ID',
'LBL_PHONE' => 'Phone Office:',
'LBL_REMINDER_TIME'=>'Reminder Time',
'LBL_REMINDER' => 'Reminder:',
'LBL_SCHEDULING_FORM_TITLE' => 'Scheduling',
'LBL_SEARCH_BUTTON'=> 'Search',
'LBL_SEARCH_FORM_TITLE' => 'Meeting Search',
'LBL_SEND_BUTTON_KEY'=>'I',
'LBL_SEND_BUTTON_LABEL'=>'Send Invites',
'LBL_SEND_BUTTON_TITLE'=>'Send Invites [Alt+I]',
'LBL_STATUS' => 'Status:',
'LBL_SUBJECT' => 'Subject:',
'LBL_TIME' => 'Start Time:',
'LBL_USERS_SUBPANEL_TITLE' => 'Users',
'LNK_CALL_LIST'=>'Calls',
'LNK_EMAIL_LIST'=>'Emails',
'LNK_MEETING_LIST'=>'Meetings',
'LNK_NEW_APPOINTMENT' => 'Create Appointment',
'LNK_NEW_CALL'=>'Schedule Call',
'LNK_NEW_EMAIL'=>'Archive Email',
'LNK_NEW_MEETING'=>'Schedule Meeting',
'LNK_NEW_NOTE'=>'Create Note or Attachment',
'LNK_NEW_TASK'=>'Create Task',
'LNK_NOTE_LIST'=>'Notes',
'LNK_TASK_LIST'=>'Tasks',
'LNK_VIEW_CALENDAR' => 'Today',
'NTC_REMOVE_INVITEE' => 'Are you sure you want to remove this invitee from the meeting?',
'LBL_CREATED_USER' => 'Created User',
'LBL_MODIFIED_USER' => 'Modified User',
'NOTICE_DURATION_TIME' => 'Duration time must be greater than 0',
);
?>

View File

@@ -0,0 +1,128 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2009 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
/*********************************************************************************
* Description: Defines the English language pack for the base application.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
$mod_strings = array (
'ERR_DELETE_RECORD' => 'Die Datensatznummer muß angegeben werden, um diesen Eintrag löschen.',
'LBL_ACCEPT_THIS'=>'Bestätigen?',
'LBL_ADD_BUTTON'=> 'Hinzufügen',
'LBL_ADD_INVITEE' => 'Teilnehmer hinzufügen',
'LBL_COLON' => ':',
'LBL_CONTACT_NAME' => 'Kontakt:',
'LBL_CONTACTS_SUBPANEL_TITLE' => 'Kontakte',
'LBL_CREATED_BY'=>'Erstellt von:',
'LBL_DATE_END'=>'Enddatum',
'LBL_DATE_TIME' => 'Startdatum und -zeit:',
'LBL_DATE' => 'Startdatum:',
'LBL_DEFAULT_STATUS' => 'Geplant',
'LBL_DEFAULT_SUBPANEL_TITLE' => 'Meetings',
'LBL_DEL'=> 'Löschen',
'LBL_DESCRIPTION_INFORMATION' => 'Beschreibungsinformation',
'LBL_DESCRIPTION' => 'Beschreibung:',
'LBL_DURATION_HOURS' => 'Stunden:',
'LBL_DURATION_MINUTES' => 'Minuten:',
'LBL_DURATION' => 'Dauer:',
'LBL_EMAIL' => 'E-Mail',
'LBL_FIRST_NAME' => 'Vorname',
'LBL_HISTORY_SUBPANEL_TITLE' => 'Notizen',
'LBL_HOURS_ABBREV' => 'St.',
'LBL_HOURS_MINS' => '(Stunden/Minuten)',
'LBL_INVITEE' => 'Teilnehmer',
'LBL_LAST_NAME' => 'Nachname',
'LBL_ASSIGNED_TO_NAME'=>'Zugewiesen an:',
'LBL_LIST_ASSIGNED_TO_NAME' => 'Zugew. Benutzer',
'LBL_LIST_CLOSE' => 'Schließen',
'LBL_LIST_CONTACT' => 'Kontakt',
'LBL_LIST_DATE_MODIFIED'=>'Geändert am',
'LBL_LIST_DATE' => 'Startdatum',
'LBL_LIST_DUE_DATE'=>'Fällig am',
'LBL_LIST_FORM_TITLE' => 'Meetingliste',
'LBL_LIST_MY_MEETINGS' => 'Meine Meetings',
'LBL_LIST_RELATED_TO' => 'Gehört zu',
'LBL_LIST_STATUS'=>'Status',
'LBL_LIST_SUBJECT' => 'Betreff',
'LBL_LIST_TIME' => 'Startzeit',
'LBL_LEADS_SUBPANEL_TITLE' => 'Interessenten',
'LBL_LOCATION' => 'Ort:',
'LBL_MEETING' => 'Meeting:',
'LBL_MINSS_ABBREV' => 'min',
'LBL_MODIFIED_BY'=>'Geändert von',
'LBL_MODULE_NAME' => 'Meetings',
'LBL_MODULE_TITLE' => 'Meetings: Home',
'LBL_NAME' => 'Name',
'LBL_NEW_FORM_TITLE' => 'Neuer Termin',
'LBL_OUTLOOK_ID' => 'Outlook ID',
'LBL_PHONE' => 'Telefon Büro:',
'LBL_REMINDER_TIME'=>'Erinnerungs Zeitpunkt',
'LBL_REMINDER' => 'Erinnerung:',
'LBL_SCHEDULING_FORM_TITLE' => 'Planung',
'LBL_SEARCH_BUTTON'=> 'Suchen',
'LBL_SEARCH_FORM_TITLE' => 'Meetings Suche',
'LBL_SEND_BUTTON_KEY'=>'I',
'LBL_SEND_BUTTON_LABEL'=>'Einladungen senden',
'LBL_SEND_BUTTON_TITLE'=>'Einladungen senden [Alt-I]',
'LBL_STATUS' => 'Status:',
'LBL_SUBJECT' => 'Betreff:',
'LBL_TIME' => 'Beginn:',
'LBL_USERS_SUBPANEL_TITLE' => 'Benutzer',
'LNK_CALL_LIST'=>'Anrufe',
'LNK_EMAIL_LIST'=>'E-Mails',
'LNK_MEETING_LIST'=>'Meetings',
'LNK_NEW_APPOINTMENT' => 'Neuer Termin',
'LNK_NEW_CALL'=>'Neuer Anruf',
'LNK_NEW_EMAIL'=>'E-Mail archivieren',
'LNK_NEW_MEETING'=>'Neues Meeting',
'LNK_NEW_NOTE'=>'Neue Notiz oder Anlage',
'LNK_NEW_TASK'=>'Neue Aufgabe',
'LNK_NOTE_LIST'=>'Notizen',
'LNK_TASK_LIST'=>'Aufgaben',
'LNK_VIEW_CALENDAR' => 'Heute',
'NTC_REMOVE_INVITEE' => 'Möchten Sie diesen Teilnehmer wirklich aus diesem Meeting entfernen?',
'LBL_CREATED_USER' => 'Erstellter Benutzer',
'LBL_MODIFIED_USER' => 'Veränderter Benutzer',
'NOTICE_DURATION_TIME' => 'Zeitdauer muss größer als 0 sein',
);
?>

View File

@@ -0,0 +1,117 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* The contents of this file are subject to the SugarCRM Public License Version
* 1.1.3 ("License"); You may not use this file except in compliance with the
* License. You may obtain a copy of the License at http://www.sugarcrm.com/SPL
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* All copies of the Covered Code must include on each user interface screen:
* (i) the "Powered by SugarCRM" logo and
* (ii) the SugarCRM copyright notice
* in the same form as they appear in the distribution. See full license for
* requirements.
*
* The Original Code is: SugarCRM Open Source
* The Initial Developer of the Original Code is SugarCRM, Inc.
* Portions created by SugarCRM are Copyright (C) 2004-2005 SugarCRM, Inc.;
* All Rights Reserved.
* Contributor(s): ______________________________________.
********************************************************************************/
/*********************************************************************************
* pl_pl.lang.php,v for SugarCRM 4.5.1-->>
* Translator: Krzysztof Morawski
* All Rights Reserved.
* Any bugs report welcome: krzysiek<at>kmmgroup<dot>pl
* Contributor(s): ______________________________________..
********************************************************************************/
$mod_strings = array (
'ERR_DELETE_RECORD' => 'A record number must be specified to delete the meeting.',
'LBL_ACCEPT_THIS'=>'Akceptujesz?',
'LBL_ADD_BUTTON'=> 'Dodaj',
'LBL_ADD_INVITEE' => 'Dodaj Zaproszenia',
'LBL_BLANK' => '&nbsp;',
'LBL_COLON' => ':',
'LBL_CONTACT_NAME' => 'Kontakt:',
'LBL_CONTACTS_SUBPANEL_TITLE' => 'Kontakty',
'LBL_CREATED_BY'=>'Utworzone przez',
'LBL_DATE_END'=>'Data Zakończenia',
'LBL_DATE_TIME' => 'Data i Czas Rozpoczęcia:',
'LBL_DATE' => 'Data Rozpoczęcia:',
'LBL_DEFAULT_STATUS' => 'Planowane',
'LBL_DEFAULT_SUBPANEL_TITLE' => 'Spotkania',
'LBL_DEL'=> 'Del',
'LBL_DESCRIPTION_INFORMATION' => 'Informacje Opisowe',
'LBL_DESCRIPTION' => 'Opis:',
'LBL_DURATION_HOURS' => 'Czas trwania w godzinach:',
'LBL_DURATION_MINUTES' => 'Czas trwania w minutach:',
'LBL_DURATION' => 'Czas trwania:',
'LBL_EMAIL' => 'Email',
'LBL_FIRST_NAME' => 'Imię',
'LBL_HISTORY_SUBPANEL_TITLE' => 'Notatki',
'LBL_HOURS_ABBREV' => 'h',
'LBL_HOURS_MINS' => '(godziny/minuty)',
'LBL_INVITEE' => 'Zaproszeni',
'LBL_LAST_NAME' => 'Nazwisko',
'LBL_ASSIGNED_TO_NAME'=>'Przydzielone do:',
'LBL_LIST_ASSIGNED_TO_NAME' => 'Przydzielony Użytkownik',
'LBL_LIST_CLOSE' => 'Zamknij',
'LBL_LIST_CONTACT' => 'Kontakt',
'LBL_LIST_DATE_MODIFIED'=>'Data Modyfikacji',
'LBL_LIST_DATE' => 'Data Rozpoczęcia',
'LBL_LIST_DUE_DATE'=>'Termin',
'LBL_LIST_FORM_TITLE' => 'Lista spotkań',
'LBL_LIST_MY_MEETINGS' => 'Moje Spotkania',
'LBL_LIST_RELATED_TO' => 'Podlega',
'LBL_LIST_STATUS'=>'Status',
'LBL_LIST_SUBJECT' => 'Temat',
'LBL_LIST_TIME' => 'Czas rozpoczęcia',
'LBL_LOCATION' => 'Miejsce Spotkania:',
'LBL_MEETING' => 'Spotkanie:',
'LBL_MINSS_ABBREV' => 'm',
'LBL_MODIFIED_BY'=>'Zmodyfikowane przez',
'LBL_MODULE_NAME' => 'Spotkania',
'LBL_MODULE_TITLE' => 'Spotkania: Strona Główna',
'LBL_NAME' => 'Nazwa',
'LBL_NEW_FORM_TITLE' => 'Haromonogram Spotkań',
'LBL_OUTLOOK_ID' => 'Outlook ID',
'LBL_PHONE' => 'Telefon Do Biura:',
'LBL_REMINDER_TIME'=>'Czas Przypominacza',
'LBL_REMINDER' => 'Przypominacz:',
'LBL_SCHEDULING_FORM_TITLE' => 'Harmonogram',
'LBL_SEARCH_BUTTON'=> 'Szukaj',
'LBL_SEARCH_FORM_TITLE' => 'Szukanie Spotkań',
'LBL_SEND_BUTTON_KEY'=>'I',
'LBL_SEND_BUTTON_LABEL'=>'Wyślij Zaproszenia',
'LBL_SEND_BUTTON_TITLE'=>'Wyślij Zaproszenia [Alt+I]',
'LBL_STATUS' => 'Status:',
'LBL_SUBJECT' => 'Temat:',
'LBL_TIME' => 'Czas Rozpoczęcia:',
'LBL_USERS_SUBPANEL_TITLE' => 'Użytkownicy',
'LBL_LEADS_SUBPANEL_TITLE'=> 'Potencjalni Kontrahenci',
'LNK_CALL_LIST'=>'Lista Rozmów',
'LNK_EMAIL_LIST'=>'Lista e-maili',
'LNK_MEETING_LIST'=>'Spotkania',
'LNK_NEW_APPOINTMENT' => 'Zaplanuj Spotkanie',
'LNK_NEW_CALL'=>'Zaplanuj Rozmowę tel.',
'LNK_NEW_EMAIL'=>'Zarchiwizuj Wiadomość Pocztową',
'LNK_NEW_MEETING'=>'Zaplanuj Spotkanie',
'LNK_NEW_NOTE'=>'Utwórz Notatkę lub Załącznik',
'LNK_NEW_TASK'=>'Lista Zadań',
'LNK_NOTE_LIST'=>'Lista Notatek',
'LNK_TASK_LIST'=>'Lista Zadań',
'LNK_VIEW_CALENDAR' => 'Dzisiaj',
'NTC_REMOVE_INVITEE' => 'Czy na pewno chcesz usunąć te zaproszenia ze Spotkania?',
);
?>

View File

@@ -0,0 +1,46 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2009 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
$searchFields['Meetings'] =
array (
'name' => array( 'query_type'=>'default'),
'contact_name' => array( 'query_type'=>'default','db_field'=>array('contacts.first_name','contacts.last_name')),
'date_start' => array( 'query_type'=>'default'),
'current_user_only'=> array('query_type'=>'default','db_field'=>array('assigned_user_id'),'my_items'=>true),
'assigned_user_id'=> array('query_type'=>'default'),
'status'=> array('query_type'=>'default', 'options' => 'meeting_status_dom', 'template_var' => 'STATUS_FILTER')
);
?>

View File

@@ -0,0 +1,86 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2009 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
*********************************************************************************/
function additionalDetailsMeeting($fields) {
static $mod_strings;
if(empty($mod_strings)) {
global $current_language;
$mod_strings = return_module_language($current_language, 'Meetings');
}
$overlib_string = '<div style="overflow:auto; height:100px; max-height:100px;">';
//Modify by jchi 6/27/2008 1515pm china time , bug 20626.
if(!empty($fields['DATE_START']))
$overlib_string .= '<b>'. $mod_strings['LBL_DATE_TIME'] . '</b> ' . $fields['DATE_START'] . ' <br>';
if(isset($fields['DURATION_HOURS']) || isset($fields['DURATION_MINUTES'])) {
$overlib_string .= '<b>'. $mod_strings['LBL_DURATION'] . '</b> ';
if(isset($fields['DURATION_HOURS'])) {
$overlib_string .= $fields['DURATION_HOURS'] . $mod_strings['LBL_HOURS_ABBREV'] . ' ';
}
if(isset($fields['DURATION_MINUTES'])) {
$overlib_string .= $fields['DURATION_MINUTES'] . $mod_strings['LBL_MINSS_ABBREV'];
}
$overlib_string .= '<br>';
}
if(!empty($fields['DESCRIPTION'])) {
$overlib_string .= '<b>'. $mod_strings['LBL_DESCRIPTION'] . '</b> ' . substr($fields['DESCRIPTION'], 0, 300);
if(strlen($fields['DESCRIPTION']) > 300) $overlib_string .= '...';
}
$editLink = "index.php?action=EditView&module=Meetings&record={$fields['ID']}";
$viewLink = "index.php?action=DetailView&module=Meetings&record={$fields['ID']}";
$return_module = empty($_REQUEST['module']) ? 'Meetings' : $_REQUEST['module'];
$return_action = empty($_REQUEST['action']) ? 'ListView' : $_REQUEST['action'];
$editLink .= "&return_module=$return_module&return_action=$return_action";
$viewLink .= "&return_module=$return_module&return_action=$return_action";
$overlib_string .= "</div>";
return array('fieldToAddTo' => 'NAME',
'string' => $overlib_string,
'editLink' => $editLink,
'viewLink' => $viewLink);
}
?>

View File

@@ -0,0 +1,109 @@
<?php
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2009 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
$viewdefs['Meetings']['DetailView'] = array(
'templateMeta' => array('form'=>array('buttons'=>array('EDIT', 'DUPLICATE', 'DELETE',
array('customCode'=>'{if $fields.status.value != "Held"}' .
' <input type="hidden" name="isSaveAndNew" value="false"> ' .
' <input type="hidden" name="status" value=""> ' .
' <input type="hidden" name="isSaveFromDetailView" value="true"> ' .
' <input title="{$APP.LBL_CLOSE_AND_CREATE_BUTTON_TITLE}" ' .
' accesskey="{$APP.LBL_CLOSE_AND_CREATE_BUTTON_KEY}" ' .
' class="button" ' .
' onclick="this.form.status.value=\'Held\'; this.form.action.value=\'Save\';this.form.return_module.value=\'Meetings\';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}'),
array('customCode'=>'{if $fields.status.value != "Held"}' .
' <input type="hidden" name="isSave" value="false"> ' .
' <input title="{$APP.LBL_CLOSE_BUTTON_TITLE}" ' .
' accesskey="{$APP.LBL_CLOSE_BUTTON_KEY}" ' .
' class="button" ' .
' onclick="this.form.status.value=\'Held\'; this.form.action.value=\'Save\';this.form.return_module.value=\'Meetings\';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}'),)),
'maxColumns' => '2',
'widths' => array(
array('label' => '10', 'field' => '30'),
array('label' => '10', 'field' => '30')
),
),
'panels' =>array (
array (
array ( 'name' => 'name','label' => 'LBL_SUBJECT',),
'status',
),
array (
'location',
array ('name' => 'parent_name',
'customLabel' => '{sugar_translate label=\'LBL_MODULE_NAME\' module=$fields.parent_type.value}',),
),
array (
array ('name' =>'date_start', 'label' => 'LBL_DATE_TIME'),
array (
'name' => 'duration_hours',
'customCode' => '{$fields.duration_hours.value}{$MOD.LBL_HOURS_ABBREV} {$fields.duration_minutes.value}{$MOD.LBL_MINSS_ABBREV}&nbsp;',
'label' => 'LBL_DURATION',
),
),
array (
array (
'name' => 'modified_by_name',
'customCode' => '{$fields.date_modified.value} {$APP.LBL_BY} {$fields.modified_by_name.value}&nbsp;',
'label' => 'LBL_DATE_MODIFIED',
),
),
array (
array ('name' => 'assigned_user_name','label' => 'LBL_ASSIGNED_TO',),
array (
'name' => 'created_by_name',
'customCode' => '{$fields.date_entered.value} {$APP.LBL_BY} {$fields.created_by_name.value}&nbsp;',
'label' => 'LBL_DATE_ENTERED',
),
),
array (
array(
'name'=>'reminder_checked',
'fields'=>array('reminder_checked', 'reminder_time')
),
'description',
),
)
);
?>

View File

@@ -0,0 +1,118 @@
<?php
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2009 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
$viewdefs['Meetings']['EditView'] = array(
'templateMeta' => array('maxColumns' => '2',
'form' => array('hidden'=>array('<input type="hidden" name="isSaveAndNew" value="false">'),
'buttons' => array(
array('customCode'=>'<input title="{$APP.LBL_SAVE_BUTTON_TITLE}" accessKey="{$APP.LBL_SAVE_BUTTON_KEY}" class="button" onclick="fill_invitees();this.form.action.value=\'Save\'; this.form.return_action.value=\'DetailView\'; {if isset($smarty.request.isDuplicate) && $smarty.request.isDuplicate eq "true"}this.form.return_id.value=\'\'; {/if}return check_form(\'EditView\') && isValidDuration();" type="submit" name="button" value="{$APP.LBL_SAVE_BUTTON_LABEL}">'),
'CANCEL',
array('customCode'=>'<input title="{$MOD.LBL_SEND_BUTTON_TITLE}" class="button" onclick="this.form.send_invites.value=\'1\';fill_invitees();this.form.action.value=\'Save\';this.form.return_action.value=\'EditView\';this.form.return_module.value=\'{$smarty.request.return_module}\';return check_form(\'EditView\') && isValidDuration();" type="submit" name="button" value="{$MOD.LBL_SEND_BUTTON_LABEL}">'),
array('customCode'=>'{if $fields.status.value != "Held"}' .
'<input title="{$APP.LBL_CLOSE_AND_CREATE_BUTTON_TITLE}" ' .
'accessKey="{$APP.LBL_CLOSE_AND_CREATE_BUTTON_KEY}" ' .
'class="button" ' .
'onclick="fill_invitees(); this.form.status.value=\'Held\'; this.form.action.value=\'Save\'; this.form.return_module.value=\'Meetings\'; 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\') && isValidDuration();" ' .
'type="submit" name="button" ' .
'value="{$APP.LBL_CLOSE_AND_CREATE_BUTTON_LABEL}">{/if}'),
),
'headerTpl'=>'modules/Meetings/tpls/header.tpl',
'footerTpl'=>'modules/Meetings/tpls/footer.tpl'),
'widths' => array(
array('label' => '10', 'field' => '30'),
array('label' => '10', 'field' => '30')
),
'javascript' => '<script type="text/javascript" src="include/JSON.js?s={$SUGAR_VERSION}&c={$JS_CUSTOM_VERSION}"></script>
<script type="text/javascript" src="include/jsolait/init.js?s={$SUGAR_VERSION}&c={$JS_CUSTOM_VERSION}"></script>
<script type="text/javascript" src="include/jsolait/lib/urllib.js?s={$SUGAR_VERSION}&c={$JS_CUSTOM_VERSION}"></script>
<script type="text/javascript">{$JSON_CONFIG_JAVASCRIPT}</script>
<script type="text/javascript" src="include/javascript/jsclass_base.js?s={$SUGAR_VERSION}&c={$JS_CUSTOM_VERSION}"></script>
<script type="text/javascript" src="include/javascript/jsclass_async.js?s={$SUGAR_VERSION}&c={$JS_CUSTOM_VERSION}"></script>
<script type="text/javascript" src="modules/Meetings/jsclass_scheduler.js?s={$SUGAR_VERSION}&c={$JS_CUSTOM_VERSION}"></script>
<script>toggle_portal_flag();function toggle_portal_flag() {literal} { {/literal} {$TOGGLE_JS} {literal} } {/literal} </script>',
),
'panels' =>array (
'default' => array (
array (
array('name'=>'name', 'displayParams'=>array('required'=>true)),
array (
'name' => 'status',
'fields' =>
array (
//array('name'=>'direction'), //bug 25328 fixed
array('name'=>'status'),
),
),
),
array(
'location',
),
array (
array('name'=>'date_start',
'type'=>'datetimecombo',
'displayParams'=>array('required' => true, 'updateCallback'=>'SugarWidgetScheduler.update_time();'),
),
'assigned_user_name',
),
array (
array (
'name' => 'duration_hours',
'label' => 'LBL_DURATION',
'customCode' => '{literal}<script type="text/javascript">function isValidDuration() { form = document.getElementById(\'EditView\'); if ( form.duration_hours.value + form.duration_minutes.value <= 0 ) { alert(\'{/literal}{$MOD.NOTICE_DURATION_TIME}{literal}\'); return false; } return true; }</script>{/literal}<input name="duration_hours" size="2" maxlength="2" type="text" value="{$fields.duration_hours.value}" onkeyup="SugarWidgetScheduler.update_time();"/>{$fields.duration_minutes.value} {$MOD.LBL_HOURS_MINS}',
),
'parent_name',
),
array (
array('name' => 'reminder_time',
'customCode' => '{if $fields.reminder_checked.value == "1"}' .
'{assign var="REMINDER_TIME_DISPLAY" value="inline"}' .
'{assign var="REMINDER_CHECKED" value="checked"}' .
'{else}' .
'{assign var="REMINDER_TIME_DISPLAY" value="none"}' .
'{assign var="REMINDER_CHECKED" value=""}' .
'{/if}' .
'<input name="reminder_checked" type="hidden" value="0"><input name="reminder_checked" onclick=\'toggleDisplay("should_remind_list");\' type="checkbox" class="checkbox" value="1" {$REMINDER_CHECKED}><div id="should_remind_list" style="display:{$REMINDER_TIME_DISPLAY}">{$fields.reminder_time.value}</div>',
'label' => 'LBL_REMINDER'),
),
array (
'description',
),
),
)
);
?>

View File

@@ -0,0 +1,97 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/**
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2009 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
*/
$listViewDefs['Meetings'] = 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'),
'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_START' => array(
'width' => '15',
'label' => 'LBL_LIST_DATE',
'link' => false,
'default' => true,
'related_fields' => array('time_start'),
),
'ASSIGNED_USER_NAME' => array(
'width' => '2',
'label' => 'LBL_LIST_ASSIGNED_TO_NAME',
'default' => true),
'STATUS' => array(
'width' => '10',
'label' => 'LBL_LIST_STATUS',
'link' => false,
'default' => false),
);
?>

View File

@@ -0,0 +1,177 @@
<?php
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004-2010 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU Affero General Public License version 3 as published by the
* Free Software Foundation with the addition of the following permission added
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
* details.
*
* You should have received a copy of the GNU Affero General Public License along with
* this program; if not, see http://www.gnu.org/licenses or write to the Free
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301 USA.
*
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
*
* The interactive user interfaces in modified source and object code versions
* of this program must display Appropriate Legal Notices, as required under
* Section 5 of the GNU Affero General Public License version 3.
*
* In accordance with Section 7(b) of the GNU Affero General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
$viewdefs ['Meetings'] =
array (
'QuickCreate' =>
array (
'templateMeta' =>
array (
'maxColumns' => '2',
'form' =>
array (
'hidden' =>
array (
'<input type="hidden" name="isSaveAndNew" value="false">',
),
'buttons' =>
array (
array (
'customCode' => '<input title="{$APP.LBL_SAVE_BUTTON_TITLE}" accessKey="{$APP.LBL_SAVE_BUTTON_KEY}" class="button" onclick="fill_invitees();this.form.action.value=\'Save\'; this.form.return_action.value=\'DetailView\'; {if isset($smarty.request.isDuplicate) && $smarty.request.isDuplicate eq "true"}this.form.return_id.value=\'\'; {/if}return check_form(\'EditView\') && isValidDuration();" type="submit" name="button" value="{$APP.LBL_SAVE_BUTTON_LABEL}">',
),
'CANCEL',
array (
'customCode' => '<input title="{$MOD.LBL_SEND_BUTTON_TITLE}" class="button" onclick="this.form.send_invites.value=\'1\';fill_invitees();this.form.action.value=\'Save\';this.form.return_action.value=\'EditView\';this.form.return_module.value=\'{$smarty.request.return_module}\';return check_form(\'EditView\') && isValidDuration();" type="submit" name="button" value="{$MOD.LBL_SEND_BUTTON_LABEL}">',
),
array (
'customCode' => '{if $fields.status.value != "Held"}<input title="{$APP.LBL_CLOSE_AND_CREATE_BUTTON_TITLE}" accessKey="{$APP.LBL_CLOSE_AND_CREATE_BUTTON_KEY}" class="button" onclick="fill_invitees(); this.form.status.value=\'Held\'; this.form.action.value=\'Save\'; this.form.return_module.value=\'Meetings\'; 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\') && isValidDuration();" type="submit" name="button" value="{$APP.LBL_CLOSE_AND_CREATE_BUTTON_LABEL}">{/if}',
),
),
'headerTpl' => 'modules/Meetings/tpls/header.tpl',
'footerTpl' => 'modules/Meetings/tpls/footer.tpl',
),
'widths' =>
array (
array (
'label' => '10',
'field' => '30',
),
array (
'label' => '10',
'field' => '30',
),
),
'javascript' => '<script type="text/javascript" src="include/JSON.js?s={$SUGAR_VERSION}&c={$JS_CUSTOM_VERSION}"></script>
<script type="text/javascript">{$JSON_CONFIG_JAVASCRIPT}</script>
<script type="text/javascript" src="include/javascript/jsclass_base.js?s={$SUGAR_VERSION}&c={$JS_CUSTOM_VERSION}"></script>
<script type="text/javascript" src="include/javascript/jsclass_async.js?s={$SUGAR_VERSION}&c={$JS_CUSTOM_VERSION}"></script>
<script type="text/javascript" src="modules/Meetings/jsclass_scheduler.js?s={$SUGAR_VERSION}&c={$JS_CUSTOM_VERSION}"></script>
<script>toggle_portal_flag();function toggle_portal_flag() {literal} { {/literal} {$TOGGLE_JS} {literal} } {/literal} </script>',
'useTabs' => false,
),
'panels' =>
array (
'default' =>
array (
array (
array (
'name' => 'name',
'displayParams' =>
array (
'required' => true,
),
),
array (
'name' => 'status',
'fields' =>
array (
array (
'name' => 'status',
),
),
),
),
array (
array (
'name' => 'date_start',
'type' => 'datetimecombo',
'displayParams' =>
array (
'required' => true,
'updateCallback' => 'SugarWidgetScheduler.update_time();',
),
),
array (
'name' => 'parent_name',
'label' => 'LBL_LIST_RELATED_TO',
),
),
array (
array (
'name' => 'duration_hours',
'label' => 'LBL_DURATION',
'customCode' => '{literal}<script type="text/javascript">function isValidDuration() { form = document.getElementById(\'EditView\'); if ( form.duration_hours.value + form.duration_minutes.value <= 0 ) { alert(\'{/literal}{$MOD.NOTICE_DURATION_TIME}{literal}\'); return false; } return true; }</script>{/literal}<input name="duration_hours" size="2" maxlength="2" type="text" value="{$fields.duration_hours.value}" onkeyup="SugarWidgetScheduler.update_time();"/>{$fields.duration_minutes.value} {$MOD.LBL_HOURS_MINS}',
),
),
array (
array (
'name' => 'reminder_time',
'customCode' => '{if $fields.reminder_checked.value == "1"}{assign var="REMINDER_TIME_DISPLAY" value="inline"}{assign var="REMINDER_CHECKED" value="checked"}{else}{assign var="REMINDER_TIME_DISPLAY" value="none"}{assign var="REMINDER_CHECKED" value=""}{/if}<input name="reminder_checked" type="hidden" value="0"><input name="reminder_checked" onclick=\'toggleDisplay("should_remind_list");\' type="checkbox" class="checkbox" value="1" {$REMINDER_CHECKED}><div id="should_remind_list" style="display:{$REMINDER_TIME_DISPLAY}">{$fields.reminder_time.value}</div>',
'label' => 'LBL_REMINDER',
),
array (
'name' => 'location',
'comment' => 'Meeting location',
'label' => 'LBL_LOCATION',
),
),
array (
array (
'name' => 'assigned_user_name',
'label' => 'LBL_ASSIGNED_TO_NAME',
),
),
array (
array (
'name' => 'description',
'comment' => 'Full text of the note',
'label' => 'LBL_DESCRIPTION',
),
),
),
),
),
);
?>

View File

@@ -0,0 +1,56 @@
<?php
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2009 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
$searchdefs['Meetings'] = array(
'templateMeta' => array(
'maxColumns' => '3',
'widths' => array('label' => '10', 'field' => '30'),
),
'layout' => array(
'basic_search' => array(
'name',
array('name' => 'contact_name', 'label' =>'LBL_CONTACT_NAME', 'type' => 'name'),
array('name'=>'current_user_only', 'label'=>'LBL_CURRENT_USER_FILTER', 'type'=>'bool'),
),
'advanced_search' => array(
'name',
array('name' => 'contact_name', 'label' =>'LBL_CONTACT_NAME', 'type' => 'name'),
array('name'=>'current_user_only', 'label'=>'LBL_CURRENT_USER_FILTER', 'type'=>'bool'),
array('name' => 'assigned_user_id', 'type' => 'enum', 'label' => 'LBL_ASSIGNED_TO', 'function' => array('name' => 'get_user_array', 'params' => array(false))),
'status',
),
),
);
?>

View File

@@ -0,0 +1,96 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2009 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
*********************************************************************************/
$viewdefs['Meetings']['SideQuickCreate'] = array(
'templateMeta' => array('form'=>array('hidden'=>array('<input type="hidden" name="isSaveAndNew" value="false">',
'<input type="hidden" name="send_invites">',
'<input type="hidden" name="user_invitees">',
'<input type="hidden" name="contact_invitees">',
'<input type="hidden" name="duration_hours" value="0">',
'<input type="hidden" name="duration_minutes" value="15">',
'<input type="hidden" name="status" id="status" value="Planned">',
),
'headerTpl'=>'include/EditView/header.tpl',
'footerTpl'=>'include/EditView/footer.tpl',
'buttons'=>array('SAVE'),
'button_location'=>'bottom'
),
'maxColumns' => '1',
'panelClass'=>'none',
'labelsOnTop'=>true,
'widths' => array(
array('label' => '10', 'field' => '30'),
),
'javascript' => '<script type="text/javascript">document.getElementById(\'direction\').style.display=\'none\';</script>',
),
'panels' =>array (
'DEFAULT' =>
array (
array(
array('name'=>'name', 'label'=>'', 'customCode'=>'<div valign="top">{literal}<input type="radio" name="appttype" onchange="if(this.checked){this.form.module.value=\'Calls\'; this.form.return_module.value=\'Calls\'; this.form.direction.style.display = \'\';}">{/literal}{sugar_translate label="LBL_CALL"}{literal}<input type="radio" name="appttype" checked=true onchange="if(this.checked){this.form.module.value=\'Meetings\'; this.form.return_module.value=\'Meetings\'; this.form.direction.style.display=\'none\'}">{/literal}{sugar_translate label="LBL_MEETING"}</div>'),
),
array (
array('name'=>'name', 'displayParams'=>array('size'=>20, 'required'=>true)),
),
array (
array('name'=>'date_start',
'type'=>'datetimecombo',
'displayParams'=>array('required' => true, 'splitDateTime'=>true),
'label'=>'LBL_DATE_TIME'),
),
array (
array('name'=>'parent_name', 'displayParams'=>array('size'=>11, 'selectOnly'=>true, 'split'=>true)),
),
array (
array('name'=>'assigned_user_name', 'displayParams'=>array('required'=>true, 'size'=>11, 'selectOnly'=>true)),
),
array (
array (
'name' => 'status',
'displayParams' => array('required'=>true),
'fields' =>
array (
array('name'=>'status'),
array('name'=>'direction'),
),
),
),
),
)
);

View File

@@ -0,0 +1,65 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/**
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2009 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
*/
$GLOBALS['studioDefs']['Meetings'] = array(
'LBL_DETAILVIEW'=>array(
'template'=>'xtpl',
'template_file'=>'modules/Meetings/DetailView.html',
'php_file'=>'modules/Meetings/DetailView.php',
'type'=>'DetailView',
),
'LBL_EDITVIEW'=>array(
'template'=>'xtpl',
'template_file'=>'modules/Meetings/EditView.html',
'php_file'=>'modules/Meetings/EditView.php',
'type'=>'EditView',
),
'LBL_LISTVIEW'=>array(
'template'=>'listview',
'meta_file'=>'modules/Meetings/listviewdefs.php',
'type'=>'ListView',
),
'LBL_SEARCHFORM'=>array(
'template'=>'xtpl',
'template_file'=>'modules/Meetings/SearchForm.html',
'php_file'=>'modules/Meetings/ListView.php',
'type'=>'SearchForm',
),
);

View File

@@ -0,0 +1,101 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/**
* Layout definition for Meetings
*
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2009 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
*/
$layout_defs['Meetings'] = array(
// list of what Subpanels to show in the DetailView
'subpanel_setup' => array(
'contacts' => array(
'top_buttons' => array(),
'order' => 10,
'module' => 'Contacts',
'sort_order' => 'asc',
'sort_by' => 'last_name, first_name',
'subpanel_name' => 'ForMeetings',
'get_subpanel_data'=>'contacts',
'title_key' => 'LBL_CONTACTS_SUBPANEL_TITLE',
),
'users' => array(
'top_buttons' => array(),
'order' => 20,
'module' => 'Users',
'sort_order' => 'asc',
'sort_by' => 'name',
'subpanel_name' => 'ForMeetings',
'get_subpanel_data'=>'users',
'title_key' => 'LBL_USERS_SUBPANEL_TITLE',
),
'leads' => array(
'order' => 30,
'module' => 'Leads',
'sort_order' => 'asc',
'sort_by' => 'last_name, first_name',
'subpanel_name' => 'ForMeetings',
'get_subpanel_data' => 'leads',
'title_key' => 'LBL_LEADS_SUBPANEL_TITLE',
'top_buttons' => array( ),
),
'history' => array(
'order' => 40,
'sort_order' => 'desc',
'sort_by' => 'date_modified',
'title_key' => 'LBL_HISTORY_SUBPANEL_TITLE',
'type' => 'collection',
'subpanel_name' => 'history', //this values is not associated with a physical file.
'header_definition_from_subpanel'=> 'meetings',
'module'=>'History',
'top_buttons' => array(
array('widget_class' => 'SubPanelTopCreateNoteButton'),
),
'collection_list' => array(
'notes' => array(
'module' => 'Notes',
'subpanel_name' => 'ForHistory',
'get_subpanel_data' => 'notes',
),
)
),
),
);
?>

View File

@@ -0,0 +1,121 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/**
* Subpanel Layout definition for Accounts
*
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2009 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
*/
$subpanel_layout = array(
//Removed button because this layout def is a component of
//the activities sub-panel.
'where' => "(meetings.status='planned')",
'list_fields' => array(
'AD' => array (
'widget_class' => 'SubPanelAdditionalDetailsLink',
'vname' => '&nbsp;',
'sortable' => false,
'width' => 0,
),
'object_image'=>array(
'widget_class' => 'SubPanelIcon',
'width' => '2%',
),
'close_button'=>array(
'widget_class' => 'SubPanelCloseButton',
'vname' => 'LBL_LIST_CLOSE',
'sortable'=>false,
'width' => '6%',
),
'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%',
'sortable'=>false,
),
'contact_id'=>array(
'usage'=>'query_only',
),
'contact_name_owner'=>array(
'usage'=>'query_only',
'force_exists'=>true
),
'contact_name_mod'=>array(
'usage'=>'query_only',
'force_exists'=>true
),
'date_start'=>array(
'vname' => 'LBL_LIST_DUE_DATE',
'width' => '10%',
),
'assigned_user_name' => array (
'name' => 'assigned_user_name',
'vname' => 'LBL_LIST_ASSIGNED_TO_NAME',
),
'edit_button'=>array(
'vname' => 'LBL_EDIT_BUTTON',
'widget_class' => 'SubPanelEditButton',
'width' => '2%',
),
'remove_button'=>array(
'vname' => 'LBL_REMOVE',
'widget_class' => 'SubPanelRemoveButton',
'width' => '2%',
),
'time_start'=>array(
'usage'=>'query_only',
),
),
);
?>

View File

@@ -0,0 +1,118 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/**
* Subpanel Layout definition for Accounts
*
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2009 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
*/
$subpanel_layout = array(
//Removed button because this layout def is a component of
//the activities sub-panel.
'where' => "(meetings.status='made' OR meetings.status='canceled')",
'list_fields' => array(
'AD' => array (
'widget_class' => 'SubPanelAdditionalDetailsLink',
'vname' => '&nbsp;',
'sortable' => false,
'width' => 0,
),
'object_image'=>array(
'vname' => 'LBL_OBJECT_IMAGE',
'widget_class' => 'SubPanelIcon',
'width' => '2%',
'image2'=>'attachment',
'image2_url_field'=>'file_url'
),
'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%',
'sortable'=>false,
),
'contact_id'=>array(
'usage'=>'query_only',
),
'contact_name_owner'=>array(
'usage'=>'query_only',
'force_exists'=>true
),
'contact_name_mod'=>array(
'usage'=>'query_only',
'force_exists'=>true
),
'date_modified'=>array(
'vname' => 'LBL_LIST_DATE_MODIFIED',
'width' => '10%',
),
'assigned_user_name' => array (
'name' => 'assigned_user_name',
'vname' => 'LBL_LIST_ASSIGNED_TO_NAME',
),
'edit_button'=>array(
'vname' => 'LBL_EDIT_BUTTON',
'widget_class' => 'SubPanelEditButton',
'width' => '2%',
),
'remove_button'=>array(
'vname' => 'LBL_REMOVE',
'widget_class' => 'SubPanelRemoveButton',
'width' => '2%',
),
'filename'=>array(
'usage'=>'query_only',
'force_exists'=>true
),
),
);
?>

View File

@@ -0,0 +1,79 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/**
* Subpanel Layout definition for Contacts
*
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2009 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
*/
$subpanel_layout = array(
'top_buttons' => array(
array('widget_class'=>'SubPanelTopCreateButton'),
array('widget_class'=>'SubPanelTopSelectButton', 'popup_module' => 'Meetings'),
),
'where' => '',
'list_fields' => array(
'name'=>array(
'name' => 'name',
'vname' => 'LBL_LIST_SUBJECT',
'widget_class' => 'SubPanelDetailViewLink',
'width' => '50%',
),
'date_start'=>array(
'name' => 'date_start',
'vname' => 'LBL_LIST_DATE',
'width' => '25%',
),
'date_end'=>array(
'name' => 'date_end',
'vname' => 'LBL_DATE_END',
'width' => '25%',
),
'edit_button'=>array(
'vname' => 'LBL_EDIT_BUTTON',
'widget_class' => 'SubPanelEditButton',
'width' => '2%',
),
'remove_button'=>array(
'vname' => 'LBL_REMOVE',
'widget_class' => 'SubPanelRemoveButton',
'width' => '2%',
),
),
);
?>

306
modules/Meetings/vardefs.php Executable file
View File

@@ -0,0 +1,306 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2009 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
$dictionary['Meeting'] = array('table' => 'meetings', 'comment' => 'Meeting activities'
,'fields' => array (
'name' =>
array (
'name' => 'name',
'vname' => 'LBL_SUBJECT',
'type' => 'name',
'dbType' => 'varchar',
'len' => '50',
'comment' => 'Meeting name',
'importable' => 'required',
),
'accept_status' => array (
'name' => 'accept_status',
'vname' => 'LBL_SUBJECT',
'type' => 'varchar',
'dbType' => 'varchar',
'len' => '20',
'source'=>'non-db',
),
'location' =>
array (
'name' => 'location',
'vname' => 'LBL_LOCATION',
'type' => 'varchar',
'len' => '50',
'comment' => 'Meeting location'
),
'duration_hours' =>
array (
'name' => 'duration_hours',
'vname' => 'LBL_DURATION_HOURS',
'type' => 'int',
'len' => '2',
'comment' => 'Duration (hours)',
'importable' => 'required',
),
'duration_minutes' =>
array (
'name' => 'duration_minutes',
'vname' => 'LBL_DURATION_MINUTES',
'type' => 'int',
'group'=>'duration_hours',
'function' => array('name'=>'getDurationMinutesOptions', 'returns'=>'html', 'include'=>'modules/Calls/CallHelper.php'),
'len' => '2',
'comment' => 'Duration (minutes)'
),
'date_start' =>
array (
'name' => 'date_start',
'vname' => 'LBL_DATE',
'type' => 'datetime',
'comment' => 'Date of start of meeting',
'importable' => 'required',
),
'date_end' =>
array (
'name' => 'date_end',
'vname' => 'LBL_DATE_END',
'type' => 'date',
'massupdate'=>false,
'comment' => 'Date meeting ends'
),
'parent_type' =>
array (
'name' => 'parent_type',
'vname'=>'LBL_LIST_RELATED_TO',
'type' => 'varchar',
'len' => '25',
'reportable'=>false,
'comment' => 'Module meeting is associated with'
),
'status' =>
array (
'name' => 'status',
'vname' => 'LBL_STATUS',
'type' => 'enum',
'len' => '25',
'options' => 'activity_status_dom',
'comment' => 'Meeting status (ex: Planned, Held, Not held)'
),
// Bug 24170 - Added only to allow the sidequickcreate form to work correctly
'direction' =>
array (
'name' => 'direction',
'vname' => 'LBL_DIRECTION',
'type' => 'enum',
'len' => '25',
'options' => 'call_direction_dom',
'comment' => 'Indicates whether call is inbound or outbound',
'source' => 'non-db',
'importable' => 'false',
'massupdate'=>false,
'reportable'=>false,
),
'parent_id' =>
array (
'name' => 'parent_id',
'vname'=>'LBL_LIST_RELATED_TO',
'type' => 'id',
'group'=>'parent_name',
'reportable'=>false,
'comment' => 'ID of item indicated by parent_type'
),
'reminder_checked'=>array(
'name' => 'reminder_checked',
'vname' => 'LBL_REMINDER',
'type' => 'bool',
'source' => 'non-db',
'comment' => 'checkbox indicating whether or not the reminder value is set (Meta-data only)',
'massupdate'=>false,
),
'reminder_time' =>
array (
'name' => 'reminder_time',
'vname' => 'LBL_REMINDER_TIME',
'type' => 'int',
'function' => array('name'=>'getReminderTime', 'returns'=>'html', 'include'=>'modules/Calls/CallHelper.php'),
'reportable' => false,
'default'=>-1,
'comment' => 'Specifies when a reminder alert should be issued; -1 means no alert; otherwise the number of seconds prior to the start'
),
'outlook_id' =>
array (
'name' => 'outlook_id',
'vname' => 'LBL_OUTLOOK_ID',
'type' => 'varchar',
'len' => '255',
'reportable' => false,
'comment' => 'When the Sugar Plug-in for Microsoft Outlook syncs an Outlook appointment, this is the Outlook appointment item ID'
),
'contact_name' =>
array (
'name' => 'contact_name',
'rname' => 'last_name',
'db_concat_fields'=> array(0=>'first_name', 1=>'last_name'),
'id_name' => 'contact_id',
'massupdate' => false,
'vname' => 'LBL_CONTACT_NAME',
'type' => 'relate',
'link'=>'contacts',
'table' => 'contacts',
'isnull' => 'true',
'module' => 'Contacts',
'join_name' => 'contacts',
'dbType' => 'varchar',
'source'=>'non-db',
'len' => 36,
),
'contacts' =>
array (
'name' => 'contacts',
'type' => 'link',
'relationship' => 'meetings_contacts',
'source'=>'non-db',
'vname'=>'LBL_CONTACTS',
),
'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',
),
'users' =>
array (
'name' => 'users',
'type' => 'link',
'relationship' => 'meetings_users',
'source'=>'non-db',
'vname'=>'LBL_USERS',
),
'accounts' =>
array (
'name' => 'accounts',
'type' => 'link',
'relationship' => 'account_meetings',
'source'=>'non-db',
'vname'=>'LBL_ACCOUNT',
),
'leads' =>
array (
'name' => 'leads',
'type' => 'link',
'relationship' => 'meetings_leads',
'source'=>'non-db',
'vname'=>'LBL_LEADS',
),
'opportunity' =>
array (
'name' => 'opportunity',
'type' => 'link',
'relationship' => 'opportunity_meetings',
'source'=>'non-db',
'vname'=>'LBL_OPPORTUNITY',
),
'case' =>
array (
'name' => 'case',
'type' => 'link',
'relationship' => 'case_meetings',
'source'=>'non-db',
'vname'=>'LBL_CASE',
),
'notes' =>
array (
'name' => 'notes',
'type' => 'link',
'relationship' => 'meetings_notes',
'module'=>'Notes',
'bean_name'=>'Note',
'source'=>'non-db',
'vname'=>'LBL_NOTES',
),
),
'relationships' => array (
'meetings_assigned_user' =>
array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
'rhs_module'=> 'Meetings', 'rhs_table'=> 'meetings', 'rhs_key' => 'assigned_user_id',
'relationship_type'=>'one-to-many')
,'meetings_modified_user' =>
array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
'rhs_module'=> 'Meetings', 'rhs_table'=> 'meetings', 'rhs_key' => 'modified_user_id',
'relationship_type'=>'one-to-many')
,'meetings_created_by' =>
array('lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
'rhs_module'=> 'Meetings', 'rhs_table'=> 'meetings', 'rhs_key' => 'created_by',
'relationship_type'=>'one-to-many')
,'meetings_notes' => array('lhs_module'=> 'Meetings', 'lhs_table'=> 'meetings', 'lhs_key' => 'id',
'rhs_module'=> 'Notes', 'rhs_table'=> 'notes', 'rhs_key' => 'parent_id',
'relationship_type'=>'one-to-many', 'relationship_role_column'=>'parent_type',
'relationship_role_column_value'=>'Meetings')
)
, 'indices' => array (
array('name' =>'idx_mtg_name', 'type'=>'index', 'fields'=>array('name')),
array('name' =>'idx_meet_par_del', 'type'=>'index', 'fields'=>array('parent_id','parent_type','deleted')),
array('name' => 'idx_meet_stat_del', 'type' => 'index', 'fields'=> array('assigned_user_id', 'status', 'deleted')),
)
//This enables optimistic locking for Saves From EditView
,'optimistic_locking'=>true,
);
VardefManager::createVardef('Meetings','Meeting', array('default', 'assignable',
));
?>

View File

@@ -0,0 +1,92 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*********************************************************************************
* SugarCRM is a customer relationship management program developed by
* SugarCRM, Inc. Copyright (C) 2004 - 2009 SugarCRM Inc.
*
* This program is free software; you can redistribute it and/or modify it under
* the terms of the GNU 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 General Public License for more
* details.
*
* You should have received a copy of the GNU 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 General Public License version 3.
*
* In accordance with Section 7(b) of the GNU General Public License version 3,
* these Appropriate Legal Notices must retain the display of the "Powered by
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
* technical reasons, the Appropriate Legal Notices must display the words
* "Powered by SugarCRM".
********************************************************************************/
/*********************************************************************************
* Description: This file is used to override the default Meta-data EditView behavior
* to provide customization specific to the Calls module.
* Portions created by SugarCRM are Copyright (C) SugarCRM, Inc.
* All Rights Reserved.
* Contributor(s): ______________________________________..
********************************************************************************/
require_once('include/json_config.php');
require_once('include/MVC/View/views/view.edit.php');
class MeetingsViewEdit extends ViewEdit {
function MeetingsViewEdit(){
parent::ViewEdit();
}
/**
* preDisplay
* Override preDisplay to check for presence of 'status' in $_REQUEST
* This is to support the "Close And Create New" operation.
*/
function preDisplay() {
if(isset($_REQUEST['status']) && empty($_REQUEST['status'])) {
$this->bean->status = '';
} //if
if(!empty($_REQUEST['status']) && ($_REQUEST['status'] == 'Held')) {
$this->bean->status = 'Held';
}
parent::preDisplay();
}
function display() {
global $json;
$json = getJSONobj();
$json_config = new json_config();
if (isset($this->bean->json_id) && !empty ($this->bean->json_id)) {
$javascript = $json_config->get_static_json_server(false, true, 'Meetings', $this->bean->json_id);
} else {
$this->bean->json_id = $this->bean->id;
$javascript = $json_config->get_static_json_server(false, true, 'Meetings', $this->bean->id);
}
$this->ss->assign('JSON_CONFIG_JAVASCRIPT', $javascript);
if($this->ev->isDuplicate){
$this->bean->status = $GLOBALS['mod_strings']['LBL_DEFAULT_STATUS'];
} //if
parent::display();
}
}
?>