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

925
modules/EcmCalendars/Calendar.php Executable file
View File

@@ -0,0 +1,925 @@
<?php
require_once('include/utils.php');
global $timedate;
global $current_user;
global $mod_strings;
global $current_language;
global $sugar_config;
class Calendar {
var $day_name = array();
var $day_name_short = array();
var $year;
var $month;
var $day;
var $act_status;
var $act_user;
var $act_type;
var $box_width = 150;
var $hour_height = 60;
var $hour_label_height = 20;
function Calendar() {
// require_once("modules/EcmCalendars/language/en_us.lang.php");
$tmp = $GLOBALS['mod_strings'];
$GLOBALS['mod_strings'] = return_module_language($current_language, 'EcmCalendars');
$this->day_name[0] = $GLOBALS['mod_strings']['LBL_MONDAY'];
$this->day_name[1] = $GLOBALS['mod_strings']['LBL_TUESDAY'];
$this->day_name[2] = $GLOBALS['mod_strings']['LBL_WEDNESDAY'];
$this->day_name[3] = $GLOBALS['mod_strings']['LBL_THURSDAY'];
$this->day_name[4] = $GLOBALS['mod_strings']['LBL_FRIDAY'];
$this->day_name[5] = $GLOBALS['mod_strings']['LBL_SATURDAY'];
$this->day_name[6] = $GLOBALS['mod_strings']['LBL_SUNDAY'];
//print_r($this->day_name);
$this->day_name_short[0] = $GLOBALS['mod_strings']['LBL_SHORT_MONDAY'];
$this->day_name_short[1] = $GLOBALS['mod_strings']['LBL_SHORT_TUESDAY'];
$this->day_name_short[2] = $GLOBALS['mod_strings']['LBL_SHORT_WEDNESDAY'];
$this->day_name_short[3] = $GLOBALS['mod_strings']['LBL_SHORT_THURSDAY'];
$this->day_name_short[4] = $GLOBALS['mod_strings']['LBL_SHORT_FRIDAY'];
$this->day_name_short[5] = $GLOBALS['mod_strings']['LBL_SHORT_SATURDAY'];
$this->day_name_short[6] = $GLOBALS['mod_strings']['LBL_SHORT_SUNDAY'];
$GLOBALS['mod_strings'] = $tmp;
}
function navArray() {
if ($this->month == 12) {
$year = $this->year + 1;
$arr['next'] = $year . "-01";
} else {
$month = $this->month + 1;
$arr['next'] = $this->year . "-" . $month;
}
if ($this->month == 1) {
$year = $this->year - 1;
$arr['prev'] = $year . "-12";
} else {
$month = $this->month - 1;
$arr['prev'] = $this->year . "-" . $month;
}
return $arr;
}
function showNav() {
$arr = $this->navArray();
$html = '<table cellspacing="0" cellpadding="0" border="0" width="100%"><tr><td align="left" valign="bottom"><button onClick="mintajaxget(\'index.php?to_pdf=1&module=EcmCalendars&action=ShowCalendar&date=' . $arr['prev'] . '&act_user=' . $this->act_user . '&act_status=' . $this->act_status . '\',\'calendar_dashlet\');" type="button" class="button"><img src="themes/Sugar/images/previous.gif" width="8" height="11" border="0" align="absmiddle"></button></td>';
$html.='<td align="center" class="monthDashlet">';
$html.=$this->monthByNo((int) $this->month) . ' ' . $this->year;
$html.='</td>';
$html.='<td align="right" valign="bottom"><button onClick="mintajaxget(\'index.php?to_pdf=1&module=EcmCalendars&action=ShowCalendar&date=' . $arr['next'] . '&act_user=' . $this->act_user . '&act_status=' . $this->act_status . '\',\'calendar_dashlet\');" type="button" class="button"><img src="themes/Sugar/images/next.gif" width="8" height="11" border="0" align="absmiddle"></button></td></tr></table><br>';
return $html;
}
function showNavDay() {
$tomorrow = date("Y-m-d", @mktime(0, 0, 0, $this->month, $this->day, $this->year) + 24 * 3600);
$yesterday = date("Y-m-d", @mktime(0, 0, 0, $this->month, $this->day, $this->year) - 24 * 3600);
$html = '<table cellspacing="0" cellpadding="0" border="0" width="100%"><tr><td align="left" valign="bottom"><button onClick="document.getElementById(\'calendar\').src=\'index.php?module=EcmCalendars&action=ShowBigCalendar&to_pdf=1&date=' . $yesterday . '\';mintajaxget(\'index.php?module=EcmCalendars&action=ShovNav&date=' . $yesterday . '&to_pdf=1\',\'navDay\');" type="button" class="button" ><img src="themes/Sugar/images/previous.gif" width="8" height="11" border="0" align="absmiddle"></button></td>';
$html.='<td align="center" class="monthDashlet">';
$html.=$this->day . ' ' . $this->monthByNo((int) $this->month) . ' ' . $this->year;
$html.='</td>';
$html.='<td align="right" valign="bottom"><button onClick="document.getElementById(\'calendar\').src=\'index.php?module=EcmCalendars&action=ShowBigCalendar&to_pdf=1&date=' . $tomorrow . '\';mintajaxget(\'index.php?module=EcmCalendars&action=ShovNav&date=' . $tomorrow . '&to_pdf=1\',\'navDay\');" type="button" class="button"><img src="themes/Sugar/images/next.gif" width="8" height="11" border="0" align="absmiddle"></button></td></tr></table><br>';
return $html;
}
function showNavMiniCalendar() {
$arr = $this->navArray();
$html = '<table cellspacing="0" cellpadding="0" border="0" width="100%"><tr><td align="left" valign="bottom"><button onClick="mintajaxget(\'index.php?to_pdf=1&module=EcmCalendars&action=ShowMiniCalendar&date=' . $arr['prev'] . '&act_user=' . $this->act_user . '&act_status=' . $this->act_status . '\',\'mini_calendar\');" type="button" class="button" title="Previous" ><img src="themes/Sugar/images/previous.gif" width="8" height="11" alt="Previous" border="0" align="absmiddle"></button></td>';
$html.='<td align="center" class="monthDashlet">';
$html.=$this->monthByNo((int) $this->month) . ' ' . $this->year;
$html.='</td>';
$html.='<td align="right" valign="bottom"><button onClick="mintajaxget(\'index.php?to_pdf=1&module=EcmCalendars&action=ShowMiniCalendar&date=' . $arr['next'] . '&act_user=' . $this->act_user . '&act_status=' . $this->act_status . '\',\'mini_calendar\');" type="button" class="button" title="Next" ><img src="themes/Sugar/images/next.gif" width="8" height="11" alt="Next" border="0" align="absmiddle"></button></td></tr></table><br>';
return $html;
}
function showFooter() {
$html = '<br><table cellspacing="0" cellpadding="0" border="0" width="100%"><tr>';
$html.='<td align="left">';
$html.=$GLOBALS['mod_strings']['LBL_USER'] . ':&nbsp;<select id="act_user" name="act_user" onchange="mintajaxget(\'index.php?to_pdf=1&module=EcmCalendars&action=ShowCalendar&date=' . $_REQUEST['date'] . '&act_user=\'+this.value+\'&act_status=' . $this->act_status . '&act_type=' . $this->act_type . '\',\'calendar_dashlet\');">';
$html.='<option value="All"';
if ($this->act_user == 'All')
$html.=' selected';
$html.='>' . $GLOBALS['mod_strings']['LBL_ALL'] . '</option>';
$w = $GLOBALS['db']->query("select user_name,id, first_name, last_name from users where deleted='0' order by user_name asc");
while ($r = $GLOBALS['db']->fetchByAssoc($w)) {
$html.='<option value="' . $r['id'] . '"';
if ($this->act_user == $r['id'])
$html.=' selected';
$html.='>' . $r['first_name'] . ' ' . $r['last_name'] . '</option>';
}
$html.='</select></td>';
$html.='<td align="left">' . $GLOBALS['mod_strings']['LBL_ACTIVITIES'] . ':&nbsp;<select id="act_type" name="act_type" onchange="mintajaxget(\'index.php?to_pdf=1&module=EcmCalendars&action=ShowCalendar&date=' . $_REQUEST['date'] . '&act_user=' . $this->act_user . '&act_status=' . $this->act_status . '&act_type=\'+this.value,\'calendar_dashlet\');">';
$html.='<option value="All"';
if ($this->act_type == "All")
$html.=" selected";
$html.='>' . $GLOBALS['mod_strings']['LBL_ALL'] . '</option><option value="Calls"';
if ($this->act_type == "Calls")
$html.=" selected";
$html.='>' . $GLOBALS['mod_strings']['LBL_CALLS'] . '</option><option value="Meetings"';
if ($this->act_type == "Meetings")
$html.=" selected";
$html.='>' . $GLOBALS['mod_strings']['LBL_MEETINGS'] . '</option><option value="Tasks"';
if ($this->act_type == "Tasks")
$html.=" selected";
$html.='>' . $GLOBALS['mod_strings']['LBL_TASKS'] . '</option></select>';
$html.='</td>';
global $app_list_strings;
$html.='<td align="right">' . $GLOBALS['mod_strings']['LBL_STATUS'] . ':&nbsp;<select id="act_status" name="act_status" onchange="mintajaxget(\'index.php?to_pdf=1&module=EcmCalendars&action=ShowCalendar&date=' . $_REQUEST['date'] . '&act_user=' . $this->act_user . '&act_status=\'+this.value+\'&act_type=' . $this->act_type . '\',\'calendar_dashlet\');">';
foreach ($app_list_strings['activity_status_dom'] as $k => $v) {
$html.='<option value="' . $k . '"';
if ($this->act_status == $k)
$html.=" selected";
$html.='>' . $v . '</option>';
}
$html.='</td>';
$html.='</tr></table><br>';
return $html;
}
function showFooterMiniCalendar() {
$html = '<br><table cellspacing="0" cellpadding="0" border="0" width="100%"><tr>';
$html.='<td align="left">';
$html.=$GLOBALS['mod_strings']['LBL_USER'] . ':&nbsp;<select id="act_user" name="act_user" onchange="mintajaxget(\'index.php?to_pdf=1&module=EcmCalendars&action=ShowMiniCalendar&date=' . $_REQUEST['date'] . '&act_user=\'+this.value+\'&act_status=' . $this->act_status . '&act_type=' . $this->act_type . '\',\'mini_calendar\');">';
$html.='<option value="All"';
if ($this->act_user == 'All')
$html.=' selected';
$html.='>' . $GLOBALS['mod_strings']['LBL_ALL'] . '</option>';
$w = $GLOBALS['db']->query("select user_name,id, first_name, last_name from users where deleted='0' and employee_status='Active' order by user_name asc");
while ($r = $GLOBALS['db']->fetchByAssoc($w)) {
$html.='<option value="' . $r['id'] . '"';
if ($this->act_user == $r['id'])
$html.=' selected';
$html.='>' . $r['first_name'] . ' ' . $r['last_name'] . '</option>';
}
$html.='</select></td>';
$html.='<td align="left">' . $GLOBALS['mod_strings']['LBL_ACTIVITIES'] . ':&nbsp;<select id="act_type" name="act_type" onchange="mintajaxget(\'index.php?to_pdf=1&module=EcmCalendars&action=ShowMiniCalendar&date=' . $_REQUEST['date'] . '&act_user=' . $this->act_user . '&act_status=' . $this->act_status . '&act_type=\'+this.value,\'mini_calendar\');">';
$html.='<option value="All"';
if ($this->act_type == "All")
$html.=" selected";
$html.='>' . $GLOBALS['mod_strings']['LBL_ALL'] . '</option><option value="Calls"';
if ($this->act_type == "Calls")
$html.=" selected";
$html.='>' . $GLOBALS['mod_strings']['LBL_CALLS'] . '</option><option value="Meetings"';
if ($this->act_type == "Meetings")
$html.=" selected";
$html.='>' . $GLOBALS['mod_strings']['LBL_MEETINGS'] . '</option><option value="Tasks"';
if ($this->act_type == "Tasks")
$html.=" selected";
$html.='>' . $GLOBALS['mod_strings']['LBL_TASKS'] . '</option></select>';
$html.='</td>';
$html.='<td align="right">' . $GLOBALS['mod_strings']['LBL_STATUS'] . ':&nbsp;<select id="act_status" name="act_status" onchange="mintajaxget(\'index.php?to_pdf=1&module=EcmCalendars&action=ShowMiniCalendar&date=' . $_REQUEST['date'] . '&act_user=' . $this->act_user . '&act_status=\'+this.value+\'&act_type=' . $this->act_type . '\',\'mini_calendar\');">';
$html.='<option value="All"';
if ($this->act_status == "All")
$html.=" selected";
$html.='>' . $GLOBALS['mod_strings']['LBL_ALL'] . '</option>';
global $app_list_strings;
foreach ($app_list_strings['activity_status_dom'] as $k => $v) {
$html.='<option value="' . $k . '"';
if ($this->act_status == $k)
$html.=" selected";
$html.='>' . $v . '</option>';
}
$html.='</td>';
$html.='</tr></table><br>';
return $html;
}
function daysInMonth($month, $year) {
$days = 31;
while (!checkdate($month, $days, $year))
$days--;
return $days;
}
function getNoOfWeek($month, $year, $day) {
$no = strftime("%W", mktime(0, 0, 0, $month, $day, $year)) + 1;
return $no;
}
function noDayInWeek($month, $year, $day = 1) {
$d = date("w", mktime(0, 0, 0, $month, $day, $year));
$nod = array(
0 => 6,
1 => 0,
2 => 1,
3 => 2,
4 => 3,
5 => 4,
6 => 5,
);
$dayd = $nod[$d];
return $dayd;
}
function dayByNo($no) {
$days = $this->day_name;
return $days[$no];
}
function monthByNo($no) {
$months = array(
1 => $GLOBALS['mod_strings']['LBL_JANUARY'],
2 => $GLOBALS['mod_strings']['LBL_FEBRUARY'],
3 => $GLOBALS['mod_strings']['LBL_MARCH'],
4 => $GLOBALS['mod_strings']['LBL_APRIL'],
5 => $GLOBALS['mod_strings']['LBL_MAY'],
6 => $GLOBALS['mod_strings']['LBL_JUNE'],
7 => $GLOBALS['mod_strings']['LBL_JULY'],
8 => $GLOBALS['mod_strings']['LBL_AUGUST'],
9 => $GLOBALS['mod_strings']['LBL_SEPTEMBER'],
10 => $GLOBALS['mod_strings']['LBL_OCTOBER'],
11 => $GLOBALS['mod_strings']['LBL_NOVEMBER'],
12 => $GLOBALS['mod_strings']['LBL_DECEMBER']
);
return $months[$no];
}
function headerTableDashlet($days = "") {
if (!$days)
$days = $this->day_name_short;
$html = $this->showNav();
$html.='<table cellspacing="0" cellpadding="1" border="0" width="100%" align="center"><tr valign="top">';
$html.='<th class="headerDashlet" width="1%">' . $GLOBALS['mod_strings']['LBL_WEEK'] . '</th>';
//
foreach ($days as $dn) {
$html.='<th class="headerDashlet" width="14%">' . $dn . '</th>';
}
$html.='</tr><tr>';
return $html;
}
function headerTableMiniCalendar($days = "") {
if (!$days)
$days = $this->day_name_short;
$html = $this->showNavMiniCalendar();
$html.='<table cellspacing="0" cellpadding="1" border="0" width="100%" align="center"><tr valign="top">';
$html.='<th class="headerDashlet" width="1%">' . $GLOBALS['mod_strings']['LBL_WEEK'] . '</th>';
foreach ($days as $dn) {
$html.='<th class="headerDashlet" width="14%">' . $dn . '</th>';
}
$html.='</tr><tr>';
return $html;
}
function headerTableMonth($days = "") {
if (!$days)
$days = $this->day_name_short;
$html = '<table style="' . $this->table_style . '" cellspacing="0" cellpadding="1" border="0" width="100%" class="monthBox"><tr valign="top">';
$html.='<th width="1%" class="monthCalBodyTHWeek">' . $GLOBALS['mod_strings']['LBL_WEEK'] . '</th>';
foreach ($days as $dn) {
$html.='<th width="14%" class="monthCalBodyTHDay">' . $dn . '</th>';
}
$html.='</tr><tr class="monthViewDayHeight">';
return $html;
}
function headerTableWeek($days = "") {
if (!$days)
$days = $this->day_name;
$html = '<table style="' . $this->table_style . '" cellspacing="3" cellpadding="3" border="0" width="100%"><tr valign="top">';
$html.='<td width="1%">' . $GLOBALS['mod_strings']['LBL_WEEK'] . '</td>';
foreach ($days as $dn) {
$html.='<td class="monthCalBodyTHDay">' . $dn . '</td>';
}
$html.='</tr><tr valign="top">';
return $html;
}
function headerTableDay() {
if (!$days)
$days = $this->day_name;
$html = '<table style="' . $this->table_style . '" cellspacing="3" cellpadding="3" border="0" width="100%"><tr valign="top">';
$html.='<td width="1%">' . $GLOBALS['mod_strings']['LBL_WEEK'] . '</td>';
foreach ($days as $dn) {
$html.='<td class="monthCalBodyTHDay">' . $dn . '</td>';
}
$html.='</tr><tr valign="top">';
return $html;
}
function showTableMiniCalendar($month, $year) {
global $timedate;
$html = $this->headerTableMiniCalendar();
if ($this->noDayInWeek($month, $year) > 0)
$html.='<td class="weekDashlet">' . $this->getNoOfWeek($month, $year, 1) . '</td>';
for ($i = 0; $i < $this->noDayInWeek($month, $year); $i++)
$html.='<td class="dayDashlet">&nbsp;</td>';
for ($i = 1; $i < $this->daysInMonth($month, $year) + 1; $i++) {
if (($this->noDayInWeek($month, $year) + $i - 1) % 7 == 0)
$html.='</tr><tr><td class="weekDashlet">' . $this->getNoOfWeek($month, $year, $i) . '</td>';
if ($i < 10)
$ni = '0' . $i;
else
$ni = $i;
if (($this->noDayInWeek($month, $year) + $i) % 7 == 0)
$class = "sundayDashlet";
elseif (date("d") == $i && date("m") == $month && date("Y") == $year)
$class = "headerDashlet";
else
$class = "dayDashlet";
if ($this->act_type == "All") {
$num_act = count($this->getActivities($month, $year, $ni, "calls", "Calls", "date_start")) + count($this->getActivities($month, $year, $ni, "meetings", "Meetings", "date_start")) + count($this->getActivities($month, $year, $ni, "tasks", "Tasks", "date_start"));
$actt = array();
if ($this->showActivities($month, $year, $ni, "calls", "Calls", "date_start"))
$actt[] = $this->showActivities($month, $year, $ni, "calls", "Calls", "date_start");
if ($this->showActivities($month, $year, $ni, "meetings", "Meetings", "date_start"))
$actt[] = $this->showActivities($month, $year, $ni, "meetings", "Meetings", "date_start");
if ($this->showActivities($month, $year, $ni, "tasks", "Tasks", "date_start"))
$actt[] = $this->showActivities($month, $year, $ni, "tasks", "Tasks", "date_start");
$act = htmlspecialchars('<div class="divDashlet">') . implode("<br>", $actt) . htmlspecialchars('</div>');
}
else {
$num_act = count($this->getActivities($month, $year, $ni, strtolower($this->act_type), $this->act_type, "date_start"));
$actt = array();
if ($this->showActivities($month, $year, $ni, strtolower($this->act_type), $this->act_type, "date_start"))
$ac = $this->showActivities($month, $year, $ni, strtolower($this->act_type), $this->act_type, "date_start");
$act = htmlspecialchars('<div class="divDashlet">') . $ac . htmlspecialchars('</div>');
}
if ($num_act > 0) {
if (date("d") == $i && date("m") == $month && date("Y") == $year)
$class = "headerDashlet";
elseif (($this->noDayInWeek($month, $year) + $i) % 7 == 0)
$class = "actsundayDashlet";
else
$class = "actDashlet";
$mouse = ' onclick="
if(!document.getElementById(\'desc\'))
{
showdescriptionCalendar(\'' . $GLOBALS['mod_strings']['LBL_ACTIVITIES'] . ' ' . $timedate->to_display($year . '-' . $month . '-' . $ni, "Y-m-d", $timedate->get_date_format()) . '\',\'' . $act . '\',this,1);
}
else
{
hidedescriptionCalendar();
};"';
$img = '<br><img' . $mouse . ' style="float:right;margin:3px;" src="modules/EcmSales/images/search.gif" border="0">';
}
else {
$mouse = ' onmouseout="this.style.fontWeight=\'\';" onmouseover="this.style.fontWeight=\'bold\';hidedescriptionCalendar();"';
$img = '';
}
$html.='<td style="position:relative;cursor:pointer;" class="' . $class . '"><span onmouseout="this.style.fontWeight=\'\';" onmouseover="this.style.fontWeight=\'bold\';" onclick="document.getElementById(\'calendar\').src=\'index.php?module=EcmCalendars&action=ShowBigCalendar&to_pdf=1&date=' . $year . '-' . $month . '-' . $ni . '\';mintajaxget(\'index.php?module=EcmCalendars&action=ShovNav&date=' . $year . '-' . $month . '-' . $ni . '&to_pdf=1\',\'navDay\');">' . $ni . '</span>&nbsp;' . $img . '</td>';
}
$html.='</tr></table>';
$html.=$this->showFooterMiniCalendar();
return $html;
}
function showTableDashlet($month, $year) {
global $timedate;
$tmplanguage = $GLOBALS['mod_strings'];
$GLOBALS['mod_strings'] = return_module_language($current_language, 'EcmCalendars');
$html = $this->headerTableDashlet();
if ($this->noDayInWeek($month, $year) > 0) {
$html.='<td class="weekDashlet">' . $this->getNoOfWeek($month, $year, 1) . '</td>';
}
for ($i = 0; $i < $this->noDayInWeek($month, $year); $i++) {
$html.='<td class="dayDashlet">&nbsp;</td>';
}
for ($i = 1; $i < $this->daysInMonth($month, $year) + 1; $i++) {
if (($this->noDayInWeek($month, $year) + $i - 1) % 7 == 0) {
$html.='</tr><tr><td class="weekDashlet">' . $this->getNoOfWeek($month, $year, $i) . '</td>';
}
if ($i < 10) {
$ni = '0' . $i;
} else {
$ni = $i;
}
if (($this->noDayInWeek($month, $year) + $i) % 7 == 0) {
$class = "sundayDashlet";
} elseif (date("d") == $i && date("m") == $month && date("Y") == $year) {
$class = "headerDashlet";
} else {
$class = "dayDashlet";
}
if ($this->act_type == "All") {
$num_act = count($this->getActivities($month, $year, $ni, "calls", "Calls", "date_start")) + count($this->getActivities($month, $year, $ni, "meetings", "Meetings", "date_start")) + count($this->getActivities($month, $year, $ni, "tasks", "Tasks", "date_start"));
$actt = array();
if ($this->showActivities($month, $year, $ni, "calls", "Calls", "date_start")) {
$actt[] = $this->showActivities($month, $year, $ni, "calls", "Calls", "date_start");
}
if ($this->showActivities($month, $year, $ni, "meetings", "Meetings", "date_start")) {
$actt[] = $this->showActivities($month, $year, $ni, "meetings", "Meetings", "date_start");
}
if ($this->showActivities($month, $year, $ni, "tasks", "Tasks", "date_start")) {
$actt[] = $this->showActivities($month, $year, $ni, "tasks", "Tasks", "date_start");
}
$act = htmlspecialchars('<div class="divDashlet"><div class="outTable">') . implode("<br>", $actt) . htmlspecialchars('</div></div>');
} else {
$num_act = count($this->getActivities($month, $year, $ni, strtolower($this->act_type), $this->act_type, "date_start"));
$actt = array();
if ($this->showActivities($month, $year, $ni, strtolower($this->act_type), $this->act_type, "date_start")) {
$ac = $this->showActivities($month, $year, $ni, strtolower($this->act_type), $this->act_type, "date_start");
}
$act = htmlspecialchars('<div class="divDashlet">') . $ac . htmlspecialchars('</div>');
}
if ($num_act > 0) {
if (date("d") == $i && date("m") == $month && date("Y") == $year) {
$class = "headerDashlet";
} elseif (($this->noDayInWeek($month, $year) + $i) % 7 == 0) {
$class = "actsundayDashlet";
} else {
$class = "actDashlet";
}
$mouse = ' onclick="
if(!document.getElementById(\'desc\'))
{
showdescriptionCalendar(\'' . $GLOBALS['mod_strings']['LBL_ACTIVITIES'] . ' ' . $timedate->to_display($year . '-' . $month . '-' . $ni, "Y-m-d", $timedate->get_date_format()) . '\',\'' . $act . '\',this,1);
}
else
{
hidedescriptionCalendar();
};"';
$img = '<br><img' . $mouse . ' style="float:right;margin:3px;" src="modules/EcmSales/images/search.gif" border="0">';
} else {
$mouse = ' onmouseout="this.style.fontWeight=\'\';" onmouseover="this.style.fontWeight=\'bold\';hidedescriptionCalendar();"';
$img = '';
}
$html.='<td style="position:relative;cursor:pointer;" class="' . $class . '"><span onmouseout="this.style.fontWeight=\'\';" onmouseover="this.style.fontWeight=\'bold\';" onclick="location.href=\'index.php?module=EcmCalendars&action=index&date=' . $year . '-' . $month . '-' . $ni . '\';">' . $ni . '</span>&nbsp;' . $img . '</td>';
}
$html.='</tr></table>';
$html.=$this->showFooter();
$GLOBALS['mod_strings'] = $tmplanguage;
return $html;
}
function showTableMonth($month, $year) {
$html = $this->headerTableMonth();
$html.='<td class="monthCalBodyWeek" style="' . $this->cell_style . '">' . $this->getNoOfWeek($month, $year, 1) . '</td>';
for ($i = 0; $i < $this->noDayInWeek($month, $year); $i++)
$html.='<td style="' . $this->cell_style . '">&nbsp;</td>';
for ($i = 1; $i < $this->daysInMonth($month, $year) + 1; $i++) {
if (($this->noDayInWeek($month, $year) + $i - 1) % 7 == 0)
$html.='</tr><tr class="monthViewDayHeight"><td class="monthCalBodyWeek" align="center" valign="top" style="' . $this->cell_style . '">' . $this->getNoOfWeek($month, $year, $i) . '</td>';
if ($i < 10)
$ni = '0' . $i;
else
$ni = $i;
$html.='<td class="monthCalBodyWeekDay" style="' . $this->cell_style . ';height:10px;" align="right" valign="top"><a href="#" class="monthCalBodyWeekDayDateLink">' . $ni . '</a><br>';
$html.=$this->showActivities($month, $year, $ni, "calls", "Calls", "date_start") . '&lt;br&gt;';
$html.=$this->showActivities($month, $year, $ni, "meetings", "Meetings", "date_start");
$html.='</td>';
}
$html.='</tr></table>';
return $html;
}
function showTableWeek($month, $year, $day) {
$html = $this->headerTableWeek($this->day_name);
$days = $this->getDaysWeek($month, $year, $day);
$html.='<td height="40" valign="top">' . $this->getNoOfWeek($month, $year, $day) . '</td>';
foreach ($days as $d) {
$exp = explode("-", $d);
$html.='<td height="40" valign="top">' . $d . '<br>';
$html.=$this->showActivities($month, $year, $exp[2], "calls", "Calls", "date_start") . '<br>';
$html.=$this->showActivities($month, $year, $exp[2], "meetings", "Meetings", "date_start");
$html.="</td>";
}
$html.='</tr></table>';
return $html;
}
function showTableDay($month, $year, $day) {
$html = '<table id="table_day" cellspacing="0" cellpadding="0" border="0" width="100%">';
for ($i = 6; $i <= 24; $i++) {
if ($i < 10)
$h = '0' . $i;
else
$h = $i;
$html.='<tr class="hourDayView"><td class="hourLabelDayView" id="hour' . $i . '">' . $h . ':00</td><td width="100%" class="hourDayView">&nbsp;</td></tr>';
}
$html.='</table>';
$html.=$this->showActivitiesDay($month, $year, $day, array("meetings", "calls", "tasks"), array("Meetings", "Calls", "Tasks"), array("date_start", "date_start", "date_start"));
return $html;
}
function matchTime($time1, $duration1, $time2, $duration2) {
$exp1 = explode(":", $time1);
$date1 = date("H:i:s", @mktime($exp1[0], $exp1[1], $exp1[2], 0, 0, 0) + $duration1);
$exp2 = explode(":", $time2);
$date2 = date("H:i:s", @mktime($exp2[0], $exp2[1], $exp2[2], 0, 0, 0));
if ($date1 > $date2)
return true;
}
function getActivityHours($time, $duration) {
$exp = explode(":", $time);
$hours = ceil($duration / 3600);
for ($i = 0; $i <= $hours; $i++) {
$n = $i * 3600;
$arr[date("H", mktime($exp[0], $exp[1], $exp[2], 0, 0, 0) + $n)] = date("H", mktime($exp[0], $exp[1], $exp[2], 0, 0, 0) + $n);
}
//print_r($arr);
return $arr;
}
function getAllActivityHours($arr) {
foreach ($arr as $r) {
$time = explode(" ", $r['date']);
$exp = explode(":", $time[1]);
for ($i = 0; $i < (int) $r['duration']; $i++) {
$arrr[date("H", @mktime($exp[0], $exp[1], $exp[2], 0, 0, 0) + $i)] = date("H", @mktime($exp[0], $exp[1], $exp[2], 0, 0, 0) + $i);
}
}
return $arrr;
}
function resizeHours($arr) {
$html = '';
foreach ($arr as $a)
$html.='resizeHours("' . (int) $a . '","' . $this->hour_height . '");';
return $html;
}
function getHourPosition($hour, $resized_hours) {
$v = 0;
for ($i = 0; $i <= (int) $hour; $i++)
$arr[$i] = $this->hour_label_height;
foreach ($resized_hours as $a)
$arr[(int) $a] = $this->hour_height;
for ($i = 0; $i <= (int) $hour; $i++)
$v+=$arr[$i];
return $v;
}
function multisort($data, $keys) {
if (count($data) > 0) {
foreach ($data as $key => $row) {
foreach ($keys as $k) {
$cols[$k['key']][$key] = $row[$k['key']];
}
}
$idkeys = @array_keys($data);
$i = 0;
foreach ($keys as $k) {
if ($i > 0)
$sort.=',';
$sort.='$cols[' . $k['key'] . ']';
if ($k['sort'])
$sort.=',SORT_' . strtoupper($k['sort']);
if ($k['type'])
$sort.=',SORT_' . strtoupper($k['type']);
$i++;
}
$sort.=',$idkeys';
$sort = '@array_multisort(' . $sort . ');';
eval($sort);
foreach ($idkeys as $idkey) {
$result[$idkey] = $data[$idkey];
}
return $result;
}
}
function ca($position, $boxes_defs, $time, $duration) {
foreach ($boxes_defs as $bd) {
if ($this->matchTime($bd['box_time'], $bd['box_duration'], $time, $duration) && $position == $bd['box_position'])
return false;
}
return true;
}
function setBoxesPositions($b, $positions) {
$b = $this->multisort($b, array(array('key' => 'box_time', 'sort' => 'asc')));
for ($i = count($b) - 1; $i >= 0; $i--) {
for ($j = 0; $j < count($b); $j++) {
foreach ($positions as $position) {
if ($i != $j && $position == $b[$j]['box_position'] && !$this->matchTime($b[$j]['box_time'], $b[$j]['box_duration'], $b[$i]['box_time'], $b[$i]['box_duration'])) {
if ($this->ca($position, $b, $b[$i]['box_time'], $b[$i]['box_duration']))
$b[$i]['box_position'] = $b[$j]['box_position'];
}
}
}
}
//print_r($b);
return $b;
}
function showActivitiesDay($month, $year, $day, $table, $module, $date_field) {
$calls = $this->getActivities($month, $year, $day, "calls", "Calls", "date_start");
$meetings = $this->getActivities($month, $year, $day, "meetings", "Meetings", "date_start");
$tasks = $this->getActivities($month, $year, $day, "tasks", "Tasks", "date_start");
if (count($calls) > 0)
foreach ($calls as $call)
$arr[] = $call;
if (count($meetings) > 0)
foreach ($meetings as $meeting)
$arr[] = $meeting;
if (count($tasks) > 0)
foreach ($tasks as $task)
$arr[] = $task;
$arr = $this->multisort($arr, array(array('key' => 'date', 'sort' => 'asc')));
//print_r($arr);
if (count($arr) > 0) {
$cc = 0;
$mn = $this->hour_height / 60;
foreach ($arr as $r) {
$o++;
$exp = explode(" ", $r['date']);
$hour = explode(":", $exp[1]);
$y = $hour[1] * $mn; //by id
$height = $this->hour_height;
if ($time_temp && $duration_temp && $this->matchTime($time_temp, $duration_temp, $exp[1], $r['duration']))
$cc+=$this->box_width;
else
$cc = 0;
$maxcc+=$this->box_width;
$boxes_defs[] = array(
'box_position' => $cc,
'box_height' => $height,
'box_time' => $exp[1],
'box_id' => $r['id'],
'box_duration' => $r['duration'],
);
if ($r['status'] == "Held" || $r['status'] == "Not Held")
$activityClass = "activityBoxHeld";
elseif (date("Y-m-d H:i:s") > $r['date'])
$activityClass = "activityBoxExpired";
else
$activityClass = "activityBox";
if ($r['status'] == "Held" || $r['status'] == "Not Held") {
$linkClass = "boxLink";
$linkClassName = "boxLinkNameHeld";
$hourClass = "";
} elseif (date("Y-m-d H:i:s") > $r['date']) {
$linkClass = "boxLink";
$linkClassName = "boxLinkExpired";
$hourClass = "";
} else {
$linkClass = "boxLink";
$linkClassName = "boxLink";
$hourClass = "";
}
$u = new User();
$u->retrieve($r['user_id']);
$user = $u->first_name . PHP_EOL . $u->last_name;
unset($u);
$html.='<div id="activity' . $r['id'] . '" class="' . $activityClass . ' olFgClass" style="height:' . $height . ';width:' . $this->box_width . 'px;overflow:none;">';
$html.='<div class="rowTable">';
$html.='<div class="cellTable' . $hourClass . '" style="width:70px;"><img src="themes/Sugar/images/' . $r['module'] . '.gif" border="0">&nbsp;' . substr($exp[1], 0, 5) . '</div>';
$html.='<div class="cellTable" style="width:80px;text-align:right;"><a target="_top" class="' . $linkClass . '" href="index.php?module=Employees&action=DetailView&record=' . $r['user_id'] . '">' . $user . '</a></div>';
$html.='</div>';
if (strlen($r['name']) > 24)
$name = mb_substr($r['name'], 0, 23, "UTF-8") . "&nbsp;...";
else
$name = $r['name'];
//$html.='<div class="rowTable">';
$html.='<div style="width:150px;"><a target="_top" class="' . $linkClassName . '" href="index.php?module=' . $r['module'] . '&action=DetailView&record=' . $r['id'] . '">' . $r['name'] . '</a></div>';
//$html.='</div>';
if ($r['account_name'] && $r['account_id']) {
if (strlen($r['account_name']) > 24)
$account_name = mb_substr($r['account_name'], 0, 23, "UTF-8") . "&nbsp;...";
else
$account_name = $r['account_name'];
//$html.='<div class="rowTable">';
$html.='<div style="width:150px;"><a target="_top" class="' . $linkClass . '" href="index.php?module=Accounts&action=DetailView&record=' . $r['account_id'] . '">' . $account_name . '</a></div>';
//$html.='</div>';
}
for ($i = 0; $i < count($r['contact_id']); $i++) {
if ($r['contact_id'][$i] && $r['contact_name'][$i]) {
if (strlen($r['contact_name']) > 24)
$contact_name = mb_substr($r['contact_name'][$i], 0, 23, "UTF-8") . "&nbsp;...";
else
$contact_name = $r['contact_name'][$i];
//$html.='<div class="rowTable">';
$html.='<div style="width:150px;"><a target="_top" class="' . $linkClass . '" href="index.php?module=Contacts&action=DetailView&record=' . $r['contact_id'][$i] . '">' . $contact_name . '</a></div><br>';
//$html.='</div>';
}
}
$html.='</div>';
$html.='<script language="javascript">' . $this->resizeHours($this->getActivityHours($exp[1], $r['duration'])) . '</script>';
//$html.='<script language="javascript">setBoxStyle('.$hour[0].','.$y.','.$cc.',"'.$r['id'].'");</script>';
$time_temp = $exp[1];
$duration_temp = $r['duration'];
}
$pos = 0;
$i = 0;
$row = 0;
$maxhour = $this->hour_height;
foreach ($arr as $r) {
$exp = explode(" ", $r['date']);
$hour = explode(":", $exp[1]);
if ($temp_hour == (int) $hour[0] && $i < 3) {
$pos+=$this->box_width;
$i++;
} elseif ($temp_hour == (int) $hour[0] && $i >= 3) {
$pos = 0;
$i = 0;
$row++;
$bd_hours[(int) $hour[0]] = ($row + 1) * $this->hour_height;
} else {
$pos = 0;
$i = 0;
$row = 0;
$maxhour = $this->hour_height;
}
$b[(int) $hour[0]][] = array("id" => $r['id'], "time" => $exp[1], "pos" => $pos, "i" => $i, "row" => $row);
$temp_hour = (int) $hour[0];
$temp_pos = $pos;
$temp_id = $r['id'];
$temp_row = $row;
}
//print_r($b);
if (count($bd_hours) > 0) {
foreach ($bd_hours as $key => $value) {
$html.='<script language="javascript">document.getElementById("hour' . $key . '").style.height="' . $value . 'px";</script>';
}
}
if (count($b) > 0) {
foreach ($b as $bdd) {
foreach ($bdd as $bd) {
$hour = explode(":", $bd['time']);
$y = $this->hour_height * $bd['row'];
$html.='<script language="javascript">setBoxStyle(' . (int) $hour[0] . ',' . $y . ',' . $bd['pos'] . ',"' . $bd['id'] . '");</script>';
}
}
}
}
return $html;
}
function showActivities($month, $year, $day, $table, $module, $date_field) {
$arr = $this->getActivities($month, $year, $day, $table, $module, $date_field);
if (count($arr) > 0) {
$html = '';
foreach ($arr as $r) {
if ($r['status'] == "Held" || $r['status'] == "Not Held") {
$linkClass = "dashletLink";
$linkClassName = "dashletLinkNameHeld";
$hourClass = "";
} elseif (date("Y-m-d H:i:s") > $r['date']) {
$linkClass = "dashletLink";
$linkClassName = "dashletLinkExpired";
$hourClass = "";
} else {
$linkClass = "dashletLink";
$linkClassName = "dashletLink";
$hourClass = "";
}
$exp = explode(" ", $r['date']);
$u = new User();
$u->retrieve($r['user_id']);
$user = $u->first_name . PHP_EOL . $u->last_name;
unset($u);
$html.='<div class="rowTable">';
$html.='<div class="cellTable' . $hourClass . '" style="width:70px;"><img src="themes/Sugar/images/' . $r['module'] . '.gif" border="0">&nbsp;' . substr($exp[1], 0, 5) . '</div>';
$html.='<div class="cellTable" style="width:140px;"><a class="' . $linkClassName . '" href="index.php?module=' . $r['module'] . '&action=DetailView&record=' . $r['id'] . '">' . $r['name'] . '</a></div>';
$html.='<div class="cellTable" style="width:70px;"><a class="' . $linkClass . '" href="index.php?module=Employees&action=DetailView&record=' . $r['user_id'] . '">' . $user . '</a></div>';
$html.='</div>';
if ($r['account_name'] && $r['account_id']) {
$html.='<div class="rowTable">';
$html.='<div class="cellTable" style="width:70px;"></div>';
$html.='<div class="cellTable" style="width:210px;"><a class="' . $linkClass . '" href="index.php?module=Accounts&action=DetailView&record=' . $r['account_id'] . '">' . $r['account_name'] . '</a></div>';
$html.='</div>';
}
for ($i = 0; $i <= 0; $i++) {
if ($r['contact_id'][$i] && $r['contact_name'][$i]) {
$html.='<div class="rowTable">';
$html.='<div class="cellTable" style="width:70px;"></div>';
$html.='<div class="cellTable" style="width:210px;"><a class="' . $linkClass . '" href="index.php?module=Contacts&action=DetailView&record=' . $r['contact_id'][$i] . '">' . $r['contact_name'][$i] . '</a></div><br>';
$html.='</div>';
}
}
}
}
$html = str_replace("<", "&lt;", $html);
$html = str_replace(">", "&gt;", $html);
$html = str_replace("'", "&acute;", $html);
$html = str_replace('"', "&quot;", $html);
$html = str_replace("\n", "", $html);
return $html;
}
function getDaysWeek($month, $year, $day) {
$no = $this->noDayInWeek($month, $year, $day);
for ($i = 0; $i < $no; $i++) {
$days[$i] = date("Y-m-d", mktime(0, 0, 0, $month, $day, $year) - ($no - $i) * 24 * 3600);
}
$days[$no] = $year . "-" . $month . "-" . $day;
for ($i = 0; $i < 7 - $no; $i++) {
$days[$i + $no] = date("Y-m-d", mktime(0, 0, 0, $month, $day, $year) + $i * 24 * 3600);
}
return $days;
}
function getActivities($month, $year, $day, $table, $module, $date_field, $status = "") {
if ($month < 10 && strlen($month) < 2)
$month = "0" . $month;
global $timedate, $current_user;
if ($this->act_status == "All" || !$this->act_status)
$status = "";
else
$status = " and " . $table . ".status='" . $this->act_status . "'";
if ($this->act_user == "All" || !$this->act_user)
$assigned_user = "";
else
$assigned_user = " and " . $table . ".assigned_user_id='" . $this->act_user . "'";
$q = "select " . $table . ".*,users.user_name as user,users.id as user_id from " . $table . " inner join users on users.id=" . $table . ".assigned_user_id where " . $table . ".deleted='0' and " . $table . "." . $date_field . " like '" . $year . "-" . $month . "-" . $day . "%'" . $status . $assigned_user . " order by " . $table . "." . $date_field . " asc";
//print $q;
$query = $GLOBALS['db']->query($q);
while ($row = $GLOBALS['db']->fetchByAssoc($query)) {
$exp = explode(" ", $row[$date_field]);
$expp = explode(":", $exp[1]);
$expd = explode("-", $exp[0]);
if ((int) $expp[0] > 3) {
$r = $GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select name from accounts where id='" . $row['parent_id'] . "'"));
$account_name = $r['name'];
if ($table != "tasks") {
$w = $GLOBALS['db']->query("select contacts.first_name as first_name,contacts.last_name as last_name,contacts.id as id from " . $table . "_contacts inner join contacts on contacts.id=" . $table . "_contacts.contact_id where " . $table . "_contacts.deleted='0' and " . substr($table, 0, strlen($table) - 1) . "_id='" . $row['id'] . "' and contacts.deleted='0'");
$contact_name = array();
$contact_id = array();
while ($r = $GLOBALS['db']->fetchByAssoc($w)) {
$contact_name[] = $r['first_name'] . " " . $r['last_name'];
$contact_id[] = $r['id'];
}
}
$duration = ($row['duration_hours'] * 60 + $row['duration_minutes']) * 60;
$ddate = date("Y-m-d H:i:s", mktime($expp[0], $expp[1], $expp[2], $expd[1], $expd[2], $expd[0]));
$arr[] = array(
"id" => $row['id'],
"name" => $row['name'],
"date" => $timedate->handle_offset($ddate, "Y-m-d H:i:s", true, $current_user),
"module" => $module,
"user" => $row['user'],
"user_id" => $row['user_id'],
"duration" => $duration,
"account_id" => $row['parent_id'],
"account_name" => $account_name,
"contact_id" => $contact_id,
"contact_name" => $contact_name,
"status" => $row['status'],
);
}
}
return $arr;
}
}
?>

67
modules/EcmCalendars/Delete.php Executable file
View File

@@ -0,0 +1,67 @@
<?php
/*****************************************************************************
* The contents of this file are subject to the RECIPROCAL PUBLIC LICENSE
* Version 1.1 ("License"); You may not use this file except in compliance
* with the License. You may obtain a copy of the License at
* http://opensource.org/licenses/rpl.php. Software distributed under the
* License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
* either express or implied.
*
* You may:
* a) Use and distribute this code exactly as you received without payment or
* a royalty or other fee.
* b) Create extensions for this code, provided that you make the extensions
* publicly available and document your modifications clearly.
* c) Charge for a fee for warranty or support or for accepting liability
* obligations for your customers.
*
* You may NOT:
* a) Charge for the use of the original code or extensions, including in
* electronic distribution models, such as ASP (Application Service
* Provider).
* b) Charge for the original source code or your extensions other than a
* nominal fee to cover distribution costs where such distribution
* involves PHYSICAL media.
* c) Modify or delete any pre-existing copyright notices, change notices,
* or License text in the Licensed Software
* d) Assert any patent claims against the Licensor or Contributors, or
* which would in any way restrict the ability of any third party to use the
* Licensed Software.
*
* You must:
* a) Document any modifications you make to this code including the nature of
* the change, the authors of the change, and the date of the change.
* b) Make the source code for any extensions you deploy available via an
* Electronic Distribution Mechanism such as FTP or HTTP download.
* c) Notify the licensor of the availability of source code to your extensions
* and include instructions on how to acquire the source code and updates.
* d) Grant Licensor a world-wide, non-exclusive, royalty-free license to use,
* reproduce, perform, modify, sublicense, and distribute your extensions.
*
* The Original Code is: CommuniCore
* Olavo Farias
* 2006-04-7 olavo.farias@gmail.com
*
* The Initial Developer of the Original Code is CommuniCore.
* Portions created by CommuniCore are Copyright (C) 2005 CommuniCore Ltda
* All Rights Reserved.
********************************************************************************/
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
require_once('modules/EcmCalendars/EcmCalendar.php');
$focus = new EcmCalendar();
// PERFORM THE DELETE IF GIVEN A RECORD TO DELETE
if(!isset($_REQUEST['record']))
sugar_die("A record number must be specified to delete the record.");
$focus->retrieve($_REQUEST['record']);
if(!$focus->ACLAccess('Delete')){
ACLController::displayNoAccess(true);
sugar_cleanup(true);
}
$focus->mark_deleted($_REQUEST['record']);
// NOW THAT THE DELETE HAS BEEN PERFORMED, RETURN TO GIVEN LOCATION
header("Location: index.php?module=".$_REQUEST['return_module']."&action=".$_REQUEST['return_action']."&record=".$_REQUEST['return_id']);
?>

View File

@@ -0,0 +1,142 @@
<?php
/*****************************************************************************
* The contents of this file are subject to the RECIPROCAL PUBLIC LICENSE
* Version 1.1 ("License"); You may not use this file except in compliance
* with the License. You may obtain a copy of the License at
* http://opensource.org/licenses/rpl.php. Software distributed under the
* License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
* either express or implied.
*
* You may:
* a) Use and distribute this code exactly as you received without payment or
* a royalty or other fee.
* b) Create extensions for this code, provided that you make the extensions
* publicly available and document your modifications clearly.
* c) Charge for a fee for warranty or support or for accepting liability
* obligations for your customers.
*
* You may NOT:
* a) Charge for the use of the original code or extensions, including in
* electronic distribution models, such as ASP (Application Service
* Provider).
* b) Charge for the original source code or your extensions other than a
* nominal fee to cover distribution costs where such distribution
* involves PHYSICAL media.
* c) Modify or delete any pre-existing copyright notices, change notices,
* or License text in the Licensed Software
* d) Assert any patent claims against the Licensor or Contributors, or
* which would in any way restrict the ability of any third party to use the
* Licensed Software.
*
* You must:
* a) Document any modifications you make to this code including the nature of
* the change, the authors of the change, and the date of the change.
* b) Make the source code for any extensions you deploy available via an
* Electronic Distribution Mechanism such as FTP or HTTP download.
* c) Notify the licensor of the availability of source code to your extensions
* and include instructions on how to acquire the source code and updates.
* d) Grant Licensor a world-wide, non-exclusive, royalty-free license to use,
* reproduce, perform, modify, sublicense, and distribute your extensions.
*
* The Original Code is: CommuniCore
* Olavo Farias
* 2006-04-7 olavo.farias@gmail.com
*
* The Initial Developer of the Original Code is CommuniCore.
* Portions created by CommuniCore are Copyright (C) 2005 CommuniCore Ltda
* All Rights Reserved.
********************************************************************************/
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
require_once('XTemplate/xtpl.php');
require_once('data/Tracker.php');
require_once('modules/EcmCalendars/EcmCalendar.php');
require_once('modules/EcmCalendars/Forms.php');
require_once('include/DetailView/DetailView.php');
global $mod_strings;
global $app_strings;
$focus = new EcmCalendar();
$detailView = new DetailView();
$offset = 0;
// ONLY LOAD A RECORD IF A RECORD ID IS GIVEN;
// A RECORD ID IS NOT GIVEN WHEN VIEWING IN LAYOUT EDITOR
if (isset($_REQUEST['offset']) or isset($_REQUEST['record'])) {
$result = $detailView->processSugarBean("ECMCALENDARS", $focus, $offset);
if($result == null) {
sugar_die($app_strings['ERROR_NO_RECORD']);
}
$focus = $result;
}else{
header("Location: index.php?module={EcmCalendars}&action=index");
}
if(isset($_REQUEST['isDuplicate']) && $_REQUEST['isDuplicate'] == 'true') {
$focus->id = "";
}
echo "\n<p>\n";
echo get_module_title($mod_strings['LBL_MODULE_ID'], $mod_strings['LBL_MODULE_NAME'].": ".$focus->name, true);
echo "\n</p>\n";
global $theme;
$theme_path = "themes/".$theme."/";
$image_path = $theme_path."images/";
require_once($theme_path.'layout_utils.php');
$GLOBALS['log']->info("EcmCalendars detail view");
$focus->format_all_fields();
$xtpl=new XTemplate ('modules/EcmCalendars/DetailView.html');
$xtpl->assign("MOD", $mod_strings);
$xtpl->assign("APP", $app_strings);
$xtpl->assign("THEME", $theme);
$xtpl->assign("GRIDLINE", $gridline);
$xtpl->assign("IMAGE_PATH", $image_path);
$xtpl->assign("PRINT_URL", "index.php?".$GLOBALS['request_string']);
$xtpl->assign("ID", $focus->id);
$xtpl->assign("ASSIGNED_TO", $focus->assigned_user_name);
$xtpl->assign("NAME", $focus->name);
$xtpl->assign("DATE_ENTERED", $focus->date_entered);
$xtpl->assign("DATE_MODIFIED", $focus->date_modified);
$xtpl->assign("DESCRIPTION", nl2br(url2html($focus->description)));
global $current_user;
if(is_admin($current_user) && $_REQUEST['module'] != 'DynamicLayout' && !empty($_SESSION['editinplace'])){
$xtpl->assign("ADMIN_EDIT","<a href='index.php?action=index&module=DynamicLayout&from_action=".$_REQUEST['action'] ."&from_module=".$_REQUEST['module'] ."&record=".$_REQUEST['record']. "'>".get_image($image_path."EditLayout","border='0' alt='Edit Layout' align='bottom'")."</a>");
}
$xtpl->assign("CREATED_BY", $focus->created_by_name);
$xtpl->assign("MODIFIED_BY", $focus->modified_by_name);
$detailView->processListNavigation($xtpl, "ECMCALENDARS", $offset, $focus->is_AuditEnabled());
// ADDING CUSTOM FIELDS:
require_once('modules/DynamicFields/templates/Files/DetailView.php');
if(!empty($focus->id)) {
$merge_button = <<<EOQ
<input title="{$app_strings['LBL_DUP_MERGE']}" accessKey="M" class="button" onclick="this.form.return_module.value='EcmCalendars'; this.form.return_action.value='DetailView';this.form.return_id.value='{$focus->id}'; this.form.action.value='Step1'; this.form.module.value='MergeRecords';" type="submit" name="Merge" value=" {$app_strings['LBL_DUP_MERGE']} "/>
EOQ;
$xtpl->assign("FIND_DUPES_MERGE_BUTTON", $merge_button);
}
$xtpl->parse("main");
$xtpl->out("main");
$sub_xtpl = $xtpl;
$old_contents = ob_get_contents();
ob_end_clean();
ob_start();
echo $old_contents;
require_once('modules/SavedSearch/SavedSearch.php');
$savedSearch = new SavedSearch();
$json = getJSONobj();
$savedSearchSelects = $json->encode(array($GLOBALS['app_strings']['LBL_SAVED_SEARCH_SHORTCUT'] . '<br>' . $savedSearch->getSelect('EcmCalendars')));
$str = "<script>
YAHOO.util.Event.addListener(window, 'load', SUGAR.util.fillShortcuts, $savedSearchSelects);
</script>";
echo $str;
?>

View File

@@ -0,0 +1,241 @@
<?php
if (!defined('sugarEntry') || !sugarEntry)
die('Not A Valid Entry Point');
/* * ***************************************************************************
* The contents of this file are subject to the RECIPROCAL PUBLIC LICENSE
* Version 1.1 ("License"); You may not use this file except in compliance
* with the License. You may obtain a copy of the License at
* http://opensource.org/licenses/rpl.php. Software distributed under the
* License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
* either express or implied.
*
* You may:
* a) Use and distribute this code exactly as you received without payment or
* a royalty or other fee.
* b) Create extensions for this code, provided that you make the extensions
* publicly available and document your modifications clearly.
* c) Charge for a fee for warranty or support or for accepting liability
* obligations for your customers.
*
* You may NOT:
* a) Charge for the use of the original code or extensions, including in
* electronic distribution models, such as ASP (Application Service
* Provider).
* b) Charge for the original source code or your extensions other than a
* nominal fee to cover distribution costs where such distribution
* involves PHYSICAL media.
* c) Modify or delete any pre-existing copyright notices, change notices,
* or License text in the Licensed Software
* d) Assert any patent claims against the Licensor or Contributors, or
* which would in any way restrict the ability of any third party to use the
* Licensed Software.
*
* You must:
* a) Document any modifications you make to this code including the nature of
* the change, the authors of the change, and the date of the change.
* b) Make the source code for any extensions you deploy available via an
* Electronic Distribution Mechanism such as FTP or HTTP download.
* c) Notify the licensor of the availability of source code to your extensions
* and include instructions on how to acquire the source code and updates.
* d) Grant Licensor a world-wide, non-exclusive, royalty-free license to use,
* reproduce, perform, modify, sublicense, and distribute your extensions.
*
* The Original Code is: CommuniCore
* Olavo Farias
* 2006-04-7 olavo.farias@gmail.com
*
* The Initial Developer of the Original Code is CommuniCore.
* Portions created by CommuniCore are Copyright (C) 2005 CommuniCore Ltda
* All Rights Reserved.
* ****************************************************************************** */
require_once('data/SugarBean.php');
require_once('include/utils.php');
// SHOULD INCLUDE SELECTIVELY
class EcmCalendar extends SugarBean {
var $field_name_map = array();
// STANDARD FIELDS
var $id;
var $date_entered;
var $date_modified;
var $modified_user_id;
var $assigned_user_id;
var $name;
//TABLE COLUMNS
var $description;
// RELATED FIELDS
var $created_by;
var $created_by_name;
var $modified_by_name;
var $assigned_user_name;
// SUBPANELS RELATED
// MODULE OBJECT DETAILS
var $module_dir = 'EcmCalendars';
var $table_name = "ecmcalendars";
var $object_name = "EcmCalendar";
//RELATED TABLE NAMES
// USED TO RETRIEVE RELATED FIELDS FROM FORM POSTS.
var $additional_column_fields = Array(
'assigned_user_name',
'assigned_user_id',
'modified_user_id',
'created_by',
);
var $relationship_fields = Array(
//RELATIONSHIP FIELDS
);
function EcmCalendar() {
parent::SugarBean();
$this->setupCustomFields('EcmCalendars');
foreach ($this->field_defs as $field) {
$this->field_name_map[$field['name']] = $field;
}
}
var $new_schema = true;
function get_summary_text() {
return "$this->name";
}
function create_list_query($order_by, $where, $show_deleted = 0) {
// Fill in the assigned_user_name
$custom_join = $this->custom_fields->getJOIN();
$query = "SELECT ";
$query .= "
ecmcalendars.*
,users.user_name as assigned_user_name";
if ($custom_join) {
$query .= $custom_join['select'];
}
$query .= " FROM ecmcalendars
LEFT JOIN users
ON ecmcalendars.assigned_user_id=users.id";
$query .= " ";
if ($custom_join) {
$query .= $custom_join['join'];
}
$where_auto = '1=1';
if ($show_deleted == 0) {
$where_auto = " $this->table_name.deleted=0 ";
} else if ($show_deleted == 1) {
$where_auto = " $this->table_name.deleted=1 ";
}
if ($where != "")
$query .= "where $where AND " . $where_auto;
else
$query .= "where " . $where_auto;
if (substr_count($order_by, '.') > 0) {
$query .= " ORDER BY $order_by";
} else if ($order_by != "")
$query .= " ORDER BY $order_by";
else
$query .= " ORDER BY ecmcalendars.name";
return $query;
}
function create_export_query($order_by, $where) {
$custom_join = $this->custom_fields->getJOIN();
$query = "SELECT
ecmcalendars.*,
users.user_name assigned_user_name";
if ($custom_join) {
$query .= $custom_join['select'];
}
$query .= " FROM ecmcalendars ";
$query .= " LEFT JOIN users
ON ecmcalendars.assigned_user_id=users.id";
if ($custom_join) {
$query .= $custom_join['join'];
}
$query .= "";
$where_auto = " ecmcalendars.deleted=0
";
if ($where != "")
$query .= " where $where AND " . $where_auto;
else
$query .= " where " . $where_auto;
if ($order_by != "")
$query .= " ORDER BY $order_by";
else
$query .= " ORDER BY ecmcalendars.name";
return $query;
}
function fill_in_additional_list_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);
$this->created_by_name = get_assigned_user_name($this->created_by);
$this->modified_by_name = get_assigned_user_name($this->modified_user_id);
}
function get_list_view_data() {
global $current_language;
$the_array = parent::get_list_view_data();
$app_list_strings = return_app_list_strings_language($current_language);
$mod_strings = return_module_language($current_language, 'EcmCalendars');
// THE NEW LISTVIEW CODE ONLY FETCHES COLUMNS THAT WE'RE DISPLAYING AND NOT ALL
// THE COLUMNS SO WE NEED THESE CHECKS.
$the_array['NAME'] = (($this->name == "") ? "<em>blank</em>" : $this->name);
$the_array['ENCODED_NAME'] = $this->name;
return $the_array;
}
/**
BUILDS A GENERIC SEARCH BASED ON THE QUERY STRING USING OR.
DO NOT INCLUDE ANY $THIS-> BECAUSE THIS IS CALLED ON WITHOUT HAVING THE CLASS INSTANTIATED.
*/
function build_generic_where_clause($the_query_string) {
$where_clauses = Array();
$the_query_string = PearDatabase::quote(from_html($the_query_string));
array_push($where_clauses, "ecmcalendars.name like '$the_query_string%'");
$the_where = "";
foreach ($where_clauses as $clause) {
if ($the_where != "")
$the_where .= " or ";
$the_where .= $clause;
}
return $the_where;
}
function set_notification_body($xtpl, $simplemodule) {
global $mod_strings, $app_list_strings;
$xtpl->assign("NAME", $simplemodule->name);
$xtpl->assign("ECMCALENDARS_DESCRIPTION", $ecmcalendars->description);
return $xtpl;
}
function bean_implements($interface) {
switch ($interface) {
case 'ACL':return true;
}
return false;
}
function save($check_notify = FALSE) {
return parent::save($check_notify);
}
}
?>

View File

@@ -0,0 +1,99 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*****************************************************************************
* The contents of this file are subject to the RECIPROCAL PUBLIC LICENSE
* Version 1.1 ("License"); You may not use this file except in compliance
* with the License. You may obtain a copy of the License at
* http://opensource.org/licenses/rpl.php. Software distributed under the
* License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
* either express or implied.
*
* You may:
* a) Use and distribute this code exactly as you received without payment or
* a royalty or other fee.
* b) Create extensions for this code, provided that you make the extensions
* publicly available and document your modifications clearly.
* c) Charge for a fee for warranty or support or for accepting liability
* obligations for your customers.
*
* You may NOT:
* a) Charge for the use of the original code or extensions, including in
* electronic distribution models, such as ASP (Application Service
* Provider).
* b) Charge for the original source code or your extensions other than a
* nominal fee to cover distribution costs where such distribution
* involves PHYSICAL media.
* c) Modify or delete any pre-existing copyright notices, change notices,
* or License text in the Licensed Software
* d) Assert any patent claims against the Licensor or Contributors, or
* which would in any way restrict the ability of any third party to use the
* Licensed Software.
*
* You must:
* a) Document any modifications you make to this code including the nature of
* the change, the authors of the change, and the date of the change.
* b) Make the source code for any extensions you deploy available via an
* Electronic Distribution Mechanism such as FTP or HTTP download.
* c) Notify the licensor of the availability of source code to your extensions
* and include instructions on how to acquire the source code and updates.
* d) Grant Licensor a world-wide, non-exclusive, royalty-free license to use,
* reproduce, perform, modify, sublicense, and distribute your extensions.
*
* The Original Code is: CommuniCore
* Olavo Farias
* 2006-04-7 olavo.farias@gmail.com
*
* The Initial Developer of the Original Code is CommuniCore.
* Portions created by CommuniCore are Copyright (C) 2005 CommuniCore Ltda
* All Rights Reserved.
********************************************************************************/
require_once('include/EditView/QuickCreate.php');
require_once('modules/EcmCalendars/EcmCalendar.php');
require_once('include/javascript/javascript.php');
class EcmCalendarsQuickCreate extends QuickCreate {
var $javascript;
function process() {
global $current_user, $timedate, $app_list_strings, $current_language, $mod_strings;
$mod_strings = return_module_language($current_language, 'EcmCalendars');
parent::process();
//BUILDER:START dropdowns setup
//BUILDER:END dropdowns setup
if($this->viaAJAX) { // OVERRIDE FOR AJAX CALL
$this->ss->assign('saveOnclick', "onclick='if(check_form(\"ecmcalendarsQuickCreate\")) return SUGAR.subpanelUtils.inlineSave(this.form.id, \"ecmcalendars\"); else return false;'");
$this->ss->assign('cancelOnclick', "onclick='return SUGAR.subpanelUtils.cancelCreate(\"subpanel_ecmcalendars\")';");
}
$this->ss->assign('viaAJAX', $this->viaAJAX);
$this->javascript = new javascript();
$this->javascript->setFormName('ecmcalendarsQuickCreate');
$focus = new EcmCalendar();
$this->javascript->setSugarBean($focus);
$this->javascript->addAllFields('');
$this->ss->assign('additionalScripts', $this->javascript->getScript(false));
$json = getJSONobj();
$popup_request_data = array(
'call_back_function' => 'set_return',
'form_name' => 'ecmcalendarsQuickCreate',
'field_to_name_array' => array(
'id' => 'account_id',
'name' => 'account_name',
),
);
$encoded_popup_request_data = $json->encode($popup_request_data);
$this->ss->assign('encoded_popup_request_data', $encoded_popup_request_data);
}
}
?>

276
modules/EcmCalendars/EditView.php Executable file
View File

@@ -0,0 +1,276 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*****************************************************************************
* The contents of this file are subject to the RECIPROCAL PUBLIC LICENSE
* Version 1.1 ("License"); You may not use this file except in compliance
* with the License. You may obtain a copy of the License at
* http://opensource.org/licenses/rpl.php. Software distributed under the
* License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
* either express or implied.
*
* You may:
* a) Use and distribute this code exactly as you received without payment or
* a royalty or other fee.
* b) Create extensions for this code, provided that you make the extensions
* publicly available and document your modifications clearly.
* c) Charge for a fee for warranty or support or for accepting liability
* obligations for your customers.
*
* You may NOT:
* a) Charge for the use of the original code or extensions, including in
* electronic distribution models, such as ASP (Application Service
* Provider).
* b) Charge for the original source code or your extensions other than a
* nominal fee to cover distribution costs where such distribution
* involves PHYSICAL media.
* c) Modify or delete any pre-existing copyright notices, change notices,
* or License text in the Licensed Software
* d) Assert any patent claims against the Licensor or Contributors, or
* which would in any way restrict the ability of any third party to use the
* Licensed Software.
*
* You must:
* a) Document any modifications you make to this code including the nature of
* the change, the authors of the change, and the date of the change.
* b) Make the source code for any extensions you deploy available via an
* Electronic Distribution Mechanism such as FTP or HTTP download.
* c) Notify the licensor of the availability of source code to your extensions
* and include instructions on how to acquire the source code and updates.
* d) Grant Licensor a world-wide, non-exclusive, royalty-free license to use,
* reproduce, perform, modify, sublicense, and distribute your extensions.
*
* The Original Code is: CommuniCore
* Olavo Farias
* 2006-04-7 olavo.farias@gmail.com
*
* The Initial Developer of the Original Code is CommuniCore.
* Portions created by CommuniCore are Copyright (C) 2005 CommuniCore Ltda
* All Rights Reserved.
********************************************************************************/
// INCLUDE SUPPPORT MODULES
require_once('XTemplate/xtpl.php');
require_once('data/Tracker.php');
// INCLUDE MODULE OBJECT AND FORMS
require_once('modules/EcmCalendars/EcmCalendar.php');
require_once('modules/EcmCalendars/Forms.php');
global $app_strings;
global $mod_strings;
global $mod_strings;
global $current_user;
global $sugar_version, $sugar_config;
// INSTANTIATES THE MODULE CLASSES
$focus = new EcmCalendar();
// IF PROCESSING AN EXISTING RECORD, RETRIEVE IT
if(isset($_REQUEST['record'])) {
$focus->retrieve($_REQUEST['record']);
$focus->unformat_all_fields();
}
if(isset($_REQUEST['isDuplicate']) && $_REQUEST['isDuplicate'] == 'true') {
$focus->id = "";
$focus->simplemodule_number = "";
}
$prefillArray = array(
'priority' => 'priority',
'name' => 'name',
'description' => 'description',
'status' => 'status',
'type' => 'type',
);
foreach($prefillArray as $requestKey => $focusVar) {
if (isset($_REQUEST[$requestKey]) && is_null($focus->$focusVar)) {
$focus->$focusVar = urldecode($_REQUEST[$requestKey]);
}
}
// BUILD MODULE TITLE LINE
echo "\n<p>\n";
echo get_module_title($mod_strings['LBL_MODULE_ID'], $mod_strings['LBL_MODULE_NAME'].": ".$focus->name, true);
echo "\n</p>\n";
global $theme;
$theme_path = "themes/".$theme."/";
$image_path = $theme_path."images/";
require_once ($theme_path.'layout_utils.php');
$GLOBALS['log']->info("EcmCalendars detail view");
// ASSIGN XTEMPLATE
$xtpl = new XTemplate ('modules/EcmCalendars/EditView.html');
// FILL XTEMPLATE MODULE & APPLICATION LANGUAGE STRINGS
$xtpl->assign("MOD", $mod_strings);
$xtpl->assign("APP", $app_strings);
$xtpl->assign("CALENDAR_DATEFORMAT", $timedate->get_cal_date_format());
if (isset($_REQUEST['return_module'])) $xtpl->assign("RETURN_MODULE", $_REQUEST['return_module']);
if (isset($_REQUEST['return_action'])) $xtpl->assign("RETURN_ACTION", $_REQUEST['return_action']);
if (isset($_REQUEST['return_id'])) $xtpl->assign("RETURN_ID", $_REQUEST['return_id']);
if (empty($_REQUEST['return_id'])) {
$xtpl->assign("RETURN_ACTION", 'index');
}
///////////////////////////////////////
// SETUP POPUPS START
// Users Popup
$json = getJSONobj();
$popup_request_data = array(
'call_back_function' => 'set_return',
'form_name' => 'EditView',
'field_to_name_array' => array(
'id' => 'assigned_user_id',
'user_name' => 'assigned_user_name',
),
);
$xtpl->assign('encoded_users_popup_request_data', $json->encode($popup_request_data));
//
////////////////////////////////////////////////////////////////////////////////
// ACCOUNT_ID WILL BE SET WHEN USER CHOOSES TO CREATE A NEW SIMPLEMODULE FROM ACCOUNT DETAIL VIEW.
if (isset($_REQUEST['account_id'])) $xtpl->assign("ACCOUNT_ID", $_REQUEST['account_id']);
if (isset($_REQUEST['contact_id'])) $xtpl->assign("CONTACT_ID", $_REQUEST['contact_id']);
// SET THE CASE_ID, IF SET.
// WITH NEW CONCEPT OF SUBPANELS IT,
// WHEN THE SUBPANEL IS DISPLAYED IT PULLS FROM THE CLASS NAME WHICH IN THE SITUATION OF CASES IS ACASE SO THE FORM IS GENERATED
// WITH ACASE_ID INSTEAD OF CASE_ID, SO I HAVE DONE THE MAPPING HERE
if (isset($_REQUEST['acase_id'])) $xtpl->assign("CASE_ID",$_REQUEST['acase_id']);
else if(isset($_REQUEST['case_id'])) $xtpl->assign("CASE_ID",$_REQUEST['case_id']);
////////////////////////////////////////////////////////////////////////////////
// QUICK SEARCH SETUP
require_once('include/QuickSearchDefaults.php');
$qsd = new QuickSearchDefaults();
$sqs_objects = array(
'assigned_user_name' => $qsd->getQSUser(),
/*
//BUILDER:START Pro only
'team_name' => $qsd->getQSTeam()
//BUILDER:END Pro only
*/
);
$quicksearch_js = $qsd->getQSScripts();
$quicksearch_js .= '<script type="text/javascript" language="javascript">sqs_objects = ' . $json->encode($sqs_objects) . '</script>';
// QUICK SEARCH SETUP
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// ASSIGN GLOBAL VARIABLES
$xtpl->assign("THEME", $theme);
$xtpl->assign("IMAGE_PATH", $image_path);$xtpl->assign("PRINT_URL", "index.php?".$GLOBALS['request_string']);
$xtpl->assign("JAVASCRIPT", get_set_focus_js().get_validate_record_js(). $quicksearch_js);
$xtpl->assign("USER_DATEFORMAT", '('. $timedate->get_user_date_format().')');
$xtpl->assign("CALENDAR_DATEFORMAT", $timedate->get_cal_date_format());
// ASSIGN GLOBAL VARIABLES
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
// ASSIGN MODULE DEFAULT VARIABLES
$xtpl->assign("ID", $focus->id);
if (!empty($focus->name))
$xtpl->assign("NAME", $focus->name);
else $xtpl->assign("NAME", "");
$xtpl->assign("DATE_ENTERED", $focus->date_entered);
$xtpl->assign("DATE_MODIFIED", $focus->date_modified);
$xtpl->assign("CREATED_BY", $focus->created_by_name);
$xtpl->assign("MODIFIED_BY", $focus->modified_by_name);
if (empty($focus->assigned_user_id) && empty($focus->id)) $focus->assigned_user_id = $current_user->id;
if (empty($focus->assigned_name) && empty($focus->id)) $focus->assigned_user_name = $current_user->user_name;
$xtpl->assign("ASSIGNED_USER_OPTIONS", get_select_options_with_id(get_user_array(TRUE, "Active", $focus->assigned_user_id), $focus->assigned_user_id));
$xtpl->assign("ASSIGNED_USER_NAME", $focus->assigned_user_name);
$xtpl->assign("ASSIGNED_USER_ID", $focus->assigned_user_id );
// ASSIGN MODULE SPECIFIC VARIABLES
$xtpl->assign("DESCRIPTION", $focus->description);
// ASSIGN MODULE DROPDOWNS WITH DEFAULT KEY
// ASSIGN MODULE VARIABLES AFFECTED BY DUPLICATE ACTION
if(!isset($_REQUEST['isDuplicate'])) {
$focus->id = "";
}
// ASSIGN MODULE DROPDOWNS WITHOUT DEFAULT KEY
//BUILDER:END of xtpl
// ADD CUSTOM FIELDS
require_once('modules/DynamicFields/templates/Files/EditView.php');
////////////////////////////////////////////////////////////////////////////////
// USER ASSIGNMENT
global $current_user;
if(is_admin($current_user) && $_REQUEST['module'] != 'DynamicLayout' && !empty($_SESSION['editinplace'])){
$record = '';
// USER ASSIGNMENT
////////////////////////////////////////////////////////////////////////////////
if(!empty($_REQUEST['record'])){
$record = $_REQUEST['record'];
}
$xtpl->assign("ADMIN_EDIT","<a href='index.php?action=index&module=DynamicLayout&from_action=".$_REQUEST['action'] ."&from_module=".$_REQUEST['module'] ."&record=".$record. "'>".get_image($image_path."EditLayout","border='0' alt='Edit Layout' align='bottom'")."</a>");
}
$xtpl->parse("main");
$xtpl->out("main");
require_once('include/javascript/javascript.php');
$javascript = new javascript();
$javascript->setFormName('EditView');
$javascript->setSugarBean($focus);
$javascript->addAllFields('');
//BUILDER:START Pro only
// $javascript->addFieldGeneric( 'team_name', 'varchar', $app_strings['LBL_TEAM'] ,'true');
// $javascript->addToValidateBinaryDependency('team_name', 'alpha', $app_strings['ERR_SQS_NO_MATCH_FIELD'] . $app_strings['LBL_TEAM'], 'false', '', 'team_id');
//BUILDER:END Pro only
$javascript->addToValidateBinaryDependency('assigned_user_name', 'alpha', $app_strings['ERR_SQS_NO_MATCH_FIELD'] . $app_strings['LBL_ASSIGNED_TO'], 'false', '', 'assigned_user_id');
echo $javascript->getScript();
////////////////////////////////////////////////////////////////////////////////
/// SELECT CHANGES TEXT INPUT FIELD
/*
$prob_array = $json->encode($app_list_strings['sales_probability_dom']);
$prePopProb = '';
if(empty($focus->id)) $prePopProb = 'document.getElementsByName(\'sales_stage\')[0].onchange();';
echo <<<EOQ
<script>
prob_array = $prob_array;
document.getElementsByName('sales_stage')[0].onchange = function() {
if(typeof(document.getElementsByName('sales_stage')[0].value) != "undefined" && prob_array[document.getElementsByName('sales_stage')[0].value]) {
document.getElementsByName('probability')[0].value = prob_array[document.getElementsByName('sales_stage')[0].value];
}
};
$prePopProb
</script>
EOQ;
*/
//
/// SELECT CHANGES TEXT INPUT FIELD
////////////////////////////////////////////////////////////////////////////////
require_once('modules/SavedSearch/SavedSearch.php');
$savedSearch = new SavedSearch();
$json = getJSONobj();
$savedSearchSelects = $json->encode(array($GLOBALS['app_strings']['LBL_SAVED_SEARCH_SHORTCUT'] . '<br>' . $savedSearch->getSelect('EcmCalendars')));
$str = "<script>
YAHOO.util.Event.addListener(window, 'load', SUGAR.util.fillShortcuts, $savedSearchSelects);
</script>";
echo $str;
?>

111
modules/EcmCalendars/Forms.php Executable file
View File

@@ -0,0 +1,111 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*****************************************************************************
* The contents of this file are subject to the RECIPROCAL PUBLIC LICENSE
* Version 1.1 ("License"); You may not use this file except in compliance
* with the License. You may obtain a copy of the License at
* http://opensource.org/licenses/rpl.php. Software distributed under the
* License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
* either express or implied.
*
* You may:
* a) Use and distribute this code exactly as you received without payment or
* a royalty or other fee.
* b) Create extensions for this code, provided that you make the extensions
* publicly available and document your modifications clearly.
* c) Charge for a fee for warranty or support or for accepting liability
* obligations for your customers.
*
* You may NOT:
* a) Charge for the use of the original code or extensions, including in
* electronic distribution models, such as ASP (Application Service
* Provider).
* b) Charge for the original source code or your extensions other than a
* nominal fee to cover distribution costs where such distribution
* involves PHYSICAL media.
* c) Modify or delete any pre-existing copyright notices, change notices,
* or License text in the Licensed Software
* d) Assert any patent claims against the Licensor or Contributors, or
* which would in any way restrict the ability of any third party to use the
* Licensed Software.
*
* You must:
* a) Document any modifications you make to this code including the nature of
* the change, the authors of the change, and the date of the change.
* b) Make the source code for any extensions you deploy available via an
* Electronic Distribution Mechanism such as FTP or HTTP download.
* c) Notify the licensor of the availability of source code to your extensions
* and include instructions on how to acquire the source code and updates.
* d) Grant Licensor a world-wide, non-exclusive, royalty-free license to use,
* reproduce, perform, modify, sublicense, and distribute your extensions.
*
* The Original Code is: CommuniCore
* Olavo Farias
* 2006-04-7 olavo.farias@gmail.com
*
* The Initial Developer of the Original Code is CommuniCore.
* Portions created by CommuniCore are Copyright (C) 2005 CommuniCore Ltda
* All Rights Reserved.
********************************************************************************/
/*******************************************************************************
* CREATE JAVASCRIPT TO VALIDATE THE DATA ENTERED INTO A RECORD.
*******************************************************************************/
function get_validate_record_js () {
}
/*******************************************************************************
* CREATE FORM FOR MENU RAPID CREATE
*******************************************************************************/
function get_new_record_form () {/*
if(!ACLController::checkAccess('EcmCalendars', 'edit', true)){
return '';
}
global $mod_strings;
global $app_strings;
global $app_list_strings;
global $mod_strings;
global $theme;
global $current_user;
$lbl_subject = $mod_strings['LBL_SUBJECT'];
$lbl_required_symbol = $app_strings['LBL_REQUIRED_SYMBOL'];
$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'];
$user_id = $current_user->id;
$the_form = get_left_form_header($mod_strings['LBL_NEW_FORM_TITLE']);
$the_form .= <<<EOQ
<form name="EcmCalendarSave" onSubmit="return check_form('EcmCalendarsSave')" method="POST" action="index.php">
<input type="hidden" name="module" value="EcmCalendars">
<input type="hidden" name="record" value="">
<input type="hidden" name="assigned_user_id" value='${user_id}'>
<input type="hidden" name="action" value="Save">
${lbl_subject}&nbsp;<span class="required">${lbl_required_symbol}</span><br>
<p><input name='name' type="text" size='20' maxlength="255"value=""><br>
</p>
<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;
require_once('include/javascript/javascript.php');
require_once('modules/EcmCalendars/EcmCalendar.php');
$javascript = new javascript();
$javascript->setFormName('EcmCalendarsSave}');
$javascript->setSugarBean(new EcmCalendar());
$javascript->addRequiredFields('');
$the_form .= $javascript->getScript();
$the_form .= get_left_form_footer();
return $the_form;*/
}
?>

187
modules/EcmCalendars/ListView.php Executable file
View File

@@ -0,0 +1,187 @@
<?php
/*****************************************************************************
* The contents of this file are subject to the RECIPROCAL PUBLIC LICENSE
* Version 1.1 ("License"); You may not use this file except in compliance
* with the License. You may obtain a copy of the License at
* http://opensource.org/licenses/rpl.php. Software distributed under the
* License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
* either express or implied.
*
* You may:
* a) Use and distribute this code exactly as you received without payment or
* a royalty or other fee.
* b) Create extensions for this code, provided that you make the extensions
* publicly available and document your modifications clearly.
* c) Charge for a fee for warranty or support or for accepting liability
* obligations for your customers.
*
* You may NOT:
* a) Charge for the use of the original code or extensions, including in
* electronic distribution models, such as ASP (Application Service
* Provider).
* b) Charge for the original source code or your extensions other than a
* nominal fee to cover distribution costs where such distribution
* involves PHYSICAL media.
* c) Modify or delete any pre-existing copyright notices, change notices,
* or License text in the Licensed Software
* d) Assert any patent claims against the Licensor or Contributors, or
* which would in any way restrict the ability of any third party to use the
* Licensed Software.
*
* You must:
* a) Document any modifications you make to this code including the nature of
* the change, the authors of the change, and the date of the change.
* b) Make the source code for any extensions you deploy available via an
* Electronic Distribution Mechanism such as FTP or HTTP download.
* c) Notify the licensor of the availability of source code to your extensions
* and include instructions on how to acquire the source code and updates.
* d) Grant Licensor a world-wide, non-exclusive, royalty-free license to use,
* reproduce, perform, modify, sublicense, and distribute your extensions.
*
* The Original Code is: CommuniCore
* Olavo Farias
* 2006-04-7 olavo.farias@gmail.com
*
* The Initial Developer of the Original Code is CommuniCore.
* Portions created by CommuniCore are Copyright (C) 2005 CommuniCore Ltda
* All Rights Reserved.
********************************************************************************/
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
require_once ('XTemplate/xtpl.php');
require_once ("data/Tracker.php");
require_once ('modules/EcmCalendars/EcmCalendar.php');
require_once ('themes/'.$theme.'/layout_utils.php');
require_once ('log4php/LoggerManager.php');
require_once('include/ListView/ListViewSmarty.php');
require_once('modules/Currencies/Currency.php');
if(file_exists('custom/modules/EcmCalendars/metadata/listviewdefs.php')){
require_once('custom/modules/EcmCalendars/metadata/listviewdefs.php');
}else{
require_once('modules/EcmCalendars/metadata/listviewdefs.php');
}
require_once('modules/SavedSearch/SavedSearch.php');
require_once('include/SearchForm/SearchForm.php');
$header_text = '';
global $app_strings;
global $mod_strings;
global $app_list_strings;
global $current_language;
$current_module_strings = return_module_language($current_language, 'EcmCalendars');
global $urlPrefix;
global $currentModule;
global $theme;
global $current_user;
// FOCUS_LIST IS THE MEANS OF PASSING DATA TO A LISTVIEW.
global $focus_list;
// SETUP QUICKSEARCH
require_once('include/QuickSearchDefaults.php');
$qsd = new QuickSearchDefaults();
// CLEAR THE DISPLAY COLUMNS BACK TO DEFAULT WHEN CLEAR QUERY IS CALLED
if(!empty($_REQUEST['clear_query']) && $_REQUEST['clear_query'] == 'true')
$current_user->setPreference('ListViewDisplayColumns', array(), 0, $currentModule);
$savedDisplayColumns = $current_user->getPreference('ListViewDisplayColumns', $currentModule); // GET USER DEFINED DISPLAY COLUMNS
$json = getJSONobj();
$seedEcmCalendar = new EcmCalendar(); // SEED BEAN
$searchForm = new SearchForm('EcmCalendars', $seedEcmCalendar); // NEW SEARCHFORM INSTANCE
// SETUP LISTVIEW SMARTY
$lv = new ListViewSmarty();
$displayColumns = array();
// CHECK $_REQUEST IF NEW DISPLAY COLUMNS FROM POST
if (!empty($_REQUEST['displayColumns'])) {
foreach (explode('|', $_REQUEST['displayColumns']) as $num => $col) {
if (!empty($listViewDefs['EcmCalendars'][$col]))
$displayColumns[$col] = $listViewDefs['EcmCalendars'][$col];
}
}elseif(!empty($savedDisplayColumns)) { // USE USER DEFINED DISPLAY COLUMNS FROM PREFERENCES
$displayColumns = $savedDisplayColumns;
}else { // USE COLUMNS DEFINED IN LISTVIEWDEFS FOR DEFAULT DISPLAY COLUMNS
foreach($listViewDefs['EcmCalendars'] as $col => $params) {
if(!empty($params['default']) && $params['default'])
$displayColumns[$col] = $params;
}
}
$params = array('massupdate' => true); // SETUP LISTVIEWSMARTY PARAMS
if(!empty($_REQUEST['orderBy'])) { // ORDER BY COMING FROM $_REQUEST
$params['orderBy'] = $_REQUEST['orderBy'];
$params['overrideOrder'] = true;
if(!empty($_REQUEST['sortOrder'])) $params['sortOrder'] = $_REQUEST['sortOrder'];
}
$lv->displayColumns = $displayColumns;
if(!empty($_REQUEST['search_form_only']) && $_REQUEST['search_form_only']) { // HANDLE AJAX REQUESTS FOR SEARCH FORMS ONLY
switch($_REQUEST['search_form_view']) {
case 'basic_search':
$searchForm->setup();
$searchForm->displayBasic(false);
break;
case 'advanced_search':
$searchForm->setup();
$searchForm->displayAdvanced(false);
break;
case 'saved_views':
echo $searchForm->displaySavedViews($listViewDefs, $lv, false);
break;
}
return;
}
// USE THE STORED QUERY IF THERE IS ONE
if (!isset($where)) $where = "";
require_once('modules/MySettings/StoreQuery.php');
$storeQuery = new StoreQuery();
if(!isset($_REQUEST['query'])){
$storeQuery->loadQuery($currentModule);
$storeQuery->populateRequest();
}else{
$storeQuery->saveFromGet($currentModule);
}
if(isset($_REQUEST['query'])){
// WE HAVE A QUERY
// FIRST SAVE COLUMNS
$current_user->setPreference('ListViewDisplayColumns', $displayColumns, 0, $currentModule);
$searchForm->populateFromRequest(); // GATHERS SEARCH FIELD INPUTS FROM $_REQUEST
$where_clauses = $searchForm->generateSearchWhere(true, "EcmCalendar"); // BUILDS THE WHERE CLAUSE FROM SEARCH FIELD INPUTS
if (count($where_clauses) > 0 )$where = implode(' and ', $where_clauses);
$GLOBALS['log']->info("Here is the where clause for the list view: $where");
}
// START DISPLAY
// WHICH TAB OF SEARCH FORM TO DISPLAY
if(!isset($_REQUEST['search_form']) || $_REQUEST['search_form'] != 'false') {
$searchForm->setup();
if(isset($_REQUEST['searchFormTab']) && $_REQUEST['searchFormTab'] == 'advanced_search') {
$searchForm->displayAdvanced();
}elseif(isset($_REQUEST['searchFormTab']) && $_REQUEST['searchFormTab'] == 'saved_views'){
$searchForm->displaySavedViews($listViewDefs, $lv);
}else {
$searchForm->displayBasic();
}
}
echo $qsd->GetQSScripts();
$lv->setup($seedEcmCalendar, 'include/ListView/ListViewGeneric.tpl', $where, $params);
$savedSearchName = empty($_REQUEST['saved_search_select_name']) ? '' : (' - ' . $_REQUEST['saved_search_select_name']);
echo get_form_header($current_module_strings['LBL_LIST_FORM_TITLE'] . $savedSearchName, '', false);
echo $lv->display();
$savedSearch = new SavedSearch();
$json = getJSONobj();
// FILLS IN SAVED VIEWS SELECT BOX ON SHORTCUT MENU
$savedSearchSelects = $json->encode(array($GLOBALS['app_strings']['LBL_SAVED_SEARCH_SHORTCUT'] . '<br>' . $savedSearch->getSelect('EcmCalendars')));
$str = "<script>
YAHOO.util.Event.addListener(window, 'load', SUGAR.util.fillShortcuts, $savedSearchSelects);
</script>";
echo $str;
?>

68
modules/EcmCalendars/Menu.php Executable file
View File

@@ -0,0 +1,68 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*****************************************************************************
* The contents of this file are subject to the RECIPROCAL PUBLIC LICENSE
* Version 1.1 ("License"); You may not use this file except in compliance
* with the License. You may obtain a copy of the License at
* http://opensource.org/licenses/rpl.php. Software distributed under the
* License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
* either express or implied.
*
* You may:
* a) Use and distribute this code exactly as you received without payment or
* a royalty or other fee.
* b) Create extensions for this code, provided that you make the extensions
* publicly available and document your modifications clearly.
* c) Charge for a fee for warranty or support or for accepting liability
* obligations for your customers.
*
* You may NOT:
* a) Charge for the use of the original code or extensions, including in
* electronic distribution models, such as ASP (Application Service
* Provider).
* b) Charge for the original source code or your extensions other than a
* nominal fee to cover distribution costs where such distribution
* involves PHYSICAL media.
* c) Modify or delete any pre-existing copyright notices, change notices,
* or License text in the Licensed Software
* d) Assert any patent claims against the Licensor or Contributors, or
* which would in any way restrict the ability of any third party to use the
* Licensed Software.
*
* You must:
* a) Document any modifications you make to this code including the nature of
* the change, the authors of the change, and the date of the change.
* b) Make the source code for any extensions you deploy available via an
* Electronic Distribution Mechanism such as FTP or HTTP download.
* c) Notify the licensor of the availability of source code to your extensions
* and include instructions on how to acquire the source code and updates.
* d) Grant Licensor a world-wide, non-exclusive, royalty-free license to use,
* reproduce, perform, modify, sublicense, and distribute your extensions.
*
* The Original Code is: CommuniCore
* Olavo Farias
* 2006-04-7 olavo.farias@gmail.com
*
* The Initial Developer of the Original Code is CommuniCore.
* Portions created by CommuniCore are Copyright (C) 2005 CommuniCore Ltda
* All Rights Reserved.
********************************************************************************/
global $mod_strings;
/*
if(ACLController::checkAccess('EcmCalendars', 'edit', true))
$module_menu [] = Array("index.php?module=EcmCalendars&action=EditView&return_module=EcmCalendars&return_action=DetailView", $mod_strings['LNK_NEW_ECMCALENDARS'],"CreateEcmCalendars", 'EcmCalendars');
if(ACLController::checkAccess('EcmCalendars', 'list', true))
$module_menu [] = Array("index.php?module=EcmCalendars&action=index&return_module=EcmCalendars&return_action=DetailView", $mod_strings['LNK_ECMCALENDARS_LIST'],"ListEcmCalendars", 'EcmCalendars');
*/
//if(ACLController::checkAccess('EcmCalendars','list', true)) $module_menu[] = Array('#', '<span style="display: none">wp_shortcut_fill_0</span>', '');
/*
if(ACLController::checkAccess('EcmCalendars', 'edit', true))$module_menu[]=Array("index.php?module=EcmCalendars&action=EditSettings", $mod_strings['LNK_SETTINGS'],"SettingsEcmCalendars");
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('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");
*/
?>

57
modules/EcmCalendars/Popup.php Executable file
View File

@@ -0,0 +1,57 @@
<?php
/*****************************************************************************
* The contents of this file are subject to the RECIPROCAL PUBLIC LICENSE
* Version 1.1 ("License"); You may not use this file except in compliance
* with the License. You may obtain a copy of the License at
* http://opensource.org/licenses/rpl.php. Software distributed under the
* License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
* either express or implied.
*
* You may:
* a) Use and distribute this code exactly as you received without payment or
* a royalty or other fee.
* b) Create extensions for this code, provided that you make the extensions
* publicly available and document your modifications clearly.
* c) Charge for a fee for warranty or support or for accepting liability
* obligations for your customers.
*
* You may NOT:
* a) Charge for the use of the original code or extensions, including in
* electronic distribution models, such as ASP (Application Service
* Provider).
* b) Charge for the original source code or your extensions other than a
* nominal fee to cover distribution costs where such distribution
* involves PHYSICAL media.
* c) Modify or delete any pre-existing copyright notices, change notices,
* or License text in the Licensed Software
* d) Assert any patent claims against the Licensor or Contributors, or
* which would in any way restrict the ability of any third party to use the
* Licensed Software.
*
* You must:
* a) Document any modifications you make to this code including the nature of
* the change, the authors of the change, and the date of the change.
* b) Make the source code for any extensions you deploy available via an
* Electronic Distribution Mechanism such as FTP or HTTP download.
* c) Notify the licensor of the availability of source code to your extensions
* and include instructions on how to acquire the source code and updates.
* d) Grant Licensor a world-wide, non-exclusive, royalty-free license to use,
* reproduce, perform, modify, sublicense, and distribute your extensions.
*
* The Original Code is: CommuniCore
* Olavo Farias
* 2006-04-7 olavo.farias@gmail.com
*
* The Initial Developer of the Original Code is CommuniCore.
* Portions created by CommuniCore are Copyright (C) 2005 CommuniCore Ltda
* All Rights Reserved.
********************************************************************************/
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
require_once('include/Popups/Popup_picker.php');
$popup = new Popup_Picker();
echo $popup->process_page();
?>

View File

@@ -0,0 +1,147 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*****************************************************************************
* The contents of this file are subject to the RECIPROCAL PUBLIC LICENSE
* Version 1.1 ("License"); You may not use this file except in compliance
* with the License. You may obtain a copy of the License at
* http://opensource.org/licenses/rpl.php. Software distributed under the
* License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
* either express or implied.
*
* You may:
* a) Use and distribute this code exactly as you received without payment or
* a royalty or other fee.
* b) Create extensions for this code, provided that you make the extensions
* publicly available and document your modifications clearly.
* c) Charge for a fee for warranty or support or for accepting liability
* obligations for your customers.
*
* You may NOT:
* a) Charge for the use of the original code or extensions, including in
* electronic distribution models, such as ASP (Application Service
* Provider).
* b) Charge for the original source code or your extensions other than a
* nominal fee to cover distribution costs where such distribution
* involves PHYSICAL media.
* c) Modify or delete any pre-existing copyright notices, change notices,
* or License text in the Licensed Software
* d) Assert any patent claims against the Licensor or Contributors, or
* which would in any way restrict the ability of any third party to use the
* Licensed Software.
*
* You must:
* a) Document any modifications you make to this code including the nature of
* the change, the authors of the change, and the date of the change.
* b) Make the source code for any extensions you deploy available via an
* Electronic Distribution Mechanism such as FTP or HTTP download.
* c) Notify the licensor of the availability of source code to your extensions
* and include instructions on how to acquire the source code and updates.
* d) Grant Licensor a world-wide, non-exclusive, royalty-free license to use,
* reproduce, perform, modify, sublicense, and distribute your extensions.
*
* The Original Code is: CommuniCore
* Olavo Farias
* 2006-04-7 olavo.farias@gmail.com
*
* The Initial Developer of the Original Code is CommuniCore.
* Portions created by CommuniCore are Copyright (C) 2005 CommuniCore Ltda
* All Rights Reserved.
********************************************************************************/
global $theme;
require_once('modules/EcmCalendars/EcmCalendar.php');
require_once('themes/'.$theme.'/layout_utils.php');
require_once('log4php/LoggerManager.php');
require_once('XTemplate/xtpl.php');
require_once('include/ListView/ListView.php');
$image_path = 'themes/'.$theme.'/images/';
class Popup_Picker{
function Popup_Picker(){
;
}
function _get_where_clause(){
$where = '';
if(isset($_REQUEST['query'])){
$where_clauses = array();
append_where_clause($where_clauses, "name", "ecmcalendars.name");
$where = generate_where_statement($where_clauses);
}
return $where;
}
function process_page(){
global $theme;
global $mod_strings;
global $app_strings;
global $currentModule;
$output_html = '';
$where = '';
$where = $this->_get_where_clause();
$image_path = 'themes/'.$theme.'/images/';
$name = empty($_REQUEST['name']) ? '' : $_REQUEST['name'];
$request_data = empty($_REQUEST['request_data']) ? '' : $_REQUEST['request_data'];
$hide_clear_button = empty($_REQUEST['hide_clear_button']) ? false : true;
$button = "<form action='index.php' method='post' name='form' id='form'>\n";
if(!$hide_clear_button){
$button .= "<input type='button' name='button' class='button' onclick=\"send_back('','');\" title='"
.$app_strings['LBL_CLEAR_BUTTON_TITLE']."' accesskey='"
.$app_strings['LBL_CLEAR_BUTTON_KEY'] ."' value=' "
.$app_strings['LBL_CLEAR_BUTTON_LABEL']." ' />\n";
}
$button .= "<input type='submit' name='button' class='button' onclick=\"window.close();\" title='"
.$app_strings['LBL_CANCEL_BUTTON_TITLE']."' accesskey='"
.$app_strings['LBL_CANCEL_BUTTON_KEY'] ."' value=' "
.$app_strings['LBL_CANCEL_BUTTON_LABEL']." ' />\n";
$button .= "</form>\n";
$form = new XTemplate('modules/EcmCalendars/Popup_picker.html');
$form->assign('MOD', $mod_strings);
$form->assign('APP', $app_strings);
$form->assign('THEME', $theme);
$form->assign('MODULE_NAME', $currentModule);
$form->assign('NAME', $name);
$form->assign('request_data', $request_data);
ob_start();
insert_popup_header($theme);
$output_html .= ob_get_contents();
ob_end_clean();
$output_html .= get_form_header($mod_strings['LBL_SEARCH_FORM_TITLE'], '', false);
$form->parse('main.SearchHeader');
$output_html .= $form->text('main.SearchHeader');
$output_html .= get_form_footer();
// RESET THE SECTIONS THAT ARE ALREADY IN THE PAGE SO THAT THEY DO NOT PRINT AGAIN LATER.
$form->reset('main.SearchHeader');
// CREATE THE LISTVIEW
$seed_bean = new EcmCalendar();
$ListView = new ListView();
$ListView->show_export_button = false;
$ListView->process_for_popups = true;
$ListView->setXTemplate($form);
$ListView->setHeaderTitle($mod_strings['LBL_LIST_FORM_TITLE']);
$ListView->setHeaderText($button);
$ListView->setQuery($where, '', 'name', 'ECMCALENDAR');
$ListView->setModStrings($mod_strings);
ob_start();
$ListView->processListView($seed_bean, 'main', 'ECMCALENDAR');
$output_html .= ob_get_contents();
ob_end_clean();
$output_html .= get_form_footer();
$output_html .= insert_popup_footer();
return $output_html;
}
} // end of class Popup_Picker
?>

87
modules/EcmCalendars/Save.php Executable file
View File

@@ -0,0 +1,87 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*****************************************************************************
* The contents of this file are subject to the RECIPROCAL PUBLIC LICENSE
* Version 1.1 ("License"); You may not use this file except in compliance
* with the License. You may obtain a copy of the License at
* http://opensource.org/licenses/rpl.php. Software distributed under the
* License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
* either express or implied.
*
* You may:
* a) Use and distribute this code exactly as you received without payment or
* a royalty or other fee.
* b) Create extensions for this code, provided that you make the extensions
* publicly available and document your modifications clearly.
* c) Charge for a fee for warranty or support or for accepting liability
* obligations for your customers.
*
* You may NOT:
* a) Charge for the use of the original code or extensions, including in
* electronic distribution models, such as ASP (Application Service
* Provider).
* b) Charge for the original source code or your extensions other than a
* nominal fee to cover distribution costs where such distribution
* involves PHYSICAL media.
* c) Modify or delete any pre-existing copyright notices, change notices,
* or License text in the Licensed Software
* d) Assert any patent claims against the Licensor or Contributors, or
* which would in any way restrict the ability of any third party to use the
* Licensed Software.
*
* You must:
* a) Document any modifications you make to this code including the nature of
* the change, the authors of the change, and the date of the change.
* b) Make the source code for any extensions you deploy available via an
* Electronic Distribution Mechanism such as FTP or HTTP download.
* c) Notify the licensor of the availability of source code to your extensions
* and include instructions on how to acquire the source code and updates.
* d) Grant Licensor a world-wide, non-exclusive, royalty-free license to use,
* reproduce, perform, modify, sublicense, and distribute your extensions.
*
* The Original Code is: CommuniCore
* Olavo Farias
* 2006-04-7 olavo.farias@gmail.com
*
* The Initial Developer of the Original Code is CommuniCore.
* Portions created by CommuniCore are Copyright (C) 2005 CommuniCore Ltda
* All Rights Reserved.
********************************************************************************/
require_once('modules/EcmCalendars/EcmCalendar.php');
require_once('include/formbase.php');
$focus = new EcmCalendar();
$focus->retrieve($_POST['record']);
if(!$focus->ACLAccess('Save')){
ACLController::displayNoAccess(true);
sugar_cleanup(true);
}
if (!empty($_POST['assigned_user_id']) && ($focus->assigned_user_id != $_POST['assigned_user_id']) && ($_POST['assigned_user_id'] != $current_user->id)) {
$check_notify = TRUE;
}else{
$check_notify = FALSE;
}
foreach($focus->column_fields as $field){
if(isset($_POST[$field])){
$value = $_POST[$field];
$focus->$field = $value;
}
}
foreach($focus->additional_column_fields as $field){
if(isset($_POST[$field])){
$value = $_POST[$field];
$focus->$field = $value;
}
}
$focus->unformat_all_fields();
$focus->save($check_notify);
$return_id = $focus->id;
handleRedirect($return_id,'EcmCalendars');
?>

View File

@@ -0,0 +1,12 @@
<?php
require_once('modules/EcmCalendars/Calendar.php');
$c = new Calendar();
if ($_REQUEST['date']) {
$exp = explode("-", $_REQUEST['date']);
$c->year = $exp[0];
$c->month = $exp[1];
$c->day = $exp[2];
}
echo $c->showNavDay();
?>

View File

@@ -0,0 +1,49 @@
<?php
require_once('modules/EcmCalendars/Calendar.php');
$c = new Calendar();
$timezone = $timedate->getUserTimeZone($current_user);
$deltaServerUser = $timedate->get_hour_offset(true, $timezone);
//print "mm".$timedate->handle_offset("2008-12-12 14:00:00", "H:i:s", true, $current_user)."mmm";
if ($_REQUEST['date']) {
//kontynuacja
$exp = explode("-", $_REQUEST['date']);
$c->year = $_SESSION['ecmcalendar']['y'] = $exp[0];
$c->month = $_SESSION['ecmcalendar']['m'] = $exp[1];
$c->day = $_SESSION['ecmcalendar']['d'] = $exp[2];
} else {
//inicjacja
if ($_SESSION['ecmcalendar']) {
$c->year = $_SESSION['ecmcalendar']['y'];
$c->month = $_SESSION['ecmcalendar']['m'];
$c->day = $_SESSION['ecmcalendar']['d'];
} else {
$c->year = $_SESSION['ecmcalendar']['y'] = date("Y");
$c->month = $_SESSION['ecmcalendar']['m'] = date("m");
$c->day = $_SESSION['ecmcalendar']['d'] = date("d");
}
}
if ($_SESSION['cal_dashlet']['act_status'])
$c->act_status = $_SESSION['cal_dashlet']['act_status'];
else
$c->act_status = "All";
if ($_SESSION['cal_dashlet']['act_user'])
$c->act_user = $_SESSION['cal_dashlet']['act_user'];
else
$c->act_user = "All";
if ($_SESSION['cal_dashlet']['act_type'])
$c->act_type = $_SESSION['cal_dashlet']['act_type'];
else
$c->act_type = "All";
//$c->current_user=$current_user;
echo '<link rel="stylesheet" type="text/css" media="all" href="themes/Sugar/calendar-win2k-cold-1.css?s=5.0.0e&c=">';
echo '<style type="text/css">@import url("themes/Sugar/style.css?s=5.0.0e&c=");</style>';
echo '<link href="themes/Sugar/colors.sugar.css?s=5.0.0e&c=" rel="stylesheet" type="text/css" title="sugar" />';
echo '<link href="modules/EcmCalendars/style.css" rel="stylesheet" type="text/css">';
echo '<script language="javascript" src="modules/EcmCalendars/helper.js"></script>';
echo '<script language="javascript" src="modules/EcmCalendars/Calendar.js"></script>';
echo $c->showTableDay($c->month, $c->year, $c->day);
return $c->showTableDay($c->month, $c->year, $c->day);
?>

View File

@@ -0,0 +1,37 @@
<?php
require_once('modules/EcmCalendars/Calendar.php');
global $current_user;
$c = new Calendar();
if ($_REQUEST['date']) {
$exp = explode("-", $_REQUEST['date']);
$c->year = $exp[0];
$c->month = $exp[1];
} else {
$c->year = date("Y");
$c->month = date("m");
}
if ($_REQUEST['act_status']) {
$c->act_status = $_REQUEST['act_status'];
} else {
$c->act_status = "All";
}
if ($_REQUEST['act_user']) {
$c->act_user = $_REQUEST['act_user'];
} else {
$c->act_user = "All";
}
if ($_REQUEST['act_type']) {
$c->act_type = $_REQUEST['act_type'];
} else {
$c->act_type = "All";
}
$_SESSION['cal_dashlet']['act_type'] = $c->act_type;
$_SESSION['cal_dashlet']['act_user'] = $c->act_user;
$_SESSION['cal_dashlet']['act_status'] = $c->act_status;
$dashletDefs = $current_user->getPreference('dashlets', 'Home');
$dashletDefs[$_SESSION['calendar_dashlet_id']]['options'] = array('act_user' => $c->act_user, 'act_status' => $c->act_status, 'act_type' => $c->act_type);
$current_user->setPreference('dashlets', $dashletDefs, 0, 'Home');
//echo '<script type="text/javascript" src="modules/EcmCalendars/helper.js"></script>';
echo $c->showTableDashlet($c->month, $c->year, 1);
?>

View File

@@ -0,0 +1,42 @@
<?php
require_once('modules/EcmCalendars/Calendar.php');
global $current_user;
$c = new Calendar();
if ($_REQUEST['date']) {
$exp = explode("-", $_REQUEST['date']);
$c->year = $exp[0];
$c->month = $exp[1];
} else {
$c->year = date("Y");
$c->month = date("m");
}
if ($_SESSION['cal_dashlet']['act_status'])
$c->act_status = $_SESSION['cal_dashlet']['act_status'];
else
$c->act_status = "All";
if ($_SESSION['cal_dashlet']['act_user'])
$c->act_user = $_SESSION['cal_dashlet']['act_user'];
else
$c->act_user = "All";
if ($_SESSION['cal_dashlet']['act_type'])
$c->act_type = $_SESSION['cal_dashlet']['act_type'];
else
$c->act_type = "All";
if ($_REQUEST['act_status'])
$c->act_status = $_SESSION['cal_dashlet']['act_status'] = $_REQUEST['act_status'];
if ($_REQUEST['act_user'])
$c->act_user = $_SESSION['cal_dashlet']['act_user'] = $_REQUEST['act_user'];
if ($_REQUEST['act_type'])
$c->act_type = $_SESSION['cal_dashlet']['act_type'] = $_REQUEST['act_type'];
$dashletDefs = $current_user->getPreference('dashlets', 'Home');
$dashletDefs[$_SESSION['calendar_dashlet_id']]['options'] = array('act_user' => $c->act_user, 'act_status' => $c->act_status, 'act_type' => $c->act_type);
$current_user->setPreference('dashlets', $dashletDefs, 0, 'Home');
echo $c->showTableMiniCalendar($c->month, $c->year, 1);
?>

View File

@@ -0,0 +1,130 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*****************************************************************************
* The contents of this file are subject to the RECIPROCAL PUBLIC LICENSE
* Version 1.1 ("License"); You may not use this file except in compliance
* with the License. You may obtain a copy of the License at
* http://opensource.org/licenses/rpl.php. Software distributed under the
* License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
* either express or implied.
*
* You may:
* a) Use and distribute this code exactly as you received without payment or
* a royalty or other fee.
* b) Create extensions for this code, provided that you make the extensions
* publicly available and document your modifications clearly.
* c) Charge for a fee for warranty or support or for accepting liability
* obligations for your customers.
*
* You may NOT:
* a) Charge for the use of the original code or extensions, including in
* electronic distribution models, such as ASP (Application Service
* Provider).
* b) Charge for the original source code or your extensions other than a
* nominal fee to cover distribution costs where such distribution
* involves PHYSICAL media.
* c) Modify or delete any pre-existing copyright notices, change notices,
* or License text in the Licensed Software
* d) Assert any patent claims against the Licensor or Contributors, or
* which would in any way restrict the ability of any third party to use the
* Licensed Software.
*
* You must:
* a) Document any modifications you make to this code including the nature of
* the change, the authors of the change, and the date of the change.
* b) Make the source code for any extensions you deploy available via an
* Electronic Distribution Mechanism such as FTP or HTTP download.
* c) Notify the licensor of the availability of source code to your extensions
* and include instructions on how to acquire the source code and updates.
* d) Grant Licensor a world-wide, non-exclusive, royalty-free license to use,
* reproduce, perform, modify, sublicense, and distribute your extensions.
*
* The Original Code is: CommuniCore
* Olavo Farias
* 2006-04-7 olavo.farias@gmail.com
*
* The Initial Developer of the Original Code is CommuniCore.
* Portions created by CommuniCore are Copyright (C) 2005 CommuniCore Ltda
* All Rights Reserved.
********************************************************************************/
require_once('XTemplate/xtpl.php');
require_once("data/Tracker.php");
require_once("include/ListView/ListView.php");
global $app_strings;
global $current_language;
$current_module_strings = return_module_language($current_language, 'EcmCalendars');
$header_text = '';
global $currentModule;
global $theme;
global $focus;
global $action;
$theme_path="themes/".$theme."/";
$image_path=$theme_path."images/";
require_once($theme_path.'layout_utils.php');
///////////////////////////////////////
/// SETUP PARENT POPUP
$popup_request_data = array(
'call_back_function' => 'set_return_and_save',
'form_name' => 'DetailView',
'field_to_name_array' => array(
'id' => 'ecmcalendar_id',
),
);
$json = getJSONobj();
$encoded_popup_request_data = $json->encode($popup_request_data);
///
///////////////////////////////////////
// FOCUS_LIST IS THE MEANS OF PASSING DATA TO A SUBPANELVIEW.
global $focus_list;
$button = "<form action='index.php' method='post' name='form' id='form'>\n";
$button .= "<input type='hidden' name='module' value='EcmCalendars'>\n";
if ($currentModule == 'Accounts') {
$button .= "<input type='hidden' name='account_id' value='$focus->id'>\n";
$button .= "<input type='hidden' name='account_name' value='$focus->name'>\n";
}elseif ($currentModule == 'Contacts') {
$button .= "<input type='hidden' name='account_id' value='$focus->account_id'>\n";
$button .= "<input type='hidden' name='account_name' value='$focus->account_name'>\n";
$button .= "<input type='hidden' name='contact_id' value='$focus->id'>\n";
}elseif ($currentModule == 'Cases') {
$button .= "<input type='hidden' name='case_id' value='$focus->id'>\n";
}
$button .= "<input type='hidden' name='return_module' value='".$currentModule."'>\n";
$button .= "<input type='hidden' name='return_action' value='".$action."'>\n";
$button .= "<input type='hidden' name='return_id' value='".$focus->id."'>\n";
$button .= "<input type='hidden' name='action'>\n";
$button .= "<input title='".$app_strings['LBL_NEW_BUTTON_TITLE']
."' accessKey='".$app_strings['LBL_NEW_BUTTON_KEY']
."' class='button' onclick=\"this.form.action.value='EditView'\" type='submit' name='New' value=' "
.$app_strings['LBL_NEW_BUTTON_LABEL']." '>\n";
$button .= "<input title='".$app_strings['LBL_SELECT_BUTTON_TITLE']."' accessKey='"
.$app_strings['LBL_SELECT_BUTTON_KEY']."' type='button' class='button' value=' "
.$app_strings['LBL_SELECT_BUTTON_LABEL']
." ' name='button' onclick='open_popup(\"EcmCalendars\", 600, 400, \"\", false, true, {$encoded_popup_request_data});'>\n";
$button .= "</form>\n";
$ListView = new ListView();
$ListView->initNewXTemplate( 'modules/EcmCalendars/SubPanelView.html',$current_module_strings);
$ListView->xTemplateAssign("RETURN_URL", "&return_module=".$currentModule."&return_action=DetailView&return_id={$_REQUEST['record']}");
$ListView->xTemplateAssign("EDIT_INLINE_PNG", get_image($image_path.'edit_inline', 'align="absmiddle" alt="'.$app_strings['LNK_EDIT'] .'" border="0"'));
$ListView->xTemplateAssign("DELETE_INLINE_PNG", get_image($image_path.'delete_inline','align="absmiddle" alt="'.$app_strings['LNK_REMOVE'].'" border="0"'));
if(is_admin($current_user) && $_REQUEST['module'] != 'DynamicLayout' && !empty($_SESSION['editinplace'])){
$header_text = "&nbsp;<a href='index.php?action=index&module=DynamicLayout&from_action=SubPanelView&from_module=EcmCalendars&record="
.$_REQUEST['record']."'>"
.get_image($image_path."EditLayout","border='0' alt='Edit Layout' align='bottom'")
."</a>";
}
$ListView->setHeaderTitle($current_module_strings['LBL_MODULE_NAME'] . $header_text );
$ListView->setHeaderText($button);
$ListView->processListView($focus_list, "main", "ECMCALENDAR");
?>

View File

@@ -0,0 +1,75 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*****************************************************************************
* The contents of this file are subject to the RECIPROCAL PUBLIC LICENSE
* Version 1.1 ("License"); You may not use this file except in compliance
* with the License. You may obtain a copy of the License at
* http://opensource.org/licenses/rpl.php. Software distributed under the
* License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
* either express or implied.
*
* You may:
* a) Use and distribute this code exactly as you received without payment or
* a royalty or other fee.
* b) Create extensions for this code, provided that you make the extensions
* publicly available and document your modifications clearly.
* c) Charge for a fee for warranty or support or for accepting liability
* obligations for your customers.
*
* You may NOT:
* a) Charge for the use of the original code or extensions, including in
* electronic distribution models, such as ASP (Application Service
* Provider).
* b) Charge for the original source code or your extensions other than a
* nominal fee to cover distribution costs where such distribution
* involves PHYSICAL media.
* c) Modify or delete any pre-existing copyright notices, change notices,
* or License text in the Licensed Software
* d) Assert any patent claims against the Licensor or Contributors, or
* which would in any way restrict the ability of any third party to use the
* Licensed Software.
*
* You must:
* a) Document any modifications you make to this code including the nature of
* the change, the authors of the change, and the date of the change.
* b) Make the source code for any extensions you deploy available via an
* Electronic Distribution Mechanism such as FTP or HTTP download.
* c) Notify the licensor of the availability of source code to your extensions
* and include instructions on how to acquire the source code and updates.
* d) Grant Licensor a world-wide, non-exclusive, royalty-free license to use,
* reproduce, perform, modify, sublicense, and distribute your extensions.
*
* The Original Code is: CommuniCore
* Olavo Farias
* 2006-04-7 olavo.farias@gmail.com
*
* The Initial Developer of the Original Code is CommuniCore.
* Portions created by CommuniCore are Copyright (C) 2005 CommuniCore Ltda
* All Rights Reserved.
********************************************************************************/
$fields_array['EcmCalendar'] = array (
'column_fields' => Array(
"id",
"name",
"date_entered",
"date_modified",
"modified_user_id",
"assigned_user_id",
"created_by",
//NEW COLUMN FIELDS
"description",
),
'list_fields' => Array(
'id',
'name',
'assigned_user_name',
'assigned_user_id',
//NEW LIST_FIELDS
'description',
),
'required_fields' => array(
'name'=>1
),
);
?>

109
modules/EcmCalendars/index.php Executable file
View File

@@ -0,0 +1,109 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*****************************************************************************
* The contents of this file are subject to the RECIPROCAL PUBLIC LICENSE
* Version 1.1 ("License"); You may not use this file except in compliance
* with the License. You may obtain a copy of the License at
* http://opensource.org/licenses/rpl.php. Software distributed under the
* License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
* either express or implied.
*
* You may:
* a) Use and distribute this code exactly as you received without payment or
* a royalty or other fee.
* b) Create extensions for this code, provided that you make the extensions
* publicly available and document your modifications clearly.
* c) Charge for a fee for warranty or support or for accepting liability
* obligations for your customers.
*
* You may NOT:
* a) Charge for the use of the original code or extensions, including in
* electronic distribution models, such as ASP (Application Service
* Provider).
* b) Charge for the original source code or your extensions other than a
* nominal fee to cover distribution costs where such distribution
* involves PHYSICAL media.
* c) Modify or delete any pre-existing copyright notices, change notices,
* or License text in the Licensed Software
* d) Assert any patent claims against the Licensor or Contributors, or
* which would in any way restrict the ability of any third party to use the
* Licensed Software.
*
* You must:
* a) Document any modifications you make to this code including the nature of
* the change, the authors of the change, and the date of the change.
* b) Make the source code for any extensions you deploy available via an
* Electronic Distribution Mechanism such as FTP or HTTP download.
* c) Notify the licensor of the availability of source code to your extensions
* and include instructions on how to acquire the source code and updates.
* d) Grant Licensor a world-wide, non-exclusive, royalty-free license to use,
* reproduce, perform, modify, sublicense, and distribute your extensions.
*
* The Original Code is: CommuniCore
* Olavo Farias
* 2006-04-7 olavo.farias@gmail.com
*
* The Initial Developer of the Original Code is CommuniCore.
* Portions created by CommuniCore are Copyright (C) 2005 CommuniCore Ltda
* All Rights Reserved.
********************************************************************************/
global $theme;
$theme_path="themes/".$theme."/";
$image_path=$theme_path."images/";
require_once ($theme_path."layout_utils.php");
global $mod_strings;
require_once('modules/EcmCalendars/Calendar.php');
$minical=new Calendar();
if($_REQUEST['date'])
{
$exp=explode("-",$_REQUEST['date']);
$minical->year=$_SESSION['ecmcalendar']['y']=$exp[0];
$minical->month=$_SESSION['ecmcalendar']['m']=$exp[1];
$minical->day=$_SESSION['ecmcalendar']['d']=$exp[2];
}
else
{
if($_SESSION['ecmcalendar'])
{
$minical->year=$_SESSION['ecmcalendar']['y'];
$minical->month=$_SESSION['ecmcalendar']['m'];
$minical->day=$_SESSION['ecmcalendar']['d'];
}
else
{
$minical->year=$_SESSION['ecmcalendar']['y']=date("Y");
$minical->month=$_SESSION['ecmcalendar']['m']=date("m");
$minical->day=$_SESSION['ecmcalendar']['d']=date("d");
}
}
if($_SESSION['cal_dashlet']['act_status'])$minical->act_status=$_SESSION['cal_dashlet']['act_status'];
else $minical->act_status="All";
if($_SESSION['cal_dashlet']['act_user'])$minical->act_user=$_SESSION['cal_dashlet']['act_user'];
else $minical->act_user="All";
if($_SESSION['cal_dashlet']['act_type'])$minical->act_type=$_SESSION['cal_dashlet']['act_type'];
else $minical->act_type="All";
echo '<link href="modules/EcmCalendars/style.css" rel="stylesheet" type="text/css">';
echo '<script language="javascript" src="modules/EcmCalendars/helper.js"></script>';
echo '<script language="javascript" src="modules/EcmCalendars/mintajax.js"></script>';
echo '<script language="javascript" src="modules/EcmCalendars/Calendar.js"></script>';
//echo '<script language="javascript">document.getElementById("leftCol").style.display="none";</script>';
echo '<table cellspacing="0" cellpadding="0" border="0" width="99%">';
echo '<tr>';
echo '<td width="70%">';
echo '<div class="divTableDay">';
echo '<div id="navDay">';
echo $minical->showNavDay();
echo '</div>';
echo '<iframe id="calendar" style="border:none;width:100%;height:500px;" frameborder="no" src="index.php?to_pdf=1&module=EcmCalendars&action=ShowBigCalendar&date='.$_REQUEST['date'].'">Yours browser not accept iframes!</iframe>';
echo '</div>';
echo '</td>';
echo '<td width="30%">';
echo '<div class="divTableDay" style="width:100%;height:530px;" id="mini_calendar">';
echo $minical->showTableMiniCalendar($minical->month,$minical->year,$minical->day);
echo '</div>';
echo '</td>';
echo '</tt>';
echo '</table>';
?>

View File

@@ -0,0 +1,169 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*****************************************************************************
* The contents of this file are subject to the RECIPROCAL PUBLIC LICENSE
* Version 1.1 ("License"); You may not use this file except in compliance
* with the License. You may obtain a copy of the License at
* http://opensource.org/licenses/rpl.php. Software distributed under the
* License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
* either express or implied.
*
* You may:
* a) Use and distribute this code exactly as you received without payment or
* a royalty or other fee.
* b) Create extensions for this code, provided that you make the extensions
* publicly available and document your modifications clearly.
* c) Charge for a fee for warranty or support or for accepting liability
* obligations for your customers.
*
* You may NOT:
* a) Charge for the use of the original code or extensions, including in
* electronic distribution models, such as ASP (Application Service
* Provider).
* b) Charge for the original source code or your extensions other than a
* nominal fee to cover distribution costs where such distribution
* involves PHYSICAL media.
* c) Modify or delete any pre-existing copyright notices, change notices,
* or License text in the Licensed Software
* d) Assert any patent claims against the Licensor or Contributors, or
* which would in any way restrict the ability of any third party to use the
* Licensed Software.
*
* You must:
* a) Document any modifications you make to this code including the nature of
* the change, the authors of the change, and the date of the change.
* b) Make the source code for any extensions you deploy available via an
* Electronic Distribution Mechanism such as FTP or HTTP download.
* c) Notify the licensor of the availability of source code to your extensions
* and include instructions on how to acquire the source code and updates.
* d) Grant Licensor a world-wide, non-exclusive, royalty-free license to use,
* reproduce, perform, modify, sublicense, and distribute your extensions.
*
* The Original Code is: CommuniCore
* Olavo Farias
* 2006-04-7 olavo.farias@gmail.com
*
* The Initial Developer of the Original Code is CommuniCore.
* Portions created by CommuniCore are Copyright (C) 2005 CommuniCore Ltda
* All Rights Reserved.
********************************************************************************/
$mod_strings = array (
//added 09.12.2008
'LBL_CALLS' => 'Calls',
'LBL_MEETINGS' => 'Meetings',
'LBL_TASKS' => 'Tasks',
'LBL_ALL' => 'All',
'LBL_PLANNED' => 'Planned',
'LBL_HELD' => 'Held',
'LBL_NOT_HELD' => 'Not Held',
'LBL_STATUS' => 'Status',
'LBL_USER' => 'User',
'LBL_MONDAY' => 'Monday',
'LBL_TUESDAY' => 'Tuesday',
'LBL_WEDNESDAY' => 'Wednesday',
'LBL_THURSDAY' => 'Thursday',
'LBL_FRIDAY' => 'Friday',
'LBL_SATURDAY' => 'Saturday',
'LBL_SUNDAY' => 'Sunday',
'LBL_SHORT_MONDAY' => 'Mon',
'LBL_SHORT_TUESDAY' => 'Tue',
'LBL_SHORT_WEDNESDAY' => 'Wed',
'LBL_SHORT_THURSDAY' => 'Thu',
'LBL_SHORT_FRIDAY' => 'Fri',
'LBL_SHORT_SATURDAY' => 'Sat',
'LBL_SHORT_SUNDAY' => 'Sun',
'LBL_JANUARY' => 'January',
'LBL_FEBRUARY' => 'February',
'LBL_MARCH' => 'March',
'LBL_APRIL' => 'April',
'LBL_MAY' => 'May',
'LBL_JUNE' => 'June',
'LBL_JULY' => 'July',
'LBL_AUGUST' => 'August',
'LBL_SEPTEMBER' => 'September',
'LBL_OCTOBER' => 'October',
'LBL_NOVEMBER' => 'November',
'LBL_DECEMBER' => 'December',
'LBL_WEEK' => 'Week',
'LBL_ACTIVITIES' => 'Activities',
//added
'LNK_NEW_CALL' => 'Schedule Call',
'LNK_NEW_MEETING' => 'Schedule Meeting',
'LNK_NEW_APPOINTMENT' => 'Create Appointment',
'LNK_NEW_TASK' => 'Create Task',
'LNK_CALL_LIST' => 'Calls',
'LNK_MEETING_LIST' => 'Meetings',
'LNK_TASK_LIST' => 'Tasks',
// FOR SYSTEM USE
'LBL_MODULE_NAME' => 'EcmCalendars',
'LBL_MODULE_TITLE' => 'EcmCalendars: Home',
'LBL_MODULE_ID' => 'EcmCalendars',
'LBL_SEARCH_FORM_TITLE' => 'EcmCalendars Search',
'LBL_LIST_FORM_TITLE' => 'EcmCalendars List',
'LBL_NEW_FORM_TITLE' => 'New EcmCalendars',
'LBL_ECMCALENDARS' => 'EcmCalendars:',
'LBL_ECMCALENDARS_SUBJECT' => 'EcmCalendars Subject:',
'LBL_SYSTEM_ID' => 'System ID',
// FOR LIST VIEW
'LBL_LIST_NAME' => 'Name',
'LBL_LIST_SUBJECT' => 'Subject',
'LBL_LIST_LAST_MODIFIED' => 'Last Modified',
'LBL_LIST_MY_ECMCALENDARS' => 'My Assigned EcmCalendars',
'LBL_LIST_ASSIGNED_TO_NAME' => 'Assigned User',
'LBL_LIST_DESCRIPTION' => 'Description',
// FOR NOTIFICATION POPUPS
'NTC_DELETE_CONFIRMATION' => 'Are you sure you want to remove this ecmcalendar from this EcmCalendar?',
'NTC_REMOVE_INVITEE' => 'Are you sure you want to remove this contact from the EcmCalendar?',
'NTC_REMOVE_ACCOUNT_CONFIRMATION' => 'Are you sure you want to remove this ecmcalendar from this account?',
'ERR_DELETE_RECORD' => 'A record number must be specified to delete the ecmcalendar.',
// FOR DEFAULT FIELDS
'LBL_NAME' => 'Name:',
'LBL_SUBJECT' => 'Name:',
'LBL_CREATED_BY' => 'Created by:',
'LBL_CREATED' => 'Created by:',
'LBL_ASSIGNED_TO' => 'Assigned to:',
'LBL_ASSIGNED_USER_ID' => 'Assigned To:',
'LBL_DATE_ENTERED' => 'Date Created:',
'LBL_DATE_CREATED' => 'Create Date:',
'LBL_DATE_MODIFIED' => 'Last Modified',
'LBL_MODIFIED_BY' => 'Last Modified by:',
'LBL_MODIFIED' => 'Modified by:',
'LBL_DATE_LAST_MODIFIED' => 'Modify Date:',
// FOR NEW FIELDS
'LBL_DESCRIPTION' => 'Description',
// FOR GROUPS
'LBL_GROUP_MASTER' => 'ECMCALENDAR INFORMATION',
'LBL_GROUP_DESCRIPTION' => '',
// FOR SUBPANELS
'LBL_ECMCALENDARS_SUBPANEL_TITLE' => 'EcmCalendars',
'LBL_ACTIVITIES_SUBPANEL_TITLE' => 'Activities',
'LBL_HISTORY_SUBPANEL_TITLE' => 'History',
'LBL_ECMCALENDARS' => 'EcmCalendars',
// FOR MENU LABELS
'LNK_NEW_ECMCALENDARS' => 'Create EcmCalendar',
'LNK_LIST_ECMCALENDAR' => 'EcmCalendars List',
// FOR MENU LINKS
'LNK_NEW_ECMCALENDAR' => 'Create EcmCalendars',
'LNK_ECMCALENDARS_LIST' => 'EcmCalendars',
'LNK_ECMCALENDARS_REPORTS' => 'EcmCalendars Reports',
// FOR ADDITIONAL MENUS
// FOR DASHLETS
'LBL_LIST_ECMCALENDARS' => 'EcmCalendars',
);
?>

View File

@@ -0,0 +1,169 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*****************************************************************************
* The contents of this file are subject to the RECIPROCAL PUBLIC LICENSE
* Version 1.1 ("License"); You may not use this file except in compliance
* with the License. You may obtain a copy of the License at
* http://opensource.org/licenses/rpl.php. Software distributed under the
* License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
* either express or implied.
*
* You may:
* a) Use and distribute this code exactly as you received without payment or
* a royalty or other fee.
* b) Create extensions for this code, provided that you make the extensions
* publicly available and document your modifications clearly.
* c) Charge for a fee for warranty or support or for accepting liability
* obligations for your customers.
*
* You may NOT:
* a) Charge for the use of the original code or extensions, including in
* electronic distribution models, such as ASP (Application Service
* Provider).
* b) Charge for the original source code or your extensions other than a
* nominal fee to cover distribution costs where such distribution
* involves PHYSICAL media.
* c) Modify or delete any pre-existing copyright notices, change notices,
* or License text in the Licensed Software
* d) Assert any patent claims against the Licensor or Contributors, or
* which would in any way restrict the ability of any third party to use the
* Licensed Software.
*
* You must:
* a) Document any modifications you make to this code including the nature of
* the change, the authors of the change, and the date of the change.
* b) Make the source code for any extensions you deploy available via an
* Electronic Distribution Mechanism such as FTP or HTTP download.
* c) Notify the licensor of the availability of source code to your extensions
* and include instructions on how to acquire the source code and updates.
* d) Grant Licensor a world-wide, non-exclusive, royalty-free license to use,
* reproduce, perform, modify, sublicense, and distribute your extensions.
*
* The Original Code is: CommuniCore
* Olavo Farias
* 2006-04-7 olavo.farias@gmail.com
*
* The Initial Developer of the Original Code is CommuniCore.
* Portions created by CommuniCore are Copyright (C) 2005 CommuniCore Ltda
* All Rights Reserved.
********************************************************************************/
$mod_strings = array (
//added 09.12.2008
'LBL_CALLS' => 'Calls',
'LBL_MEETINGS' => 'Meetings',
'LBL_TASKS' => 'Tasks',
'LBL_ALL' => 'All',
'LBL_PLANNED' => 'Planned',
'LBL_HELD' => 'Held',
'LBL_NOT_HELD' => 'Not Held',
'LBL_STATUS' => 'Status',
'LBL_USER' => 'User',
'LBL_MONDAY' => 'Monday',
'LBL_TUESDAY' => 'Tuesday',
'LBL_WEDNESDAY' => 'Wednesday',
'LBL_THURSDAY' => 'Thursday',
'LBL_FRIDAY' => 'Friday',
'LBL_SATURDAY' => 'Saturday',
'LBL_SUNDAY' => 'Sunday',
'LBL_SHORT_MONDAY' => 'Mon',
'LBL_SHORT_TUESDAY' => 'Tue',
'LBL_SHORT_WEDNESDAY' => 'Wed',
'LBL_SHORT_THURSDAY' => 'Thu',
'LBL_SHORT_FRIDAY' => 'Fri',
'LBL_SHORT_SATURDAY' => 'Sat',
'LBL_SHORT_SUNDAY' => 'Sun',
'LBL_JANUARY' => 'January',
'LBL_FEBRUARY' => 'February',
'LBL_MARCH' => 'March',
'LBL_APRIL' => 'April',
'LBL_MAY' => 'May',
'LBL_JUNE' => 'June',
'LBL_JULY' => 'July',
'LBL_AUGUST' => 'August',
'LBL_SEPTEMBER' => 'September',
'LBL_OCTOBER' => 'October',
'LBL_NOVEMBER' => 'November',
'LBL_DECEMBER' => 'December',
'LBL_WEEK' => 'Week',
'LBL_ACTIVITIES' => 'Activities',
//added
'LNK_NEW_CALL' => 'Schedule Call',
'LNK_NEW_MEETING' => 'Schedule Meeting',
'LNK_NEW_APPOINTMENT' => 'Create Appointment',
'LNK_NEW_TASK' => 'Create Task',
'LNK_CALL_LIST' => 'Calls',
'LNK_MEETING_LIST' => 'Meetings',
'LNK_TASK_LIST' => 'Tasks',
// FOR SYSTEM USE
'LBL_MODULE_NAME' => 'EcmCalendars',
'LBL_MODULE_TITLE' => 'EcmCalendars: Home',
'LBL_MODULE_ID' => 'EcmCalendars',
'LBL_SEARCH_FORM_TITLE' => 'EcmCalendars Search',
'LBL_LIST_FORM_TITLE' => 'EcmCalendars List',
'LBL_NEW_FORM_TITLE' => 'New EcmCalendars',
'LBL_ECMCALENDARS' => 'EcmCalendars:',
'LBL_ECMCALENDARS_SUBJECT' => 'EcmCalendars Subject:',
'LBL_SYSTEM_ID' => 'System ID',
// FOR LIST VIEW
'LBL_LIST_NAME' => 'Name',
'LBL_LIST_SUBJECT' => 'Subject',
'LBL_LIST_LAST_MODIFIED' => 'Last Modified',
'LBL_LIST_MY_ECMCALENDARS' => 'My Assigned EcmCalendars',
'LBL_LIST_ASSIGNED_TO_NAME' => 'Assigned User',
'LBL_LIST_DESCRIPTION' => 'Description',
// FOR NOTIFICATION POPUPS
'NTC_DELETE_CONFIRMATION' => 'Are you sure you want to remove this ecmcalendar from this EcmCalendar?',
'NTC_REMOVE_INVITEE' => 'Are you sure you want to remove this contact from the EcmCalendar?',
'NTC_REMOVE_ACCOUNT_CONFIRMATION' => 'Are you sure you want to remove this ecmcalendar from this account?',
'ERR_DELETE_RECORD' => 'A record number must be specified to delete the ecmcalendar.',
// FOR DEFAULT FIELDS
'LBL_NAME' => 'Name:',
'LBL_SUBJECT' => 'Name:',
'LBL_CREATED_BY' => 'Created by:',
'LBL_CREATED' => 'Created by:',
'LBL_ASSIGNED_TO' => 'Assigned to:',
'LBL_ASSIGNED_USER_ID' => 'Assigned To:',
'LBL_DATE_ENTERED' => 'Date Created:',
'LBL_DATE_CREATED' => 'Create Date:',
'LBL_DATE_MODIFIED' => 'Last Modified',
'LBL_MODIFIED_BY' => 'Last Modified by:',
'LBL_MODIFIED' => 'Modified by:',
'LBL_DATE_LAST_MODIFIED' => 'Modify Date:',
// FOR NEW FIELDS
'LBL_DESCRIPTION' => 'Description',
// FOR GROUPS
'LBL_GROUP_MASTER' => 'ECMCALENDAR INFORMATION',
'LBL_GROUP_DESCRIPTION' => '',
// FOR SUBPANELS
'LBL_ECMCALENDARS_SUBPANEL_TITLE' => 'EcmCalendars',
'LBL_ACTIVITIES_SUBPANEL_TITLE' => 'Activities',
'LBL_HISTORY_SUBPANEL_TITLE' => 'History',
'LBL_ECMCALENDARS' => 'EcmCalendars',
// FOR MENU LABELS
'LNK_NEW_ECMCALENDARS' => 'Create EcmCalendar',
'LNK_LIST_ECMCALENDAR' => 'EcmCalendars List',
// FOR MENU LINKS
'LNK_NEW_ECMCALENDAR' => 'Create EcmCalendars',
'LNK_ECMCALENDARS_LIST' => 'EcmCalendars',
'LNK_ECMCALENDARS_REPORTS' => 'EcmCalendars Reports',
// FOR ADDITIONAL MENUS
// FOR DASHLETS
'LBL_LIST_ECMCALENDARS' => 'EcmCalendars',
);
?>

View File

@@ -0,0 +1,258 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*****************************************************************************
* The contents of this file are subject to the RECIPROCAL PUBLIC LICENSE
* Version 1.1 ("License"); You may not use this file except in compliance
* with the License. You may obtain a copy of the License at
* http://opensource.org/licenses/rpl.php. Software distributed under the
* License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
* either express or implied.
*
* You may:
* a) Use and distribute this code exactly as you received without payment or
* a royalty or other fee.
* b) Create extensions for this code, provided that you make the extensions
* publicly available and document your modifications clearly.
* c) Charge for a fee for warranty or support or for accepting liability
* obligations for your customers.
*
* You may NOT:
* a) Charge for the use of the original code or extensions, including in
* electronic distribution models, such as ASP (Application Service
* Provider).
* b) Charge for the original source code or your extensions other than a
* nominal fee to cover distribution costs where such distribution
* involves PHYSICAL media.
* c) Modify or delete any pre-existing copyright notices, change notices,
* or License text in the Licensed Software
* d) Assert any patent claims against the Licensor or Contributors, or
* which would in any way restrict the ability of any third party to use the
* Licensed Software.
*
* You must:
* a) Document any modifications you make to this code including the nature of
* the change, the authors of the change, and the date of the change.
* b) Make the source code for any extensions you deploy available via an
* Electronic Distribution Mechanism such as FTP or HTTP download.
* c) Notify the licensor of the availability of source code to your extensions
* and include instructions on how to acquire the source code and updates.
* d) Grant Licensor a world-wide, non-exclusive, royalty-free license to use,
* reproduce, perform, modify, sublicense, and distribute your extensions.
*
* The Original Code is: CommuniCore
* Olavo Farias
* 2006-04-7 olavo.farias@gmail.com
*
* The Initial Developer of the Original Code is CommuniCore.
* Portions created by CommuniCore are Copyright (C) 2005 CommuniCore Ltda
* All Rights Reserved.
********************************************************************************/
$mod_strings = array (
//added 09.12.2008
'LBL_CALLS' => 'Telefony',
'LBL_MEETINGS' => 'Spotkania',
'LBL_TASKS' => 'Zadania',
'LBL_ALL' => 'Wszystkie',
'LBL_PLANNED' => 'Zaplanowane',
'LBL_HELD' => 'Zakończone',
'LBL_NOT_HELD' => 'Niezakończone',
'LBL_STATUS' => 'Status',
'LBL_USER' => 'Użytkownik',
'LBL_MONDAY' => 'Poniedziałek',
'LBL_TUESDAY' => 'Wtorek',
'LBL_WEDNESDAY' => 'Środa',
'LBL_THURSDAY' => 'Czwartek',
'LBL_FRIDAY' => 'Piątek',
'LBL_SATURDAY' => 'Sobota',
'LBL_SUNDAY' => 'Niedziela',
'LBL_SHORT_MONDAY' => 'Pon',
'LBL_SHORT_TUESDAY' => 'Wto',
'LBL_SHORT_WEDNESDAY' => 'Śro',
'LBL_SHORT_THURSDAY' => 'Czw',
'LBL_SHORT_FRIDAY' => 'Pią',
'LBL_SHORT_SATURDAY' => 'Sob',
'LBL_SHORT_SUNDAY' => 'Nie',
'LBL_JANUARY' => 'Styczeń',
'LBL_FEBRUARY' => 'Luty',
'LBL_MARCH' => 'Marzec',
'LBL_APRIL' => 'Kwiecień',
'LBL_MAY' => 'Maj',
'LBL_JUNE' => 'Czerwiec',
'LBL_JULY' => 'Lipiec',
'LBL_AUGUST' => 'Sierpień',
'LBL_SEPTEMBER' => 'Wrzesień',
'LBL_OCTOBER' => 'Październik',
'LBL_NOVEMBER' => 'Listopad',
'LBL_DECEMBER' => 'Grudzień',
'LBL_WEEK' => 'Tydzień',
'LBL_ACTIVITIES' => 'Aktywności',
//added
'LNK_NEW_CALL' => 'Schedule Call',
'LNK_NEW_MEETING' => 'Schedule Meeting',
'LNK_NEW_APPOINTMENT' => 'Create Appointment',
'LNK_NEW_TASK' => 'Create Task',
'LNK_CALL_LIST' => 'Calls',
'LNK_MEETING_LIST' => 'Meetings',
'LNK_TASK_LIST' => 'Tasks',
// FOR SYSTEM USE
'LBL_MODULE_NAME' => 'Kalendarz',
'LBL_MODULE_TITLE' => 'Kalendarz: Home',
'LBL_MODULE_ID' => 'Kalendarz',
'LBL_SEARCH_FORM_TITLE' => 'Kalendarz Search',
'LBL_LIST_FORM_TITLE' => 'Kalendarz List',
'LBL_NEW_FORM_TITLE' => 'New Kalendarz',
'LBL_ECMCALENDARS' => 'Kalendarz:',
'LBL_ECMCALENDARS_SUBJECT' => 'Kalendarz Subject:',
'LBL_SYSTEM_ID' => 'System ID',
// FOR LIST VIEW
'LBL_LIST_NAME' => 'Name',
'LBL_LIST_SUBJECT' => 'Subject',
'LBL_LIST_LAST_MODIFIED' => 'Last Modified',
'LBL_LIST_MY_ECMCALENDARS' => 'My Assigned Kalendarz',
'LBL_LIST_ASSIGNED_TO_NAME' => 'Assigned User',
'LBL_LIST_DESCRIPTION' => 'Description',
// FOR NOTIFICATION POPUPS
'NTC_DELETE_CONFIRMATION' => 'Are you sure you want to remove this ecmcalendar from this EcmCalendar?',
'NTC_REMOVE_INVITEE' => 'Are you sure you want to remove this contact from the EcmCalendar?',
'NTC_REMOVE_ACCOUNT_CONFIRMATION' => 'Are you sure you want to remove this ecmcalendar from this account?',
'ERR_DELETE_RECORD' => 'A record number must be specified to delete the ecmcalendar.',
// FOR DEFAULT FIELDS
'LBL_NAME' => 'Name:',
'LBL_SUBJECT' => 'Name:',
'LBL_CREATED_BY' => 'Created by:',
'LBL_CREATED' => 'Created by:',
'LBL_ASSIGNED_TO' => 'Assigned to:',
'LBL_ASSIGNED_USER_ID' => 'Assigned To:',
'LBL_DATE_ENTERED' => 'Date Created:',
'LBL_DATE_CREATED' => 'Create Date:',
'LBL_DATE_MODIFIED' => 'Last Modified',
'LBL_MODIFIED_BY' => 'Last Modified by:',
'LBL_MODIFIED' => 'Modified by:',
'LBL_DATE_LAST_MODIFIED' => 'Modify Date:',
// FOR NEW FIELDS
'LBL_DESCRIPTION' => 'Description',
// FOR GROUPS
'LBL_GROUP_MASTER' => 'ECMCALENDAR INFORMATION',
'LBL_GROUP_DESCRIPTION' => '',
// FOR SUBPANELS
'LBL_ECMCALENDARS_SUBPANEL_TITLE' => 'Kalendarz',
'LBL_ACTIVITIES_SUBPANEL_TITLE' => 'Activities',
'LBL_HISTORY_SUBPANEL_TITLE' => 'History',
'LBL_ECMCALENDARS' => 'Kalendarz',
// FOR MENU LABELS
'LNK_NEW_ECMCALENDARS' => 'Create EcmCalendar',
'LNK_LIST_ECMCALENDAR' => 'Kalendarz List',
// FOR MENU LINKS
'LNK_NEW_ECMCALENDAR' => 'Create Kalendarz',
'LNK_ECMCALENDARS_LIST' => 'Kalendarz',
'LNK_ECMCALENDARS_REPORTS' => 'Kalendarz Reports',
// FOR ADDITIONAL MENUS
// FOR DASHLETS
'LBL_LIST_ECMCALENDARS' => 'Kalendarz',
'LBL_CALLS' => 'Rozmowy telefoniczne',
'LBL_MEETINGS' => 'Spotkania',
'LBL_TASKS' => 'Zadania',
'LBL_ALL' => 'Wszystko',
'LBL_PLANNED' => 'Zaplanowane',
'LBL_HELD' => 'Wstrzymany',
'LBL_NOT_HELD' => 'Nie wstrzymany',
'LBL_STATUS' => 'Status',
'LBL_USER' => 'Użytkownik',
'LBL_MONDAY' => 'Poniedziałek',
'LBL_TUESDAY' => 'Wtorek',
'LBL_WEDNESDAY' => 'Środa',
'LBL_THURSDAY' => 'Czwartek',
'LBL_FRIDAY' => 'Piątek',
'LBL_SATURDAY' => 'Sobota',
'LBL_SUNDAY' => 'Niedziela',
'LBL_SHORT_MONDAY' => 'Pn',
'LBL_SHORT_TUESDAY' => 'Wt',
'LBL_SHORT_WEDNESDAY' => 'Śr',
'LBL_SHORT_THURSDAY' => 'Czw',
'LBL_SHORT_FRIDAY' => 'Pt',
'LBL_SHORT_SATURDAY' => 'Sob',
'LBL_SHORT_SUNDAY' => 'Niedz',
'LBL_JANUARY' => 'Styczeń',
'LBL_FEBRUARY' => 'Luty',
'LBL_MARCH' => 'Marzec',
'LBL_APRIL' => 'Kwiecień',
'LBL_MAY' => 'Maj',
'LBL_JUNE' => 'Czerwiec',
'LBL_JULY' => 'Lipiec',
'LBL_AUGUST' => 'Sierpień',
'LBL_SEPTEMBER' => 'Wrzesień',
'LBL_OCTOBER' => 'Październik',
'LBL_NOVEMBER' => 'Listopad',
'LBL_DECEMBER' => 'Grudzień',
'LBL_WEEK' => 'Tydzień',
'LBL_ACTIVITIES' => 'Działania',
'LNK_NEW_CALL' => 'Planowane połączenia',
'LNK_NEW_MEETING' => 'Planowane spotkania',
'LNK_NEW_APPOINTMENT' => 'Zaplanuj spotkanie',
'LNK_NEW_TASK' => 'Zaplanuj zadanie',
'LNK_CALL_LIST' => 'Połączenia',
'LNK_MEETING_LIST' => 'Spotkania',
'LNK_TASK_LIST' => 'Zadania',
'LBL_MODULE_NAME' => 'Kalendarz',
'LBL_MODULE_TITLE' => 'Kalendarz: Strona główna',
'LBL_MODULE_ID' => 'Kalendarz',
'LBL_SEARCH_FORM_TITLE' => 'Kalendarz Szukaj',
'LBL_LIST_FORM_TITLE' => 'Kalendarz Lista',
'LBL_NEW_FORM_TITLE' => 'Nowy Kalendarz',
'LBL_ECMCALENDARS' => 'Kalendarz',
'LBL_ECMCALENDARS_SUBJECT' => 'Kalendarz Temat:',
'LBL_SYSTEM_ID' => 'ID Systemu',
'LBL_LIST_NAME' => 'Nazwa',
'LBL_LIST_SUBJECT' => 'Temat',
'LBL_LIST_LAST_MODIFIED' => 'Ostatnio modyfikowany',
'LBL_LIST_MY_ECMCALENDARS' => 'Mój przydzielony Kalendarz',
'LBL_LIST_ASSIGNED_TO_NAME' => 'Przydział użytkownika',
'LBL_LIST_DESCRIPTION' => 'Opis',
'NTC_DELETE_CONFIRMATION' => 'Czy jesteś pewien czy chcesz usunąć ten Kalendarz z Kalendarza?',
'NTC_REMOVE_INVITEE' => 'Czy na pewno chcesz usunąć ten kontakt z Kalendarza?',
'NTC_REMOVE_ACCOUNT_CONFIRMATION' => 'Czy jesteś pewien że chcesz usunąć ten Kalendarz z tego profilu?',
'ERR_DELETE_RECORD' => 'Musisz podać numer pozycji żeby usunąć tan Kalendarz.',
'LBL_NAME' => 'Nazwa:',
'LBL_SUBJECT' => 'Nazwa:',
'LBL_CREATED_BY' => 'Stworzony przez:',
'LBL_CREATED' => 'Stworzony przez:',
'LBL_ASSIGNED_TO' => 'Przypisany do:',
'LBL_ASSIGNED_USER_ID' => 'Przypisany do:',
'LBL_DATE_ENTERED' => 'Data utworzenia:',
'LBL_DATE_CREATED' => 'Data utworzenia:',
'LBL_DATE_MODIFIED' => 'Ostatnio modyfikowany',
'LBL_MODIFIED_BY' => 'Ostatnio modyfikowany przez:',
'LBL_MODIFIED' => 'Modyfikowany przez:',
'LBL_DATE_LAST_MODIFIED' => 'Data modyfikacji:',
'LBL_DESCRIPTION' => 'Opis',
'LBL_GROUP_MASTER' => 'KALENDARZ INFORMACJE',
'LBL_GROUP_DESCRIPTION' => '',
'LBL_ECMCALENDARS_SUBPANEL_TITLE' => 'Kalendarze',
'LBL_ACTIVITIES_SUBPANEL_TITLE' => 'Działania',
'LBL_HISTORY_SUBPANEL_TITLE' => 'Historia',
'LNK_NEW_ECMCALENDARS' => 'Utwórz Kalendarz',
'LNK_LIST_ECMCALENDAR' => 'Kalendars Lista',
'LNK_NEW_ECMCALENDAR' => 'Utwórz Kalendarze',
'LNK_ECMCALENDARS_LIST' => 'Kalendarze',
'LNK_ECMCALENDARS_REPORTS' => 'Kalendarz Raporty',
'LBL_LIST_ECMCALENDARS' => 'Kalendarze',
);
?>

View File

@@ -0,0 +1,57 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*****************************************************************************
* The contents of this file are subject to the RECIPROCAL PUBLIC LICENSE
* Version 1.1 ("License"); You may not use this file except in compliance
* with the License. You may obtain a copy of the License at
* http://opensource.org/licenses/rpl.php. Software distributed under the
* License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
* either express or implied.
*
* You may:
* a) Use and distribute this code exactly as you received without payment or
* a royalty or other fee.
* b) Create extensions for this code, provided that you make the extensions
* publicly available and document your modifications clearly.
* c) Charge for a fee for warranty or support or for accepting liability
* obligations for your customers.
*
* You may NOT:
* a) Charge for the use of the original code or extensions, including in
* electronic distribution models, such as ASP (Application Service
* Provider).
* b) Charge for the original source code or your extensions other than a
* nominal fee to cover distribution costs where such distribution
* involves PHYSICAL media.
* c) Modify or delete any pre-existing copyright notices, change notices,
* or License text in the Licensed Software
* d) Assert any patent claims against the Licensor or Contributors, or
* which would in any way restrict the ability of any third party to use the
* Licensed Software.
*
* You must:
* a) Document any modifications you make to this code including the nature of
* the change, the authors of the change, and the date of the change.
* b) Make the source code for any extensions you deploy available via an
* Electronic Distribution Mechanism such as FTP or HTTP download.
* c) Notify the licensor of the availability of source code to your extensions
* and include instructions on how to acquire the source code and updates.
* d) Grant Licensor a world-wide, non-exclusive, royalty-free license to use,
* reproduce, perform, modify, sublicense, and distribute your extensions.
*
* The Original Code is: CommuniCore
* Olavo Farias
* 2006-04-7 olavo.farias@gmail.com
*
* The Initial Developer of the Original Code is CommuniCore.
* Portions created by CommuniCore are Copyright (C) 2005 CommuniCore Ltda
* All Rights Reserved.
********************************************************************************/
$smarty->debugging = true;
$smarty->debugging_ctrl=($_SERVER['SERVER_NAME']=='localhost:8080')?'URL':'NONE';
$layout_defs['EcmCalendars'] = array(
//LIST OF WHAT SUBPANELS TO SHOW IN THE DETAILVIEW
'subpanel_setup' => array(
),
);
?>

View File

@@ -0,0 +1,79 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*****************************************************************************
* The contents of this file are subject to the RECIPROCAL PUBLIC LICENSE
* Version 1.1 ("License"); You may not use this file except in compliance
* with the License. You may obtain a copy of the License at
* http://opensource.org/licenses/rpl.php. Software distributed under the
* License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
* either express or implied.
*
* You may:
* a) Use and distribute this code exactly as you received without payment or
* a royalty or other fee.
* b) Create extensions for this code, provided that you make the extensions
* publicly available and document your modifications clearly.
* c) Charge for a fee for warranty or support or for accepting liability
* obligations for your customers.
*
* You may NOT:
* a) Charge for the use of the original code or extensions, including in
* electronic distribution models, such as ASP (Application Service
* Provider).
* b) Charge for the original source code or your extensions other than a
* nominal fee to cover distribution costs where such distribution
* involves PHYSICAL media.
* c) Modify or delete any pre-existing copyright notices, change notices,
* or License text in the Licensed Software
* d) Assert any patent claims against the Licensor or Contributors, or
* which would in any way restrict the ability of any third party to use the
* Licensed Software.
*
* You must:
* a) Document any modifications you make to this code including the nature of
* the change, the authors of the change, and the date of the change.
* b) Make the source code for any extensions you deploy available via an
* Electronic Distribution Mechanism such as FTP or HTTP download.
* c) Notify the licensor of the availability of source code to your extensions
* and include instructions on how to acquire the source code and updates.
* d) Grant Licensor a world-wide, non-exclusive, royalty-free license to use,
* reproduce, perform, modify, sublicense, and distribute your extensions.
*
* The Original Code is: CommuniCore
* Olavo Farias
* 2006-04-7 olavo.farias@gmail.com
*
* The Initial Developer of the Original Code is CommuniCore.
* Portions created by CommuniCore are Copyright (C) 2005 CommuniCore Ltda
* All Rights Reserved.
********************************************************************************/
require_once('include/utils.php');
function additionalDetailsEcmCalendar($fields) {
static $mod_strings;
global $app_strings;
if(empty($mod_strings)) {
global $current_language;
$mod_strings = return_module_language($current_language, 'EcmCalendars');
}
$overlib_string = '';
//BUILDER:START overlibstring
if(!empty($fields['DESCRIPTION'])){
$overlib_string .= '<b>'. $mod_strings['LBL_DESCRIPTION'] . '</b> <BR>' . substr($fields['DESCRIPTION'], 0, 300);
if(strlen($fields['DESCRIPTION']) > 300) $overlib_string .= '...';
$overlib_string .= '<br>';
}
//BUILDER:END overlibstring
return array(
'fieldToAddTo' => 'NAME',
'string' => $overlib_string,
'editLink' => "index.php?action=EditView&module=EcmCalendars&return_module=EcmCalendars&record={$fields['ID']}",
'viewLink' => "index.php?action=DetailView&module=EcmCalendars&return_module=EcmCalendars&record={$fields['ID']}");
}
?>

View File

@@ -0,0 +1,79 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*****************************************************************************
* The contents of this file are subject to the RECIPROCAL PUBLIC LICENSE
* Version 1.1 ("License"); You may not use this file except in compliance
* with the License. You may obtain a copy of the License at
* http://opensource.org/licenses/rpl.php. Software distributed under the
* License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
* either express or implied.
*
* You may:
* a) Use and distribute this code exactly as you received without payment or
* a royalty or other fee.
* b) Create extensions for this code, provided that you make the extensions
* publicly available and document your modifications clearly.
* c) Charge for a fee for warranty or support or for accepting liability
* obligations for your customers.
*
* You may NOT:
* a) Charge for the use of the original code or extensions, including in
* electronic distribution models, such as ASP (Application Service
* Provider).
* b) Charge for the original source code or your extensions other than a
* nominal fee to cover distribution costs where such distribution
* involves PHYSICAL media.
* c) Modify or delete any pre-existing copyright notices, change notices,
* or License text in the Licensed Software
* d) Assert any patent claims against the Licensor or Contributors, or
* which would in any way restrict the ability of any third party to use the
* Licensed Software.
*
* You must:
* a) Document any modifications you make to this code including the nature of
* the change, the authors of the change, and the date of the change.
* b) Make the source code for any extensions you deploy available via an
* Electronic Distribution Mechanism such as FTP or HTTP download.
* c) Notify the licensor of the availability of source code to your extensions
* and include instructions on how to acquire the source code and updates.
* d) Grant Licensor a world-wide, non-exclusive, royalty-free license to use,
* reproduce, perform, modify, sublicense, and distribute your extensions.
*
* The Original Code is: CommuniCore
* Olavo Farias
* 2006-04-7 olavo.farias@gmail.com
*
* The Initial Developer of the Original Code is CommuniCore.
* Portions created by CommuniCore are Copyright (C) 2005 CommuniCore Ltda
* All Rights Reserved.
********************************************************************************/
$listViewDefs['EcmCalendars'] = array(
'NAME' => array(
'width' => '20',
'label' => 'LBL_NAME',
'default' => true,
'link' => true),
'DESCRIPTION' => array(
'width' => '10',
'label' => 'LBL_DESCRIPTION'),
'DATE_MODIFIED' => array(
'width' => '5',
'label' => 'LBL_DATE_MODIFIED'),
'DATE_ENTERED' => array(
'width' => '5',
'label' => 'LBL_DATE_ENTERED'),
'CREATED_BY_NAME' => array(
'width' => '10',
'label' => 'LBL_CREATED'),
'ASSIGNED_USER_NAME' => array(
'width' => '2',
'label' => 'LBL_LIST_ASSIGNED_USER',
'default' => true),
'MODIFIED_USER_NAME' => array(
'width' => '2',
'label' => 'LBL_MODIFIED')
);
?>

View File

@@ -0,0 +1,60 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*****************************************************************************
* The contents of this file are subject to the RECIPROCAL PUBLIC LICENSE
* Version 1.1 ("License"); You may not use this file except in compliance
* with the License. You may obtain a copy of the License at
* http://opensource.org/licenses/rpl.php. Software distributed under the
* License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
* either express or implied.
*
* You may:
* a) Use and distribute this code exactly as you received without payment or
* a royalty or other fee.
* b) Create extensions for this code, provided that you make the extensions
* publicly available and document your modifications clearly.
* c) Charge for a fee for warranty or support or for accepting liability
* obligations for your customers.
*
* You may NOT:
* a) Charge for the use of the original code or extensions, including in
* electronic distribution models, such as ASP (Application Service
* Provider).
* b) Charge for the original source code or your extensions other than a
* nominal fee to cover distribution costs where such distribution
* involves PHYSICAL media.
* c) Modify or delete any pre-existing copyright notices, change notices,
* or License text in the Licensed Software
* d) Assert any patent claims against the Licensor or Contributors, or
* which would in any way restrict the ability of any third party to use the
* Licensed Software.
*
* You must:
* a) Document any modifications you make to this code including the nature of
* the change, the authors of the change, and the date of the change.
* b) Make the source code for any extensions you deploy available via an
* Electronic Distribution Mechanism such as FTP or HTTP download.
* c) Notify the licensor of the availability of source code to your extensions
* and include instructions on how to acquire the source code and updates.
* d) Grant Licensor a world-wide, non-exclusive, royalty-free license to use,
* reproduce, perform, modify, sublicense, and distribute your extensions.
*
* The Original Code is: CommuniCore
* Olavo Farias
* 2006-04-7 olavo.farias@gmail.com
*
* The Initial Developer of the Original Code is CommuniCore.
* Portions created by CommuniCore are Copyright (C) 2005 CommuniCore Ltda
* All Rights Reserved.
********************************************************************************/
$popupMeta = array(
'moduleMain' => 'EcmCalendar',
'varName' => 'ECMCALENDAR',
'orderBy' => 'ecmcalendars.name',
'whereClauses' => array(
'name' => 'ecmcalendars.name',
),
'searchInputs' => array('name', 'name')
);
?>

View File

@@ -0,0 +1,59 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*****************************************************************************
* The contents of this file are subject to the RECIPROCAL PUBLIC LICENSE
* Version 1.1 ("License"); You may not use this file except in compliance
* with the License. You may obtain a copy of the License at
* http://opensource.org/licenses/rpl.php. Software distributed under the
* License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
* either express or implied.
*
* You may:
* a) Use and distribute this code exactly as you received without payment or
* a royalty or other fee.
* b) Create extensions for this code, provided that you make the extensions
* publicly available and document your modifications clearly.
* c) Charge for a fee for warranty or support or for accepting liability
* obligations for your customers.
*
* You may NOT:
* a) Charge for the use of the original code or extensions, including in
* electronic distribution models, such as ASP (Application Service
* Provider).
* b) Charge for the original source code or your extensions other than a
* nominal fee to cover distribution costs where such distribution
* involves PHYSICAL media.
* c) Modify or delete any pre-existing copyright notices, change notices,
* or License text in the Licensed Software
* d) Assert any patent claims against the Licensor or Contributors, or
* which would in any way restrict the ability of any third party to use the
* Licensed Software.
*
* You must:
* a) Document any modifications you make to this code including the nature of
* the change, the authors of the change, and the date of the change.
* b) Make the source code for any extensions you deploy available via an
* Electronic Distribution Mechanism such as FTP or HTTP download.
* c) Notify the licensor of the availability of source code to your extensions
* and include instructions on how to acquire the source code and updates.
* d) Grant Licensor a world-wide, non-exclusive, royalty-free license to use,
* reproduce, perform, modify, sublicense, and distribute your extensions.
*
* The Original Code is: CommuniCore
* Olavo Farias
* 2006-04-7 olavo.farias@gmail.com
*
* The Initial Developer of the Original Code is CommuniCore.
* Portions created by CommuniCore are Copyright (C) 2005 CommuniCore Ltda
* All Rights Reserved.
********************************************************************************/
$searchFields['EcmCalendars'] =
array (
'name' => 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'),
);
?>

View File

@@ -0,0 +1,76 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*****************************************************************************
* The contents of this file are subject to the RECIPROCAL PUBLIC LICENSE
* Version 1.1 ("License"); You may not use this file except in compliance
* with the License. You may obtain a copy of the License at
* http://opensource.org/licenses/rpl.php. Software distributed under the
* License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
* either express or implied.
*
* You may:
* a) Use and distribute this code exactly as you received without payment or
* a royalty or other fee.
* b) Create extensions for this code, provided that you make the extensions
* publicly available and document your modifications clearly.
* c) Charge for a fee for warranty or support or for accepting liability
* obligations for your customers.
*
* You may NOT:
* a) Charge for the use of the original code or extensions, including in
* electronic distribution models, such as ASP (Application Service
* Provider).
* b) Charge for the original source code or your extensions other than a
* nominal fee to cover distribution costs where such distribution
* involves PHYSICAL media.
* c) Modify or delete any pre-existing copyright notices, change notices,
* or License text in the Licensed Software
* d) Assert any patent claims against the Licensor or Contributors, or
* which would in any way restrict the ability of any third party to use the
* Licensed Software.
*
* You must:
* a) Document any modifications you make to this code including the nature of
* the change, the authors of the change, and the date of the change.
* b) Make the source code for any extensions you deploy available via an
* Electronic Distribution Mechanism such as FTP or HTTP download.
* c) Notify the licensor of the availability of source code to your extensions
* and include instructions on how to acquire the source code and updates.
* d) Grant Licensor a world-wide, non-exclusive, royalty-free license to use,
* reproduce, perform, modify, sublicense, and distribute your extensions.
*
* The Original Code is: CommuniCore
* Olavo Farias
* 2006-04-7 olavo.farias@gmail.com
*
* The Initial Developer of the Original Code is CommuniCore.
* Portions created by CommuniCore are Copyright (C) 2005 CommuniCore Ltda
* All Rights Reserved.
********************************************************************************/
$GLOBALS['studioDefs']['EcmCalendars'] = array(
'LBL_DETAILVIEW'=>array(
'template' => 'xtpl',
'template_file' => 'modules/EcmCalendars/DetailView.html',
'php_file' => 'modules/EcmCalendars/DetailView.php',
'type' => 'DetailView',
),
'LBL_EDITVIEW'=>array(
'template' => 'xtpl',
'template_file' => 'modules/EcmCalendars/EditView.html',
'php_file' => 'modules/EcmCalendars/EditView.php',
'type' => 'EditView',
),
'LBL_LISTVIEW'=>array(
'template' => 'listview',
'meta_file' => 'modules/EcmCalendars/listviewdefs.php',
'type' => 'ListView',
),
'LBL_SEARCHFORM'=>array(
'template' => 'xtpl',
'template_file' => 'modules/EcmCalendars/SearchForm.html',
'php_file' => 'modules/EcmCalendars/ListView.php',
'type' => 'SearchForm',
),
);

View File

@@ -0,0 +1,82 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*****************************************************************************
* The contents of this file are subject to the RECIPROCAL PUBLIC LICENSE
* Version 1.1 ("License"); You may not use this file except in compliance
* with the License. You may obtain a copy of the License at
* http://opensource.org/licenses/rpl.php. Software distributed under the
* License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
* either express or implied.
*
* You may:
* a) Use and distribute this code exactly as you received without payment or
* a royalty or other fee.
* b) Create extensions for this code, provided that you make the extensions
* publicly available and document your modifications clearly.
* c) Charge for a fee for warranty or support or for accepting liability
* obligations for your customers.
*
* You may NOT:
* a) Charge for the use of the original code or extensions, including in
* electronic distribution models, such as ASP (Application Service
* Provider).
* b) Charge for the original source code or your extensions other than a
* nominal fee to cover distribution costs where such distribution
* involves PHYSICAL media.
* c) Modify or delete any pre-existing copyright notices, change notices,
* or License text in the Licensed Software
* d) Assert any patent claims against the Licensor or Contributors, or
* which would in any way restrict the ability of any third party to use the
* Licensed Software.
*
* You must:
* a) Document any modifications you make to this code including the nature of
* the change, the authors of the change, and the date of the change.
* b) Make the source code for any extensions you deploy available via an
* Electronic Distribution Mechanism such as FTP or HTTP download.
* c) Notify the licensor of the availability of source code to your extensions
* and include instructions on how to acquire the source code and updates.
* d) Grant Licensor a world-wide, non-exclusive, royalty-free license to use,
* reproduce, perform, modify, sublicense, and distribute your extensions.
*
* The Original Code is: CommuniCore
* Olavo Farias
* 2006-04-7 olavo.farias@gmail.com
*
* The Initial Developer of the Original Code is CommuniCore.
* Portions created by CommuniCore are Copyright (C) 2005 CommuniCore Ltda
* All Rights Reserved.
********************************************************************************/
$subpanel_layout = array(
'top_buttons' => array(
array('widget_class' => 'SubPanelTopCreateButton'),
array('widget_class' => 'SubPanelTopSelectButton', 'popup_module' => 'EcmCalendars'),
),
'where' => '',
'list_fields' => array(
'name'=>array(
'vname' => 'LBL_LIST_NAME',
'widget_class' => 'SubPanelDetailViewLink',
'width' => '50%',
),
'assigned_user_name' => array (
'name' => 'assigned_user_name',
'vname' => 'LBL_LIST_ASSIGNED_TO_NAME',
),
'edit_button'=>array(
'widget_class' => 'SubPanelEditButton',
'module' => 'EcmCalendars',
'width' => '4%',
),
'remove_button'=>array(
'widget_class' => 'SubPanelRemoveButton',
'module' => 'EcmCalendars',
'width' => '5%',
),
),
);
?>

229
modules/EcmCalendars/vardefs.php Executable file
View File

@@ -0,0 +1,229 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*****************************************************************************
* The contents of this file are subject to the RECIPROCAL PUBLIC LICENSE
* Version 1.1 ("License"); You may not use this file except in compliance
* with the License. You may obtain a copy of the License at
* http://opensource.org/licenses/rpl.php. Software distributed under the
* License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
* either express or implied.
*
* You may:
* a) Use and distribute this code exactly as you received without payment or
* a royalty or other fee.
* b) Create extensions for this code, provided that you make the extensions
* publicly available and document your modifications clearly.
* c) Charge for a fee for warranty or support or for accepting liability
* obligations for your customers.
*
* You may NOT:
* a) Charge for the use of the original code or extensions, including in
* electronic distribution models, such as ASP (Application Service
* Provider).
* b) Charge for the original source code or your extensions other than a
* nominal fee to cover distribution costs where such distribution
* involves PHYSICAL media.
* c) Modify or delete any pre-existing copyright notices, change notices,
* or License text in the Licensed Software
* d) Assert any patent claims against the Licensor or Contributors, or
* which would in any way restrict the ability of any third party to use the
* Licensed Software.
*
* You must:
* a) Document any modifications you make to this code including the nature of
* the change, the authors of the change, and the date of the change.
* b) Make the source code for any extensions you deploy available via an
* Electronic Distribution Mechanism such as FTP or HTTP download.
* c) Notify the licensor of the availability of source code to your extensions
* and include instructions on how to acquire the source code and updates.
* d) Grant Licensor a world-wide, non-exclusive, royalty-free license to use,
* reproduce, perform, modify, sublicense, and distribute your extensions.
*
* The Original Code is: CommuniCore
* Olavo Farias
* 2006-04-7 olavo.farias@gmail.com
*
* The Initial Developer of the Original Code is CommuniCore.
* Portions created by CommuniCore are Copyright (C) 2005 CommuniCore Ltda
* All Rights Reserved.
********************************************************************************/
$dictionary['EcmCalendar'] = array(
'table' => 'ecmcalendars',
'audited' => true,
'comment' => 'EcmCalendars',
'duplicate_merge' => true,
'unified_search' => true,
'fields' => array (
//STANDARD FIELDS SECTION
'id' => array (
'name' => 'id',
'vname' => 'LBL_ID',
'type' => 'id',
'required' => true,
'reportable' => false,
'comment' => 'Unique identifier'
),
'name' => array (
'name' => 'name',
'vname' => 'LBL_NAME',
'type' => 'name',
'required' => true,
'dbType' => 'varchar',
'len' => 255,
'audited' => true,
'unified_search' => true,
'comment' => 'The short description of the record contents',
'massupdate' => true,
'merge_filter' => 'selected',
),
'date_entered' => array (
'name' => 'date_entered',
'vname' => 'LBL_DATE_ENTERED',
'type' => 'datetime',
'required' => true,
'comment' => 'Date record created'
),
'date_modified' => array (
'name' => 'date_modified',
'vname' => 'LBL_DATE_MODIFIED',
'type' => 'datetime',
'required' => true,
'comment' => 'Date record last modified'
),
'modified_user_id' => array (
'name' => 'modified_user_id',
'rname' => 'user_name',
'id_name' => 'modified_user_id',
'vname' => 'LBL_MODIFIED',
'type' => 'assigned_user_name',
'table' => 'modified_user_id_users',
'isnull' => 'false',
'dbType' => 'varchar',
'len' => 36,
'required' => true,
'reportable' => true,
'comment' => 'User who last modified record'
),
'assigned_user_id' => array (
'name' => 'assigned_user_id',
'rname' => 'user_name',
'id_name' => 'assigned_user_id',
'vname' => 'LBL_ASSIGNED_TO',
'type' => 'relate',
'table' => 'users',
'isnull' => 'false',
'dbType' => 'varchar',
'reportable' => true,
'len' => 36,
'audited' => true,
'comment' => 'User assigned to record',
'module' => 'Users',
'duplicate_merge' => 'disabled'
),
'assigned_user_name' => array (
'name' => 'assigned_user_name',
'vname' => 'LBL_ASSIGNED_TO',
'type' => 'varchar',
'reportable' => false,
'source' => 'nondb',
'table' => 'users',
'massupdate' => true,
'duplicate_merge' => 'disabled'
),
'created_by' => array (
'name' => 'created_by',
'rname' => 'user_name',
'id_name' => 'created_by',
'vname' => 'LBL_CREATED',
'type' => 'assigned_user_name',
'table' => 'created_by_users',
'isnull' => 'false',
'dbType' => 'varchar',
'len' => 36,
'comment' => 'User that created the record'
),
'created_by_link' => array (
'name' => 'created_by_link',
'type' => 'link',
'relationship' => 'ecmcalendars_created_by',
'vname' => 'LBL_CREATED_BY_USER',
'link_type' => 'one',
'module' => 'Users',
'bean_name' => 'User',
'source' => 'non-db',
),
'modified_user_link' => array (
'name' => 'modified_user_link',
'type' => 'link',
'relationship' => 'ecmcalendars_modified_user',
'vname' => 'LBL_MODIFIED_BY_USER',
'link_type' => 'one',
'module' => 'Users',
'bean_name' => 'User',
'source' => 'non-db',
),
'assigned_user_link' => array (
'name' => 'assigned_user_link',
'type' => 'link',
'relationship' => 'ecmcalendars_assigned_user',
'vname' => 'LBL_ASSIGNED_TO_USER',
'link_type' => 'one',
'module' => 'Users',
'bean_name' => 'User',
'source' => 'non-db',
'duplicate_merge' => 'enabled',
'rname' => 'user_name',
'id_name' => 'assigned_user_id',
'table' => 'users',
),
'deleted' => array (
'name' => 'deleted',
'vname' => 'LBL_CREATED_BY',
'type' => 'bool',
'required' => true,
'reportable' => false,
'comment' => 'Record deletion indicator'
),
//NEW FIELDS SECTION
'description' => array(
'type' => 'text',
'name' => 'description',
'vname' => 'LBL_DESCRIPTION',
'comment' => 'Description',
),
//FOR SUBPANELS
),
//INDICES SECTION
'indices' => array (
array('name' =>'ecmcalendarsspk', 'type' =>'primary', 'fields'=>array('id')),
array('name' =>'idx_ecmcalendars_name', 'type' =>'index', 'fields'=>array('name'))
)
//RELATIONSHIPS SECTION
, 'relationships' => array (
'ecmcalendars_assigned_user' => array(
'lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
'rhs_module'=> 'EcmCalendars', 'rhs_table'=> 'ecmcalendars', 'rhs_key' => 'assigned_user_id',
'relationship_type'=>'one-to-many')
,'ecmcalendars_modified_user' => array(
'lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
'rhs_module'=> 'EcmCalendars', 'rhs_table'=> 'ecmcalendars', 'rhs_key' => 'modified_user_id',
'relationship_type'=>'one-to-many')
,'ecmcalendars_created_by' => array(
'lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
'rhs_module'=> 'EcmCalendars', 'rhs_table'=> 'ecmcalendars', 'rhs_key' => 'created_by',
'relationship_type'=>'one-to-many')
),
//THIS FLAG ENABLES OPTIMISTIC LOCKING FOR SAVES FROM EDITVIEW
'optimistic_locking'=>true,
);
?>