This commit is contained in:
2024-04-27 09:23:34 +02:00
commit 11e713ca6f
11884 changed files with 3263371 additions and 0 deletions

View File

@@ -0,0 +1,96 @@
<?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 $current_user;
require_once("modules/EcmDocuments/dirstree.php");
$dashletData['MyEcmDocsDashlet']['searchFields'] = array(
'date_entered' => array('default' => ''),
'date_modified' => array('default' => ''),
'assigned_user_id' => array('type' => 'assigned_user_name',
'default' => $current_user->name)
);
$dashletData['MyEcmDocsDashlet']['columns'] = array(
'name' => array(
'width' => '40',
'label' => 'LBL_LIST_NAME',
'link' => true,
'default' => true),
'date_entered' => array(
'width' => '1',
'label' => 'Date',
'default' => true),
'file_id' => array(
'width' => '1',
'label' => '&nbsp;',
'sortable' => false,
'customCode' => ' ',
'default' => true),
'version' => array(
'width' => '40',
'label' => 'Version',
'sortable' => false,
'customCode' => '<div id="version{$FILE_ID}"></div><script language="javascript">mintajaxget("modules/EcmDocs/show_version.php?file_id={$FILE_ID}","version{$FILE_ID}");</script>',
'default' => true),
'date_entered' => array(
'width' => '15',
'default' => true,
'label' => 'LBL_DATE_ENTERED'),
'date_modified' => array(
'width' => '15',
'label' => 'LBL_DATE_MODIFIED'),
'created_by' => array(
'width' => '8',
'label' => 'LBL_CREATED'),
'assigned_user_name' => array(
'width' => '8',
'label' => 'LBL_LIST_ASSIGNED_USER'),
);
?>

View File

@@ -0,0 +1,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.
********************************************************************************/
global $app_strings;
$dashletMeta['MyEcmDocsDashlet'] = array(
'title' => translate('LBL_LIST_MY_ECMDOCS', 'EcmDocs'),
'icon' => 'modules/EcmDocs/images/EcmDocs.gif',
'description' => 'A customizable view into EcmDocs',
'category' => 'Module Views',
'hidden' => true );
?>

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.
********************************************************************************/
require_once('include/Dashlets/DashletGeneric.php');
require_once('modules/EcmDocs/EcmDoc.php');
require_once('modules/EcmDocs/Dashlets/MyEcmDocsDashlets/MyEcmDocsDashlet.data.php');
class MyEcmDocsDashlet extends DashletGeneric {
function MyEcmDocsDashlet($id, $def = null) {
global $current_user, $app_strings, $dashletData;
parent::DashletGeneric($id, $def);
$this->searchFields = $dashletData['MyEcmDocsDashlet']['searchFields'];
$this->columns = $dashletData['MyEcmDocsDashlet']['columns'];
if(empty($def['title']))
$this->title = translate('LBL_LIST_MY_ECMDOCS', 'EcmDocs');
$this->seedBean = new EcmDoc();
}
function displayOptions() {
$this->processDisplayOptions();
$this->configureSS->assign('searchFields', $this->currentSearchFields);
return $this->configureSS->fetch($this->configureTpl);
}
}
?>

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/EcmDocs/EcmDoc.php');
$focus = new EcmDoc();
// 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,62 @@
<?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/EcmDocs/EcmDoc.php');
require_once('modules/EcmDocs/Forms.php');
$GLOBALS['db']->query("delete from ecmdocs_group where id='".$_REQUEST['record']."'");
header("Location: index.php?module=EcmDocs&action=ListViewGroup");
?>

View File

@@ -0,0 +1,22 @@
<?
error_reporting(E_ALL);
$r=$GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select filename from ecmfiles_versions where id='".$_REQUEST['record']."'"));
$filename=$r['filename'];
unlink($filename);
$GLOBALS['db']->query("delete from ecmfiles_versions where id='".$_REQUEST['record']."'");
$z="select id from ecmfiles_versions where file_id='".$_REQUEST['file_id']."' and deleted='0' order by date_entered asc";
$w=$GLOBALS['db']->query($z);
$j=0;
while($r=$GLOBALS['db']->fetchByAssoc($w))
{
$ids[$j]=$r['id'];
$j++;
}
$v=1.0;
for($i=0;$i<count($ids);$i++)
{
$GLOBALS['db']->query("update ecmfiles_versions set version='".$v."' where id='".$ids[$i]."'");
$v+=0.1;
}
header("Location: index.php?module=".$_REQUEST['return_module']."&action=DetailView&record=".$_REQUEST['return_id']);
?>

View File

@@ -0,0 +1,152 @@
<!--
/*****************************************************************************
* 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.
********************************************************************************/
-->
<!-- BEGIN: main -->
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<form action="index.php" method="post" name="DetailView" id="form">
<input type="hidden" name="module" value="EcmDocs">
<input type="hidden" name="record" value="{ID}">
<input type="hidden" name="isDuplicate" value=false>
<input type="hidden" name="action">
<input type="hidden" name="return_module">
<input type="hidden" name="return_action">
<input type="hidden" name="return_id" >
<tr>
<td style="padding-bottom: 2px;"><input title="{APP.LBL_EDIT_BUTTON_TITLE}"
accessKey="{APP.LBL_EDIT_BUTTON_KEY}"
class="button"
onclick="this.form.return_module.value='EcmDocs'; this.form.return_action.value='DetailView'; this.form.return_id.value='{ID}'; this.form.action.value='EditView'"
type="submit"
name="Edit"
value=" {APP.LBL_EDIT_BUTTON_LABEL} ">
<input title="{APP.LBL_DUPLICATE_BUTTON_TITLE}"
accessKey="{APP.LBL_DUPLICATE_BUTTON_KEY}"
class="button"
onclick="this.form.return_module.value='EcmDocs'; this.form.return_action.value='index'; this.form.isDuplicate.value=true; this.form.action.value='EditView'"
type="submit"
name="Duplicate"
value=" {APP.LBL_DUPLICATE_BUTTON_LABEL} ">
<input title="{APP.LBL_DELETE_BUTTON_TITLE}"
accessKey="{APP.LBL_DELETE_BUTTON_KEY}"
class="button"
onclick=" if(confirm('{APP.NTC_DELETE_CONFIRMATION}')){location.href='index.php?module=EcmDocs&action=RelationDelete&record={ID}&return_module={RETURN_MODULE}&return_action=ListView&return_id={RETURN_ID}';}"
type="button"
name="Delete"
value=" {APP.LBL_DELETE_BUTTON_LABEL} "></td>
<td align='right'>{ADMIN_EDIT}</td>
</tr>
</table>
</form>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="tabDetailView">
{PAGINATION}
<tr>
<td width="15%" class="tabDetailViewDL"><span sugar='slot1'>{MOD.LBL_NAME}</span sugar='slot'></td>
<td width="35%" class="tabDetailViewDF"><span sugar='slot1b'>{NAME}&nbsp;</span sugar='slot'></td>
<td width="15%" valign="top" class="tabDetailViewDL"><span sugar='slot2'>{APP.LBL_ASSIGNED_TO}</span sugar='slot'></td>
<td width="35%" valign="top" class="tabDetailViewDF"><span sugar='slot2b'>{ASSIGNED_TO}</span sugar='slot'></td>
</tr>
<tr>
<td valign="top" class="tabDetailViewDL">{MOD.LBL_ACCOUNT_TO}</td>
<td valign="top" class="tabDetailViewDF"><a href="index.php?module=Accounts&amp;action=DetailView&amp;record={ACCOUNT_ID}">{ACCOUNT_NAME}</a></td>
<td valign="top" class="tabDetailViewDL">{MOD.LBL_CONTACT_TO}</td>
<td valign="top" class="tabDetailViewDF"><a href="index.php?module=Contacts&amp;action=DetailView&amp;record={CONTACT_ID}">{CONTACT_NAME}</a></td>
</tr>
<tr>
<td valign="top" class="tabDetailViewDL">&nbsp;</td>
<td valign="top" class="tabDetailViewDF">&nbsp;</td>
<td valign="top" class="tabDetailViewDL"><span sugar='slot4'>{MOD.LBL_GROUP_NAME}</span sugar='slot'></td>
<td valign="top" class="tabDetailViewDF"><span sugar='slot4b'>{GROUP_NAME}</span sugar='slot'></td>
</tr>
<tr>
<td valign="top" class="tabDetailViewDL">{MOD.LBL_DESCRIPTION}</td>
<td valign="top" class="tabDetailViewDF"><span sugar='slot3b'>{DESCRIPTION}&nbsp;</span sugar='slot'></td>
<td valign="top" class="tabDetailViewDL">{MOD.LBL_DATE}</td>
<td valign="top" class="tabDetailViewDF">{DATE}</td>
</tr>
<tr>
<td valign="top" class="tabDetailViewDL">{MOD.LBL_WORTH}</td>
<td valign="top" class="tabDetailViewDF">{WORTH}</td>
<td valign="top" class="tabDetailViewDL">{MOD.LBL_REMINDER_DATE} </td>
<td valign="top" class="tabDetailViewDF">{REMINDER_DATE}</td>
</tr>
<tr>
<td valign="top" class="tabDetailViewDL">&nbsp;</td>
<td valign="top" class="tabDetailViewDF">&nbsp;</td>
<td valign="top" class="tabDetailViewDL">{MOD.LBL_REMINDER}</td>
<td valign="top" class="tabDetailViewDF"><input name='should_remind' tabindex='1' size='2' maxlength='2' disabled="disabled" type="checkbox" class="checkbox" value='1' {REMINDER_CHECKED} /></td>
</tr>
<tr>
<td colspan="4" valign="top" class="tabDetailViewDF">&nbsp;</td>
</tr>
<tr>
<td valign="top" class="tabDetailViewDL">&nbsp;</td>
<td valign="top" class="tabDetailViewDF">&nbsp;</td>
<td valign="top" class="tabDetailViewDL">&nbsp;</td>
<td valign="top" class="tabDetailViewDF">&nbsp;</td>
</tr>
<tr class="listViewPaginationTdS1">
<td valign="top" class="listViewPaginationTdS1"><strong>{MOD.LBL_DETAILVIEW_FILE_LIST}</strong></td>
<td valign="top" class="listViewPaginationTdS1"><strong>{MOD.LBL_DETAILVIEW_FILE_DOWNLOAD}</strong></td>
<td valign="top" class="listViewPaginationTdS1"><strong>{MOD.LBL_DETAILVIEW_FILE_VERSION}</strong></td>
<td valign="top" class="listViewPaginationTdS1"><strong>{MOD.LBL_DETAILVIEW_FILE_DATE_CREATED} </strong></td>
</tr>
{LISTVERSIONS}
</table>
<!-- END: main -->
<!-- BEGIN: subpanel -->
<span sugar='slot23'>{SUBPANEL}</span sugar='slot'>
<!-- END: subpanel -->

272
modules/EcmDocs/EcmDoc.php Normal file
View File

@@ -0,0 +1,272 @@
<?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 EcmDoc 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;
var $group_id;
var $group_name;
var $account_id;
var $account_name;
var $contact_id;
var $contact_name;
var $relation;
var $value;
var $date;
var $reminder_time;
var $hour;
var $minutes;
var $reminder_date;
var $status;
// 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 = 'EcmDocs';
var $table_name = "ecmdocs";
var $object_name = "EcmDoc";
//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
'contact_id',
'account_id'
);
function EcmDoc() {
parent::SugarBean();
$this->setupCustomFields('EcmDocs');
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 .= "
ecmdocs.*
,users.user_name as assigned_user_name";
if($custom_join){
$query .= $custom_join['select'];
}
$query .= " FROM ecmdocs
LEFT JOIN users
ON ecmdocs.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 ecmdocs.name";
return $query;
}
function create_export_query($order_by, $where){
$custom_join = $this->custom_fields->getJOIN();
$query = "SELECT
ecmdocs.*,
users.user_name assigned_user_name";
if($custom_join){
$query .= $custom_join['select'];
}
$query .= " FROM ecmdocs ";
$query .= " LEFT JOIN users
ON ecmdocs.assigned_user_id=users.id";
if($custom_join){
$query .= $custom_join['join'];
}
$query .= "";
$where_auto = " ecmdocs.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 ecmdocs.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, 'EcmDocs');
// 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;
$r=$GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select account_id,file_id from ecmdocs where id='".$this->id."'"));
$the_array['ACCOUNT_ID'] = $r['account_id'];
$z="select version,id,date_entered,name from ecmfiles_versions where file_id='".$r['file_id']."' and deleted='0' order by version desc limit 1";
$w=$GLOBALS['db']->query($z);
$r=$GLOBALS['db']->fetchByAssoc($w);
$the_array['PDF_LINK']='<a href="DownloadEcmFile.php?record='.$r['id'].'"><img src="modules/EcmInvoiceOuts/images/pdf.gif" border="0"></a>';
$w=$GLOBALS['db']->query("select file_id from ecmfiles_versions where file_id='".$this->file_id."'");
if(mysql_num_rows($w)>0)$the_array['BUTTON_DOWNLOAD']='<a title="PDF" href="DownloadEcmFile.php?file_id='.$this->file_id.'"><img title="PDF" src="modules/EcmDocuments/images/pdf.gif" width="14" height="14" border="0"></a>';
else $the_array['BUTTON_DOWNLOAD']='<img src="modules/EcmDocuments/images/pdf-off.gif" width="14" height="14" border="0" />';
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, "ecmdocs.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("ECMDOCS_DESCRIPTION", $ecmdocs->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,77 @@
<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
/*****************************************************************************
* The contents of this doc are subject to the RECIPROCAL PUBLIC LICENSE
* Version 1.1 ("License"); You may not use this doc 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 EcmDocGroup extends SugarBean {
var $field_name_map = array();
var $id;
var $name;
var $module_dir = 'EcmDocs';
var $table_name = "ecmdocs_group";
var $object_name = "EcmDocGroup";
function EcmDocGroup()
{
parent::SugarBean();
$this->field_name_map['name'] = array("name"=>"name","vname"=>"LBL_NAME","type"=>"varchar","len"=>"255","required"=>1);
$this->field_name_map['id'] = array("name"=>"id","vname"=>"LBL_ID","type"=>"int","len"=>"11","required"=>1);
}
function create_list_query($order_by, $where, $show_deleted = 0){
// Fill in the assigned_user_name
$query = "SELECT * from ecmdocs_group order by name asc";
return $query;
}
}
?>

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/EcmDocs/EcmDoc.php');
require_once('include/javascript/javascript.php');
class EcmDocsQuickCreate extends QuickCreate {
var $javascript;
function process() {
global $current_user, $timedate, $app_list_strings, $current_language, $mod_strings;
$mod_strings = return_module_language($current_language, 'EcmDocs');
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(\"ecmdocsQuickCreate\")) return SUGAR.subpanelUtils.inlineSave(this.form.id, \"ecmdocs\"); else return false;'");
$this->ss->assign('cancelOnclick', "onclick='return SUGAR.subpanelUtils.cancelCreate(\"subpanel_ecmdocs\")';");
}
$this->ss->assign('viaAJAX', $this->viaAJAX);
$this->javascript = new javascript();
$this->javascript->setFormName('ecmdocsQuickCreate');
$focus = new EcmDoc();
$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' => 'ecmdocsQuickCreate',
'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);
}
}
?>

View File

@@ -0,0 +1,77 @@
<?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 EcmFileGroup extends SugarBean {
var $field_name_map = array();
var $id;
var $name;
var $module_dir = 'EcmFiles';
var $table_name = "ecmfiles_group";
var $object_name = "EcmFileGroup";
function EcmFileGroup()
{
parent::SugarBean();
$this->field_name_map['name'] = array("name"=>"name","vname"=>"LBL_NAME","type"=>"varchar","len"=>"255","required"=>1);
$this->field_name_map['id'] = array("name"=>"id","vname"=>"LBL_ID","type"=>"int","len"=>"11","required"=>1);
}
function create_list_query($order_by, $where, $show_deleted = 0){
// Fill in the assigned_user_name
$query = "SELECT * from ecmfiles_group order by name asc";
return $query;
}
}
?>

View File

@@ -0,0 +1,328 @@
<!--
/*****************************************************************************
* 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.
********************************************************************************/
-->
<!-- BEGIN: main -->
<style type="text/css">
.przezroczysty {
filter: alpha(opacity=40);
-moz-opacity: 0.4;
opacity:0.4;
}
.nieprzezroczysty {
filter: none;
-moz-opacity: none;
opacity: none;
}
</style>
<script language="javascript" src="modules/EcmDocs/formloader.js"></script>
<script language="javascript" src="modules/EcmDocs/mintajax.js"></script>
<script language="javascript" src="modules/EcmDocs/helper.js"></script>
<script language="javascript">
function showuploadingafile()
{
if(document.getElementById('name').value!="")
{
document.getElementById('opacity').className="przezroczysty";
document.getElementById('uploading').style.display="block";
return true;
}
else
{
return false;
}
}
</script>
<div id="uploading" style="display:none;position:absolute;right:0;top:0;width:1000px;height:1000px;"><div style="position:absolute;top:300;right:400;">{MOD.LBL_UPLOADING_FILE}</div></div>
<div id="opacity">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<form name="EditView" method="POST" onSubmit="return showuploadingafile();" enctype="multipart/form-data" action="index.php">
<input type="hidden" name="module" value="EcmDocs">
<input type="hidden" name="record" value="{ID}">
<input type="hidden" name="action">
<input type="hidden" name="return_module" value="{RETURN_MODULE}">
<input type="hidden" name="return_id" value="{RETURN_ID}">
<input type="hidden" name="return_action" value="{RETURN_ACTION}">
<input type="hidden" name="email_id" value="{EMAIL_ID}">
<input type="hidden" name="case_id" value="{CASE_ID}">
<input type="hidden" name="samba_file" value="{SAMBA_FILE}">
<input type="hidden" name="db_id" value="{DB_ID}">
<!--// InboundEmail support //-->
<input type="hidden" name="inbound_email_id" value="{INBOUND_EMAIL_ID}">
<input type="hidden" name="start" value="{START}">
<input type="hidden" name="type" value="{TYPE}">
<input type="hidden" name="uid" value="{UID}">
<input type="hidden" name="ieId" value="{IEID}">
<td style="padding-bottom: 2px;">
<input title="{APP.LBL_SAVE_BUTTON_TITLE}" accessKey="{APP.LBL_SAVE_BUTTON_KEY}" class="button"
onclick="this.form.action.value='Save';return check_form('EditView');"
type="submit" name="button" value=" {APP.LBL_SAVE_BUTTON_LABEL} " >
<input title="{APP.LBL_CANCEL_BUTTON_TITLE}" accessKey="{APP.LBL_CANCEL_BUTTON_KEY}" class="button"
onclick="history.back();"
type="submit" name="button" value=" {APP.LBL_CANCEL_BUTTON_LABEL} ">
</td>
<td align="right" nowrap><span class="required">{APP.LBL_REQUIRED_SYMBOL}</span> {APP.NTC_REQUIRED}</td>
<td align='right'>{ADMIN_EDIT}</td>
</tr>
</table>
<p>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="tabForm">
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="15%" class="dataLabel"><span sugar='slot1'>{MOD.LBL_NAME} <span class="required">{APP.LBL_REQUIRED_SYMBOL}</span></span sugar='slot'></td>
<td width="35%" class="dataField"><span sugar='slot1b'><input id='name' name='name' type="text" tabindex='1' size='35' maxlength='50' value="{NAME}"></span sugar='slot'></td>
<td class="dataLabel" ><span sugar='slot2'>{APP.LBL_ASSIGNED_TO}</span sugar='slot'></td>
<td class="dataField">
<span sugar='slot2b'>
<input class="sqsEnabled" tabindex="7" autocomplete="off" id="assigned_user_name" name='assigned_user_name' type="text" value="{ASSIGNED_USER_NAME}">
<input id='assigned_user_id' name='assigned_user_id' type="hidden" value="{ASSIGNED_USER_ID}" />
<input title="{APP.LBL_SELECT_BUTTON_TITLE}" accessKey="{APP.LBL_SELECT_BUTTON_KEY}" type="button" class="button" value='{APP.LBL_SELECT_BUTTON_LABEL}' name="btn_assigned_user_name"
onclick='open_popup("Users", 600, 400, "", true, false, {encoded_users_popup_request_data});' /></span sugar='slot'> </td>
</tr>
<tr>
<td class="dataLabel">{MOD.LBL_ACCOUNT_TO}</td>
<td class="dataField"><span sugar='slot4b'>
<input class="sqsEnabled" tabindex="2" autocomplete="off" id="account_name" name='account_name' type="text" value="{ACCOUNT_NAME}" />
<input id='account_id' name='account_id' type="hidden" value="{ACCOUNT_ID}" />
<input title="{APP.LBL_SELECT_BUTTON_TITLE}" accesskey="{APP.LBL_SELECT_BUTTON_KEY}" type="button" class="button" value='{APP.LBL_SELECT_BUTTON_LABEL}' name="btn1"
onclick='open_popup("Accounts", 600, 400, "", true, false, {"call_back_function":"set_return","form_name":"EditView","field_to_name_array":{"id":"account_id","name":"account_name"}}, "single", true);' />
<input name="account_create_button" type="button" class="button" id="account_create_button" value="{MOD.LBL_CREATE_BUTTON_LABEL}" />
</span sugar='slot'></td>
<td valign="top" class="dataLabel">{MOD.LBL_CONTACT_TO}</td>
<td valign="top" class="dataField"><input class="sqsEnabled" tabindex="2" autocomplete="off" id="contact_name" name='contact_name' type="text" value="{CONTACT_NAME}" />
<input id='contact_id' name='contact_id' type="hidden" value="{CONTACT_ID}" />
<input title="{APP.LBL_SELECT_BUTTON_TITLE}" accesskey="{APP.LBL_SELECT_BUTTON_KEY}" type="button" class="button" value='{APP.LBL_SELECT_BUTTON_LABEL}' name="btn"
onclick='open_popup("Contacts", 600, 400, "", true, false, {"call_back_function":"set_return","form_name":"EditView","field_to_name_array":{"id":"contact_id","name":"contact_name"}}, "single", true);' />
<input name="{MOD.LBL_CREATE_BUTTON_LABEL}" type="button" class="button" name="contact_create_button" id="contact_create_button" value="{MOD.LBL_CREATE_BUTTON_LABEL}" /> </td>
</tr>
<tr>
<td class="dataLabel">&nbsp;</td>
<td class="dataField">&nbsp;</td>
<td valign="top" class="dataLabel"><span sugar='slot4'>{MOD.LBL_GROUP_NAME}</span sugar='slot'></td>
<td valign="top" class="dataField">
<span sugar='slot4b'>
{GROUP} </span sugar='slot'> </td>
</tr>
<tr>
<td width="15%" valign="top" class="dataLabel"><span sugar='slot3'>{MOD.LBL_DESCRIPTION}</span sugar='slot'></td>
<td width="35%" rowspan="2" class="dataField"><span sugar='slot3b'>
<textarea name='description' title="Description" tabindex='3' cols="30" rows="8">{DESCRIPTION}</textarea>
</span sugar='slot'></td>
<td valign="top" class="dataLabel"><span sugar='slot4'>{DFILEINPUT}</span sugar='slot'></td>
<td valign="top" class="dataField"><span sugar='slot4b'> {FILEINPUT} </span sugar='slot'> </td>
</tr>
<tr>
<td width="15%" valign="top" class="dataLabel">&nbsp;</td>
<td valign="top" class="dataLabel">&nbsp;</td>
<td valign="top" class="dataField">&nbsp;</td>
</tr>
<tr>
<td valign="top" class="dataLabel">{MOD.LBL_WORTH}</td>
<td valign="top" class="dataField"><input tabindex="4" id="value" name='value' type="text" value="{WORTH}" /></td>
<td valign="top" class="dataLabel">{MOD.LBL_DATE}</td>
<td valign="top" class="dataField"><input name='date'
onblur="parseDate(this, '{CALENDAR_DATEFORMAT}');"
id='jscal_fielddate'
type="text"
title="Date"
tabindex='10'
size='11'
maxlength='10'
value="{DATE}" />
<img src="themes/default/images/jscalendar.gif" alt="{APP.LBL_ENTER_DATE}" id="jscal_triggerdate" align="absmiddle" /> <span class="dateFormat">{USER_DATEFORMAT}</span>
<script>
Calendar.setup ({inputField : 'jscal_fielddate', ifFormat : '{CALENDAR_DATEFORMAT}', showsTime : false, button : 'jscal_triggerdate', singleClick : true, step : 1});
</script></td>
</tr>
<tr>
<td class="dataLabel" valign="top">{DEMAILCHECK}</td>
<td class="dataField">{EMAILCHECK}</td>
<td valign="top" class="dataLabel">{MOD.LBL_REMINDER_DATE} </td>
<td valign="top" class="dataField"><input name='should_remind' type='hidden' value='0' />
<input name='should_remind' tabindex='12' size='2' maxlength='2' onclick='toggleDisplay(&quot;should_remind_list&quot;);' type="checkbox" class="checkbox" value='1' {REMINDER_CHECKED} /><div id='should_remind_list' style='display:{REMINDER_TIME_DISPLAY}'>
<input name='reminder_date'
onblur="parseDate(this, '{CALENDAR_DATEFORMAT}');"
id='jscal_fieldreminder_date'
type="text"
title="Date"
tabindex='13'
size='11'
maxlength='10'
value="{REMINDER_DATE}" />
<img src="themes/default/images/jscalendar.gif" alt="{APP.LBL_ENTER_DATE}" id="jscal_triggerreminder_date" align="absmiddle" /> <span class="dateFormat">{USER_DATEFORMAT}</span>
<input tabindex="14" name="hour" type="text" value="{HOUR}" size="1" />:<input tabindex="15" name="minutes" type="text" value="{MINUTES}" size="1" />
<script>
Calendar.setup ({inputField : 'jscal_fieldreminder_date', ifFormat : '{CALENDAR_DATEFORMAT}', showsTime : false, button : 'jscal_triggerreminder_date', singleClick : true, step : 1});
</script></div></td>
</tr>
<tr>
<td class="dataLabel" valign="top">{BACKTOEMAILS}</td>
<td class="dataField">{BACKTOEMAILSCHECK}</td>
<td valign="top" class="dataLabel">{MOD.LBL_STATUS}</td>
<td valign="top" class="dataField"><select name="status">{STATUS}</select></td>
</tr>
<tr>
<td class="dataLabel" valign="top">{DMSEL}</td>
<td class="dataField">{MSEL} </td>
<td valign="top" class="dataLabel">&nbsp;</td>
<td valign="top" class="dataField">&nbsp;</td>
</tr>
</table>
</td>
</tr>
</table>
</p>
<div style="padding-top: 2px">
<input title="{APP.LBL_SAVE_BUTTON_TITLE}" accessKey="{APP.LBL_SAVE_BUTTON_KEY}" class="button" onclick="this.form.action.value='Save';return check_form('EditView');" type="submit" name="button" value=" {APP.LBL_SAVE_BUTTON_LABEL} " >
<input title="{APP.LBL_CANCEL_BUTTON_TITLE}" accessKey="{APP.LBL_CANCEL_BUTTON_KEY}" class="button" onclick="this.form.action.value='{RETURN_ACTION}'; this.form.module.value='{RETURN_MODULE}'; this.form.record.value='{RETURN_ID}'" type="submit" name="button" value=" {APP.LBL_CANCEL_BUTTON_LABEL} ">
</div></div>
</form>
<script language="javascript">
//create Contact
var contactFL;
contactFL = new FormLoader();
contactFL.load('EcmDocs','Contacts','contactFL');
contactFL.onResponseData = function(data) {
//hideSmartInputFloater(true);
document.forms.EditView.contact_id.value = data['id'];
document.forms.EditView.contact_name.value = data['name'];
};
contactFL.setEditDblClick(document.forms.EditView.contact_name);
contactFL.onEditDblClick = function() {
var ret = "&fl_record="+document.forms.EditView.contact_id.value;
var ccc = document.forms.EditView.contact_name.value;
var cc_pos = ccc.indexOf(" ");
if(cc_pos != -1) {
var cc_ = '&fl_first_name='+ccc.substr(0,cc_pos)+'&fl_last_name='+ccc.substr(cc_pos+1,ccc.length);
ret += cc_;
}
return ret;
}
contactFL.onButtonClick = function() {
var ret = "&fl_record="+document.forms.EditView.contact_id.value;
var ccc = document.forms.EditView.contact_name.value;
var cc_pos = ccc.indexOf(" ");
if(cc_pos != -1) {
var cc_ = '&fl_first_name='+ccc.substr(0,cc_pos)+'&fl_last_name='+ccc.substr(cc_pos+1,ccc.length);
ret += cc_;
}
return ret;
}
document.forms.EditView.contact_create_button.FL = contactFL;
document.forms.EditView.contact_create_button.onclick = function() {
if(this.FL.createModule == '') return;
if(this.FL.onButtonClick) var data = this.FL.onButtonClick();
window.open("index.php?module="+this.FL.module+"&action=formloader&to_pdf=1&loaderAction=ViewForm&loaderFieldName="+this.FL.fieldName+"&createModule="+this.FL.createModule+(data?data:''),"Create10"+this.FL.module,"resizable=yes,scrollbars=no,status=no,height=540,width=700").focus();
}
//create Account
var accountFL;
accountFL = new FormLoader();
accountFL.load('EcmDocs','Accounts','accountFL');
accountFL.onResponseData = function(data) {
//hideSmartInputFloater(true);
document.forms.EditView.account_id.value = data['id'];
document.forms.EditView.account_name.value = data['name'];
};
accountFL.setEditDblClick(document.forms.EditView.account_name);
accountFL.onEditDblClick = function() {
var ret = "&fl_record="+document.forms.EditView.account_id.value+"&fl_name="+document.forms.EditView.account_name.value;
return ret;
}
accountFL.onButtonClick = function() {
var ret = "&fl_name="+document.forms.EditView.account_name.value;
return ret;
}
document.forms.EditView.account_create_button.FL = accountFL;
document.forms.EditView.account_create_button.onclick = function() {
if(this.FL.createModule == '') return;
if(this.FL.onButtonClick) var data = this.FL.onButtonClick();
window.open("index.php?module="+this.FL.module+"&action=formloader&to_pdf=1&loaderAction=ViewForm&loaderFieldName="+this.FL.fieldName+"&createModule="+this.FL.createModule+(data?data:''),"Create10"+this.FL.module,"resizable=yes,scrollbars=no,status=no,height=540,width=700").focus();
}
set_return = function(popup_reply_data, filter) {
var form_name = popup_reply_data.form_name;
var name_to_value_array = popup_reply_data.name_to_value_array;
for (var the_key in name_to_value_array) {
if (the_key == "toJSON") {
} else if (the_key) {
var displayValue = name_to_value_array[the_key].replace(/&amp;/gi, "&").replace(/&lt;/gi, "<").replace(/&gt;/gi, ">").replace(/&#039;/gi, "'").replace(/&quot;/gi, "\"");
document.getElementById(the_key).value = displayValue;
}
}
}
</script>
{JAVASCRIPT}
<script type="text/javascript" language="JavaScript">
if(!set_return) var set_return = null;
set_return = function(popup_reply_data, filter) {
var form_name = popup_reply_data.form_name;
var name_to_value_array = popup_reply_data.name_to_value_array;
for (var the_key in name_to_value_array) {
if (the_key == "toJSON") {
} else if (the_key) {
var displayValue = name_to_value_array[the_key].replace(/&/gi, "&").replace(/</gi, "<").replace(/>/gi, ">").replace(/'/gi, "'").replace(/"/gi, "\"");
document.getElementById(the_key).value = displayValue;
}
}
}
</script>
<!-- END: main -->

View File

@@ -0,0 +1,496 @@
<?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.
********************************************************************************/
//*****************************************************************
if(!function_exists('calculateGMT')) {
function calculateGMT() {
static $gmt;
if(!isset($gmt)) {
global $timedate;
$dd = gmdate("Y-m-d H:i:s");
$dd2 = $timedate->handle_offset($dd, "Y-m-d H:i:s", true);
$gmt = strtotime($dd2) - strtotime($dd);
}
return $gmt;
}
}
//*****************************************************************
$_SESSION['email_id']=$_REQUEST['inbound_email_id'];
$_REQUEST['inbound_email_id']="";
if($_SESSION['email_id'])
{
$r=$GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select emails.name as name,emails_text.description description,emails.parent_id,emails.parent_type from emails inner join emails_text on emails_text.email_id=emails.id where emails.id='".$_SESSION['email_id']."'"));
$description_email=$r['description'];
$name_email=$r['name'];
$query = "select filename,id from notes where parent_id='".$_SESSION['email_id']."' and parent_type='Emails'";
$w=$GLOBALS['db']->query($query);
$i=0;
$msel='<select ondblclick="location.href=\'download.php?id=\'+this.value.replace(\'cache/upload/\',\'\')+\'&type=Notes\'" id="efiles" name="efiles[]" size="6" multiple="multiple" tabindex="6">';
while($r=$GLOBALS['db']->fetchByAssoc($w))
{
$_SESSION['filename_email'][$i]['filename']=$sugar_config['upload_dir'].$r['id'];
$_SESSION['filename_email'][$i]['name']=$r['filename'];
$_SESSION['emails_files']=1;
$msel.='<option value="'.$_SESSION['filename_email'][$i]['filename'].'" selected>'.$_SESSION['filename_email'][$i]['name'].'</option>';
$i++;
}
$nmail=$i;
$msel.="</select>";
$_SESSION['email_id']="";
}
if($_REQUEST['samba_file'])
{
$expn=explode("/",$_REQUEST['samba_file']);
$filename=$expn[count($expn)-1];
$path=str_replace($filename,"",$_REQUEST['samba_file']);
$exp=explode("/",str_replace("[s]"," ",$_REQUEST['samba_file']));
$sname=$exp[count($exp)-1];
$msel='<select id="sfiles" name="sfiles[]" size="6" multiple="multiple"><option ondblclick="location.href=\'DownloadSMB.php?ps='.$path.'&file='.$filename.'\';" value="'.str_replace("[s]"," ",$_REQUEST['samba_file']).'" selected>'.$sname.'</option></select>';
$msel.="</select>";
}
// INCLUDE SUPPPORT MODULES
require_once('XTemplate/xtpl.php');
require_once('data/Tracker.php');
// INCLUDE MODULE OBJECT AND FORMS
require_once('modules/EcmDocs/EcmDoc.php');
require_once('modules/EcmDocs/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 EcmDoc();
// IF PROCESSING AN EXISTING RECORD, RETRIEVE IT
if(isset($_REQUEST['record'])) {
$focus->retrieve($_REQUEST['record']);
$focus->format_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("EcmDocs detail view");
// ASSIGN XTEMPLATE
$xtpl = new XTemplate ('modules/EcmDocs/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));
$popup_request_data = array(
'call_back_function' => 'set_return',
'form_name' => 'EditView',
'field_to_name_array' => array(
'id' => 'account_id',
'name' => 'account_name',
),
);
$json = getJSONobj();
$xtpl->assign('encoded_account_popup_request_data', $json->encode($popup_request_data));
$popup_request_data = array(
'call_back_function' => 'set_return',
'form_name' => 'EditView',
'field_to_name_array' => array(
'id' => 'contact_id',
'name' => 'contact_name',
),
);
$json = getJSONobj();
$xtpl->assign('encoded_contact_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('account_name' => array(
'method' => 'query',
'modules' => array('Accounts'),
'group' => 'or',
'field_list' => array('name', 'id'),
'populate_list' => array('account_name', 'account_id'),
'conditions' => array(array('name'=>'name','op'=>'like_custom','end'=>'%','value'=>'')),
'order' => 'name',
'limit' => '30',
'no_match_text' => $app_strings['ERR_SQS_NO_MATCH']
),
'contact_name' => array(
'method' => 'query',
'modules' => array('Contacts'),
'group' => 'or',
'field_list' => array('name', 'id'),
'populate_list' => array('contact_name', 'contact_id'),
'conditions' => array(array('name'=>'name','op'=>'like_custom','end'=>'%','value'=>'')),
'order' => 'name',
'limit' => '30',
'no_match_text' => $app_strings['ERR_SQS_NO_MATCH']
),
'assigned_user_name' => $qsd->getQSUser()
);
$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);
$xtpl->assign("DB_ID", $_REQUEST['db_id']);
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 );
if(!$_REQUEST['record'])$xtpl->assign("ONSUBMITFILE",' onSubmit="return showuploadingafile();"');
if($_REQUEST['return_module']=="Accounts" && $_REQUEST['return_id']){
$r=$GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select name from accounts where id='".$_REQUEST['return_id']."'"));
$focus->account_id=$_REQUEST['return_id'];
$focus->account_name=$r['name'];
}
// ASSIGN MODULE SPECIFIC VARIABLES
$group="<select name='group_id' tabindex='8'>";
$z="select id,name from ecmdocs_group where deleted='0' order by name asc";
$w=$GLOBALS['db']->query($z);
while($r=$GLOBALS['db']->fetchByAssoc($w))
{
$group.="<option value='".$r['id']."'";
if($r['id']==$focus->group_id)$group.=" selected";
$group.=">".$r['name']."</option>";
}
$group.="</select>";
$xtpl->assign("GROUP", $group);
$xtpl->assign("UID", $_REQUEST['uid']);
$xtpl->assign("IEID", $_REQUEST['ieId']);
$xtpl->assign("DESCRIPTION", $focus->description);
$xtpl->assign("GROUP_ID", $focus->group_id);
$xtpl->assign("GROUP_NAME", $focus->group_name);
$xtpl->assign("ACCOUNT_ID", $focus->account_id);
$xtpl->assign("ACCOUNT_NAME", $focus->account_name);
$xtpl->assign("CONTACT_ID", $focus->contact_id);
$xtpl->assign("CONTACT_NAME", $focus->contact_name);
$xtpl->assign("RELATION", $focus->relation);
$rs = $GLOBALS['db']->query("select reminder_time,date,reminder_date from ecmdocs where id='".$_REQUEST['record']."'");
if($rs && is_resource($rs)) $r=$GLOBALS['db']->fetchByAssoc($rs);
$xtpl->assign("WORTH", $focus->value);
if(!$_REQUEST['record'])$date=$timedate->to_display(date("Y-m-d"), "Y-m-d", $timedate->get_date_format());
else $date=$timedate->to_display($r['date'], "Y-m-d", $timedate->get_date_format());
$xtpl->assign("DATE", $date);
if(!$_REQUEST['record'] || $r['reminder_time'] == -1)$r_date=$timedate->to_display_date(gmdate("Y-m-d"));
else
{
$exp=explode(" ",$r['reminder_date']);
$exp1=$exp[0];
$exp2=$exp[1];
$expd=explode("-",$exp1);
$expt=explode(":",$exp2);
$rdate=@mktime($expt[0],$expt[1],$expt[2],$expd[1],$expd[2],$expd[0]);
$rdate=date("Y-m-d H:i:s",$rdate+calculateGMT());
$exp=explode(" ",$rdate);
$exp1=$exp[0];
$exp2=$exp[1];
$expd=explode("-",$exp1);
$expt=explode(":",$exp2);
$r_date=$timedate->to_display($exp1, "Y-m-d", $timedate->get_date_format());
}
$xtpl->assign("REMINDER_DATE", $r_date);
if(!$_REQUEST['record'] || $r['reminder_time'] == -1)$expt[0]= date("H",strtotime(gmdate("Y-m-d H:i:s"))+calculateGMT());
$xtpl->assign("HOUR", $expt[0]);
if(!$_REQUEST['record'] || $r['reminder_time'] == -1)$expt[1]=date("i",strtotime(gmdate("Y-m-d H:i:s"))+calculateGMT());
$xtpl->assign("MINUTES", $expt[1]);
// 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->assign("DESCRIPTION", $focus->description);
$xtpl->assign("INBOUND_EMAIL_ID", $_GET['inbound_email_id']);
$xtpl->assign("SAMBA_FILE", $_REQUEST['samba_file']);
if($_REQUEST['samba_file'])$xtpl->assign("NAME",str_replace(".pdf","",str_replace(".doc","",str_replace(".jpg","",str_replace(".gif","",str_replace(".txt","",$sname))))));
if($_GET['inbound_email_id'] || $_REQUEST['samba_file'])
{
$xtpl->assign("MSEL", $msel);
$xtpl->assign("DMSEL", $mod_strings['LBL_FILES_TO_SAVE']);
if($nmail>=1)$mcheck=" checked";
else $mcheck="";
if(!$_REQUEST['samba_file'])
{
$xtpl->assign("EMAILCHECK", '<input type="checkbox" tabindex="5" name="emaildel" value="1"'.$mcheck.'>');
$xtpl->assign("DEMAILCHECK", "Would you like to delete this mail?");
$xtpl->assign("BACKTOEMAILS", "Back to Emails");
$xtpl->assign("BACKTOEMAILSCHECK", '<input type="checkbox" tabindex="5" name="backtoemails" value="1" checked>');
}
}
else
{
$xtpl->assign("FILEINPUT", '<input name="filename" id="filename" title="Filename" type="file" tabindex="8" maxlength="255">');
$xtpl->assign("DFILEINPUT", $mod_strings['LBL_FILE'].'<span class="required"> *</span>');
}
if($name_email )$xtpl->assign("NAME",str_replace(".pdf","",str_replace(".doc","",str_replace(".jpg","",str_replace(".gif","",str_replace(".txt","",$name_email))))));
if($description_email)$xtpl->assign("DESCRIPTION",$description_email);
require_once("modules/EcmDocs/time_select.php");
$rs = $GLOBALS['db']->query("select reminder_time from ecmdocs where id='".$_REQUEST['record']."'");
if($rs && is_resource($rs)) $r=$GLOBALS['db']->fetchByAssoc($rs);
$reminder_time=$r['reminder_time'];
$time_select=show_time_select($reminder_time);
$xtpl->assign("REMINDER_TIME_OPTIONS", $time_select);
if (empty ($reminder_time)) {
$reminder_time = -1;
}
if ($reminder_time > -1) {
$xtpl->assign("REMINDER_TIME_DISPLAY", 'inline');
$xtpl->assign("REMINDER_CHECKED", 'checked');
} else {
$xtpl->assign("REMINDER_TIME_DISPLAY", 'none');
}
$status.='<option value="Planned"';
if($focus->status=="Planned" || $_REQUEST['status']=="Planned")$status.=' selected';
$status.='>Planned</option>';
$status.='<option value="Held"';
if($focus->status=="Held" || $_REQUEST['status']=="Held")$status.=' selected';
$status.='>Held</option>';
$xtpl->assign("STATUS",$status);
$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');
$javascript->addToValidateBinaryDependency('account_name', 'alpha', $app_strings['ERR_SQS_NO_MATCH_FIELD'] . $app_strings['LBL_ACCOUNT_NAME'], 'false', '', 'account_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('EcmDocs')));
$str = "<script>
YAHOO.util.Event.addListener(window, 'load', SUGAR.util.fillShortcuts, $savedSearchSelects);
</script>";
echo $str;
?>

View File

@@ -0,0 +1,121 @@
<?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/EcmDocs/EcmDoc.php');
require_once('modules/EcmDocs/Forms.php');
global $mod_strings, $app_strings;
if($_REQUEST['record'])
{
$z="select * from ecmdocs_group where id='".$_REQUEST['record']."'";
$w=$GLOBALS['db']->query($z);
$r=$GLOBALS['db']->fetchByAssoc($w);
$name=$r['name'];
if($_REQUEST['save'] || $_REQUEST['save1'])
{
$GLOBALS['db']->query("update ecmdocs_group set name='".$_POST['name']."' where id='".$_REQUEST['record']."'");
$return_id=$_REQUEST['record'];
header("Location: index.php?module=EcmDocs&action=ListViewGroup");
}
}
else
{
if($_REQUEST['save'] || $_REQUEST['save1'])
{
$return_id=create_guid();
$GLOBALS['db']->query("insert into ecmdocs_group set id='".$return_id."',name='".$_POST['name']."'");
header("Location: index.php?module=EcmDocs&action=ListViewGroup");
}
}
?>
<form name="EditView" method="POST" enctype="multipart/form-data" action="index.php?module=EcmDocs&action=EditViewGroup&record=<?print $_REQUEST['record'];?>">
<table cellpadding="0" cellspacing="0" border="0" width="100%">
<tr>
<td style="padding-bottom: 2px;">
<input title="<?php echo $app_strings['LBL_SAVE_BUTTON_TITLE']; ?>" class="button" type="submit" name="save" value="<?php echo $app_strings['LBL_SAVE_BUTTON_LABEL']; ?>" >
<input title="<?php echo $app_strings['LBL_CANCEL_BUTTON_TITLE']; ?>" type="button" class="button" type="button" onclick="history.back();" name="cancel" value="<?php echo $app_strings['LBL_CANCEL_BUTTON_LABEL']; ?>">
</td>
<td align="right" nowrap></td>
<td align='right'></td>
</tr>
</table>
<p>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="tabForm">
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="15%" valign="top" class="dataLabel"><?php echo $mod_strings['LBL_GROUP_NAME_GR']; ?></td>
<td width="35%" valign="top" class="dataField"><input tabindex="3" id="name" name='name' type="text" value="<?print $name;?>" /></td>
<td valign="top" class="dataLabel" >&nbsp;</td>
<td class="dataField">&nbsp;</td>
</tr>
</table>
</td>
</tr>
</table>
</p>
<div style="padding-top: 2px">
<input title="<?php echo $app_strings['LBL_SAVE_BUTTON_TITLE']; ?>" class="button" type="submit" name="save" value="<?php echo $app_strings['LBL_SAVE_BUTTON_LABEL']; ?>" >
<input title="<?php echo $app_strings['LBL_CANCEL_BUTTON_TITLE']; ?>" type="button" class="button" type="button" onclick="history.back();" name="cancel" value="<?php echo $app_strings['LBL_CANCEL_BUTTON_LABEL']; ?>">
</div>
</form>

111
modules/EcmDocs/Forms.php Normal 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('EcmDocs', '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="EcmDocSave" onSubmit="return check_form('EcmDocsSave')" method="POST" action="index.php">
<input type="hidden" name="module" value="EcmDocs">
<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/EcmDocs/EcmDoc.php');
$javascript = new javascript();
$javascript->setFormName('EcmDocsSave}');
$javascript->setSugarBean(new EcmDoc());
$javascript->addRequiredFields('');
$the_form .= $javascript->getScript();
$the_form .= get_left_form_footer();
return $the_form;
}
?>

View File

@@ -0,0 +1,52 @@
// JavaScript Document
function moveDiv(obj, mvTop, mvLeft) {
obj.style.position = "absolute";
obj.style.top = mvTop;
obj.style.left = mvLeft;
}
function findPosX(obj)
{
var curleft = 0;
if(obj.offsetParent)
while(1)
{
curleft += obj.offsetLeft;
if(!obj.offsetParent)
break;
obj = obj.offsetParent;
}
else if(obj.x)
curleft += obj.x;
return curleft;
}
function findPosY(obj)
{
var curtop = 0;
if(obj.offsetParent)
while(1)
{
curtop += obj.offsetTop;
if(!obj.offsetParent)
break;
obj = obj.offsetParent;
}
else if(obj.y)
curtop += obj.y;
return curtop;
}
function showdescription(id,title,desc,minus)
{
if(!minus)minus=0;
var sum=17-minus;
document.getElementById("opis").style.display="inline";
document.getElementById("opis-title").innerHTML=title;
document.getElementById("opis-desc").innerHTML=desc;
posy=findPosY(document.getElementById("link-"+id))+sum;
posx=findPosX(document.getElementById("link-"+id))-80;
moveDiv(document.getElementById("opis"),posy,posx);
}
function hidedescription()
{
document.getElementById("opis").style.display="none";
}

View File

@@ -0,0 +1,135 @@
<!--
/*****************************************************************************
* 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.
********************************************************************************/
-->
<!-- BEGIN: main -->
<table cellpadding="0" cellspacing="0" width="100%" border="0" class="listView">
<!-- BEGIN: list_nav_row -->
{PAGINATION}
<!-- END: list_nav_row -->
<tr height="20">
<td scope="col" class="listViewThS1" NOWRAP>{CHECKALL}</td>
<td scope="col" width="35%" class="listViewThS1" NOWRAP><slot><a href="{ORDER_BY}name" class="listViewThLinkS1">{MOD.LBL_LIST_SUBJECT}{arrow_start}{name_arrow}{arrow_end}</a></slot></td>
<td scope="col" width="25%" class="listViewThS1" NOWRAP><a href="{ORDER_BY}account_name" class="listViewThLinkS1">Account {arrow_start}{account_name_arrow}{arrow_end}</a></td>
<td scope="col" width="20%" class="listViewThS1" NOWRAP><a href="{ORDER_BY}date_entered" class="listViewThLinkS1">Date Created {arrow_start}{date_entered_arrow}{arrow_end}</a></td>
<td scope="col" width="15%" class="listViewThS1" nowrap="nowrap"><slot><a href="{ORDER_BY}users.user_name" class="listViewThLinkS1">{APP.LBL_LIST_ASSIGNED_USER}{arrow_start}{users_user_name_arrow}{arrow_end}</a></slot></td>
</tr>
<!-- BEGIN: row -->
<tr height="20"
onmouseover="setPointer(this, '{ECMDOC.NAME}', 'over', '{BG_COLOR}', '{BG_HILITE}', '{BG_CLICK}');"
onmouseout="setPointer(this, '{ECMDOC.NAME}', 'out', '{BG_COLOR}', '{BG_HILITE}', '{BG_CLICK}');"
onmousedown="setPointer(this, '{ECMDOC.NAME}', 'click', '{BG_COLOR}', '{BG_HILITE}', '{BG_CLICK}');">
<td class="{ROW_COLOR}S1" bgcolor="{BG_COLOR}" valign='top'>{PREROW}</td>
<td scope='row' valign=TOP class="{ROW_COLOR}S1" bgcolor="{BG_COLOR}">
<slot>
<{TAG.MAIN} onmouseover="showdescription('EcmDocs{ECMDOC.STAMP}_{ECMDOC.ID}','{ECMDOC.NAME}','{ECMINVOICE.DESCRIPTION}');" onmouseout="hidedescription();" id="link-EcmDocs{ECMDOC.STAMP}_{ECMDOC.ID}" href="{URL_PREFIX}index.php?action=DetailView&module=EcmDocs&record={ECMDOC.ID}&offset={ECMDOC.OFFSET}&stamp={ECMDOC.STAMP}" class="listViewTdLinkS1">
<script language="javascript">
var text="";
var t="";
t="{ECMDOC.NAME}";
if(t.length>30)
{
for(var i=0;i<=29;i++)
{
text+=t.charAt(i);
}
text=text+"...";
}
else
{
text=t;
}
document.write(text);
</script></{TAG.MAIN}> </slot> </td>
<td scope='row' valign=TOP class="{ROW_COLOR}S1" bgcolor="{BG_COLOR}"><a onmouseover="
var t='{ECMDOC.ACCOUNT_NAME}';
if(t.length>20)
{
showdescription('EcmDoc{ECMDOC.STAMP}_{ECMDOC.ID}','{ECMDOC.ACCOUNT_NAME}','');
}
"
onmouseout="
var t='{ECMDOC.ACCOUNT_NAME}';
if(t.length>20)
{
hidedescription();
}
" id="link-EcmDoc{ECMDOC.STAMP}_{ECMDOC.ID}" href="{URL_PREFIX}index.php?action=DetailView&module=Accounts&record={ECMDOC.ACCOUNT_ID}&offset={ECMDOC.OFFSET}&stamp={ECMDOC.STAMP}" class="listViewTdLinkS1"><script language="javascript">
var text="";
var t="";
var i=0;
t="{ECMDOC.ACCOUNT_NAME}";
if(t.length>20)
{
for(i=0;i<=19;i++)
{
text+=t.charAt(i);
}
text=text+"...";
}
else
{
text=t;
}
document.write(text);
</script></a></td>
<td scope='row' valign=TOP class="{ROW_COLOR}S1" bgcolor="{BG_COLOR}">{ECMDOC.DATE_ENTERED}</td>
<td valign="top" class="{ROW_COLOR}S1" bgcolor="{BG_COLOR}" nowrap="nowrap"><slot>{ECMDOC.ASSIGNED_USER_NAME}</slot></td>
</tr>
<tr><td colspan="27" class="listViewHRS1"></td></tr>
<!-- END: row -->
{PAGINATION}
</table>
<!-- END: main -->

View File

@@ -0,0 +1,234 @@
<?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');
$_SESSION['back_request_uri']=$_SERVER['REQUEST_URI'];
require_once ('XTemplate/xtpl.php');
require_once ("data/Tracker.php");
require_once ('modules/EcmDocs/EcmDoc.php');
require_once ('themes/'.$theme.'/layout_utils.php');
require_once ('log4php/LoggerManager.php');
require_once('include/ListView/ListViewSmarty.php');
require_once('include/ListView/ListView.php');
require_once("modules/EcmDocuments/dirstree.php");
require_once('modules/Currencies/Currency.php');
//print '<input type="button" name="backtoecmdocuments" class="button" value="Back" onclick="document.location.href=\'index.php?module=EcmDocuments&action=DetailView&record='.$_REQUEST['iddir'].'\';"/><br><br>';
if(file_exists('custom/modules/EcmDocs/metadata/listviewdefs.php')){
require_once('custom/modules/EcmDocs/metadata/listviewdefs.php');
}else{
require_once('modules/EcmDocs/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, 'EcmDocs');
global $urlPrefix;
global $currentModule;
global $theme;
global $current_user;
// FOCUS_LIST IS THE MEANS OF PASSING DATA TO A LISTVIEW.
global $focus_list;
global $db;
$z="select name from ecmdocs_group order by name asc";
$w=$db->query($z);
$app_list_strings['ecmdocs_group_name_dom'][''] = $mod_strings['LBL_GROUPS_ALL'];
while($r=$db->fetchByAssoc($w))
{
$app_list_strings['ecmdocs_group_name_dom'][$r['name']] = $r['name'];
}
//$_REQUEST['date']=$timedate->to_display($_REQUEST['date'], $timedate->get_date_format(), "Y-m-d");
$_REQUEST['date_entered']=$timedate->to_display($_REQUEST['date_entered'], $timedate->get_date_format(), "Y-m-d");
$_REQUEST['reminder_date']=$timedate->to_display($_REQUEST['reminder_date'], $timedate->get_date_format(), "Y-m-d");
$_REQUEST['date_basic']=$timedate->to_display($_REQUEST['date_basic'], $timedate->get_date_format(), "Y-m-d");
$_REQUEST['date_entered_basic']=$timedate->to_display($_REQUEST['date_entered_basic'], $timedate->get_date_format(), "Y-m-d");
$_REQUEST['reminder_date_basic']=$timedate->to_display($_REQUEST['reminder_date_basic'], $timedate->get_date_format(), "Y-m-d");
// 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();
$seedEcmDoc = new EcmDoc();
// SEED BEAN
$searchForm = new SearchForm('EcmDocs', $seedEcmDoc); // 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['EcmDocs'][$col]))
$displayColumns[$col] = $listViewDefs['EcmDocs'][$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['EcmDocs'] 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, "EcmDoc"); // 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");
}
//$_REQUEST['date']=$timedate->to_display($_REQUEST['date'], "Y-m-d", $timedate->get_date_format());
$_REQUEST['date_entered']=$timedate->to_display($_REQUEST['date_entered'], "Y-m-d", $timedate->get_date_format());
$_REQUEST['reminder_date']=$timedate->to_display($_REQUEST['reminder_date'], "Y-m-d", $timedate->get_date_format());
$_REQUEST['date_basic']=$timedate->to_display($_REQUEST['date_basic'], "Y-m-d", $timedate->get_date_format());
$_REQUEST['date_entered_basic']=$timedate->to_display($_REQUEST['date_entered_basic'], "Y-m-d", $timedate->get_date_format());
$_REQUEST['reminder_date_basic']=$timedate->to_display($_REQUEST['reminder_date_basic'], "Y-m-d", $timedate->get_date_format());
// 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();
}
}
//print $where;
echo '<script language="javascript" src="modules/modules/EcmDocs/ListFunctions.js"></script>';
echo $qsd->GetQSScripts();
$lv->setup($seedEcmDoc, '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();/*
require_once('include/ListView/ListView.php');
$ListView = new ListView();
$ListView->initNewXTemplate('modules/EcmDocs/ListView.html',$current_module_strings);
$ListView->setHeaderTitle($current_module_strings['LBL_LIST_FORM_TITLE']);
$ListView->setQuery($where, "", "name asc", "ECMDOC");
$ListView->processListView($seedEcmDoc, "main", "ECMDOC");*/
/*
if($_GET['query']){$_SESSION['ajax_query']=true;}
else $_SESSION['ajax_query']=false;
$where=str_replace(" ","[s]",$where);
$where=str_replace("'","[q]",$where);
$where=str_replace("%","%%[s]",$where);
echo '<table width="100%" cellpadding="0" cellspacing="0" border="0" class="h3Row"><tr><td nowrap><h3>Files List</h3></td><td width="100%"><IMG height="1" width="1" src="include/images/blank.gif" alt=""></td></tr></table>';
echo '<div style="width:100%;height:500px;" id="ListViewAjax"><script language="javascript">mintajaxget(\'ListViewAjax.php?where='.$where.'&table=ecmdocs&module=EcmDocs\',\'ListViewAjax\');</script></div>';
*/
$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('EcmDocs')));
$str = "<script>
YAHOO.util.Event.addListener(window, 'load', SUGAR.util.fillShortcuts, $savedSearchSelects);
</script>";
echo $str;
?>

View File

@@ -0,0 +1,88 @@
<?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 ('themes/'.$theme.'/layout_utils.php');
require_once ('log4php/LoggerManager.php');
require_once('include/ListView/ListView.php');
require_once ('modules/EcmDocs/EcmDocGroup.php');
require_once('modules/Currencies/Currency.php');
global $mod_strings;
$order="name";
$sorder="asc";
$arrow="";
if($_GET['order'])$order=$_GET['order'];
if($_GET['sorder'])$sorder=$_GET['sorder'];
if($sorder=="asc")$arrow="_up";
if($sorder=="desc")$arrow="_down";
if($sorder=="asc")$so="desc";
if($sorder=="desc")$so="asc";
print '<table cellpadding="0" cellspacing="0" width="100%" border="0" class="listView">
<tr height="20"><td width="99%" align="left" nowrap class="listViewThS1" scope="col"><slot><a href="index.php?action=ListViewGroup&module=EcmDocs&order=name&sorder='.$so.'" class="listViewThLinkS1">'.$mod_strings['LBL_LIST_GROUPS_NAME'].'&nbsp;<img border="0" src="themes/Sugar/images/arrow'.$arrow.'.gif" width="8" height="10" align="absmiddle" alt="Sort"></a></slot></td><td width="1%" align="left" nowrap class="listViewThS1" scope="col">'.$mod_strings['LBL_LIST_GROUPS_DELETE'].'</td></tr>';
$z="select * from ecmdocs_group order by ".$order." ".$sorder;
$w=$GLOBALS['db']->query($z);
while($r=$GLOBALS['db']->fetchByAssoc($w))
{
$oe="even";
if($i%2==0)$oe="odd";
print '<tr height="20" onmouseover="setPointer(this, \'1\', \'over\', \'#ffffff\', \'#f6f6f6\', \'\');" onmouseout="setPointer(this, \''.$r['id'].'\', \'out\', \'#ffffff\', \'#f6f6f6\', \'\');" onmousedown="setPointer(this, \'1\', \'click\', \'#ffffff\', \'#f6f6f6\', \'\');"><td scope="row" valign=TOP class="'.$oe.'ListRowS1" bgcolor="#ffffff"><slot> <a href="index.php?action=EditViewGroup&module=EcmDocs&record='.$r['id'].'" class="listViewTdLinkS1">'.$r['name'].'</a> </slot>
</td><td scope="row" valign=TOP class="'.$oe.'ListRowS1" bgcolor="#ffffff"><slot> <a href="index.php?action=DeleteGroup&module=EcmDocs&record='.$r['id'].'" class="listViewTdLinkS1">'.$mod_strings['LBL_LIST_GROUPS_DELETE'].'</a> </slot>
</td></tr>';
$i++;
}
?>

67
modules/EcmDocs/Menu.php Normal file
View File

@@ -0,0 +1,67 @@
<?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('EcmDocs', 'edit', true))
$module_menu [] = Array("index.php?module=EcmDocs&action=EditView&return_module=EcmDocs&return_action=DetailView", $mod_strings['LNK_NEW_ECMDOCS'],"CreateEcmDocs", 'EcmDocs');
if(ACLController::checkAccess('EcmDocs', 'list', true))
$module_menu [] = Array("index.php?module=EcmDocs&action=index&return_module=EcmDocs&return_action=DetailView", $mod_strings['LNK_ECMDOCS_LIST'],"EcmDocs", 'EcmDocs');
if(ACLController::checkAccess('EcmDocs', 'edit', true))
$module_menu [] = Array("index.php?module=EcmDocs&action=EditViewGroup&return_module=EcmDocs&return_action=DetailView", $mod_strings['LNK_NEW_CREATE_GROUP'],"CreateEcmDocsGroup", 'EcmDocs');
if(ACLController::checkAccess('EcmDocs', 'list', true))
$module_menu [] = Array("index.php?module=EcmDocs&action=ListViewGroup&return_module=EcmDocs&return_action=DetailView", $mod_strings['LNK_GROUPS'],"EcmDocsGroup", 'EcmDocs');
if(ACLController::checkAccess('EcmDocs','list', true)) $module_menu[] = Array('#', '<span style="display: none">wp_shortcut_fill_0</span>', '');
?>

View File

@@ -0,0 +1,44 @@
<?
function getPagination($table,$module,$id)
{
$w=$GLOBALS['db']->query("select id from ".$table." where deleted='0'");
$i==0;
while($r=$GLOBALS['db']->fetchByAssoc($w))
{
$tab[$i+1]=$r['id'];
if($id==$r['id'])$n=$i+1;
$i++;
}
if($n==1)
{
$buttons['prev']['disabled']="disabled";
$buttons['prev']['offon']="_off";
$buttons['prev']['id']=$tab[$n-1];
$buttons['next']['disabled']="";
$buttons['next']['offon']="";
$buttons['next']['id']=$tab[$n+1];
}
elseif($n==mysql_num_rows($w))
{
$buttons['prev']['disabled']="";
$buttons['prev']['offon']="";
$buttons['prev']['id']=$tab[$n-1];
$buttons['next']['disabled']="disabled";
$buttons['next']['offon']="_off";
$buttons['next']['id']=$tab[$n+1];
}
else
{
$buttons['prev']['disabled']="";
$buttons['prev']['offon']="";
$buttons['prev']['id']=$tab[$n-1];
$buttons['next']['disabled']="";
$buttons['next']['offon']="";
$buttons['next']['id']=$tab[$n+1];
}
$html='<tr colspan="4">
<td colspan="40" nowrap align=\'right\' class=\'listViewPaginationTdS1\'><button type=\'button\' class=\'button\' title=\'Return to List\' onClick=\'location.href="index.php?action=index&module='.$module.'&offset=0";\'>Return to List</button>&nbsp;&nbsp;&nbsp;&nbsp;<button onClick=\'location.href="index.php?module='.$module.'&action=DetailView&record='.$buttons['prev']['id'].'";\' type=\'button\' class=\'button\' title=\'Previous\' '.$buttons['prev']['disabled'].'><img src=\'themes/Sugar/images/previous'.$buttons['prev']['offon'].'.gif\' width=\'8\' height=\'11\' alt=\'Previous\' border=\'0\' align=\'absmiddle\'></button>&nbsp;&nbsp;('.$n.' of '.mysql_num_rows($w).')&nbsp;&nbsp;<button type=\'button\' class=\'button\' title=\'Next\' onClick=\'location.href="index.php?module='.$module.'&action=DetailView&record='.$buttons['next']['id'].'";\' '.$buttons['next']['disabled'].'><img src=\'themes/Sugar/images/next'.$buttons['next']['offon'].'.gif\' width=\'8\' height=\'11\' alt=\'Next\' border=\'0\' align=\'absmiddle\'></button>&nbsp;&nbsp;</td></tr>';
return $html;
}
?>

122
modules/EcmDocs/Popup.html Normal file
View File

@@ -0,0 +1,122 @@
<!--
/*****************************************************************************
* 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.
********************************************************************************/
-->
<!-- BEGIN: main -->
<!-- BEGIN: SearchHeader -->
{SET_RETURN_JS}
<script type="text/javascript">
function toggleDisplay(id){
if(this.document.getElementById( id).style.display=='none'){
this.document.getElementById( id).style.display='inline'
if(this.document.getElementById(id+"link") != undefined){
this.document.getElementById(id+"link").style.display='none';
}
}else{
this.document.getElementById( id).style.display='none'
if(this.document.getElementById(id+"link") != undefined){
this.document.getElementById(id+"link").style.display='inline';
}
}
}
</script>
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="tabForm">
<tr>
<td>
<div id='divsearchform' style='display:inline'>
<form>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="dataLabel" nowrap="nowrap" width="40%">{MOD.LBL_NAME}&nbsp;&nbsp;<input type="text" size="20" name="name" class="dataField" value="{NAME}" /></td>
<td width="10%" align="right">
<input type="hidden" name="action" value="Popup" />
<input type="hidden" name="query" value="true"/>
<input type="hidden" name="module" value="{MODULE_NAME}" />
<input type="hidden" name="parent_id" value="{parent_id}" />
<input type="hidden" name="parent_name" value="{parent_name}" />
<input type="submit" name="button" class="button"
title="{APP.LBL_SEARCH_BUTTON_TITLE}"
accesskey="{APP.LBL_SEARCH_BUTTON_KEY}"
value="{APP.LBL_SEARCH_BUTTON_LABEL}" />
</td>
</tr>
</table>
</form>
</div>
</td>
</tr>
</table>
<!-- END: SearchHeader -->
<!-- BEGIN: SearchHeaderEnd -->
<!-- END: SearchHeaderEnd -->
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="listView">
<!-- BEGIN: list_nav_row -->
{PAGINATION}
<!-- END: list_nav_row -->
<tr height="20">
<td scope="col" width="65%" class="listViewThS1"><a href="{ORDER_BY}name" class="listViewThLinkS1">{MOD.LBL_LIST_NAME}{arrow_start}{name_arrow}{arrow_end}</a></td>
<td scope="col" width="35%" class="listViewThS1"><a href="{ORDER_BY}assigned_user_name" class="listViewThLinkS1">{MOD.LBL_LIST_ASSIGNED_USER_ID}{arrow_start}{assigned_user_name_arrow}{arrow_end}</a></td>
</tr>
<!-- BEGIN: row -->
<tr height="20"
onmouseover="setPointer(this, '{ecmdocs.ID}', 'over', '{BG_COLOR}', '{BG_HILITE}', '{BG_CLICK}');"
onmouseout ="setPointer(this, '{ecmdocs.ID}', 'out', '{BG_COLOR}', '{BG_HILITE}', '{BG_CLICK}');"
onmousedown="setPointer(this, '{ecmdocs.ID}', 'click', '{BG_COLOR}', '{BG_HILITE}', '{BG_CLICK}');">
<td scope='row' class="{ROW_COLOR}S1" bgcolor="{BG_COLOR}"><a href="#" onclick="set_return('{.ID}', '{ecmdocs.NAME}'); window.close();" class="listViewTdLinkS1">{ecmdocs.NAME}</a></td>
<td class="{ROW_COLOR}S1" bgcolor="{BG_COLOR}">{ecmdocs.ASSIGNED_USER_NAME}</td>
</tr>
<tr>
<td colspan="20" class="listViewHRS1"></td>
</tr>
<!-- END: row -->
</table>
<!-- END: main -->

57
modules/EcmDocs/Popup.php Normal 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,29 @@
<?
function getPopupFieldsJsCode($module,$id)
{
require_once("modules/".$module."/popup_fields.php");
$js='';
if($popup_field[$module])
{
$js.='<script language="javascript">;
';
foreach($popup_field[$module] as $field)
{
$exp=explode("||",$field['to_insert']);
$value="";
$values=array();
foreach($exp as $e)
{
if($_REQUEST[$e]!="" && $e=="id")$values[]=$id;
elseif($_REQUEST[$e]!="")$values[]=$_REQUEST[$e];
}
$value=implode(" ",$values);
if($field['if_empty']==true)$js.='if(parent.opener.document.getElementById("'.$field['field'].'")=="")';
$js.='parent.opener.document.getElementById("'.$field['field'].'").value="'.$value.'";
';
}
$js.='window.close();</script>';
}
return $js;
}
?>

View File

@@ -0,0 +1,131 @@
<!--
/*****************************************************************************
* 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.
********************************************************************************/
-->
<!-- BEGIN: main -->
<!-- BEGIN: SearchHeader -->
<script type="text/javascript" src="include/JSON.js?s={SUGAR_VERSION}&c={JS_CUSTOM_VERSION}"></script>
<script type="text/javascript" src="include/javascript/popup_helper.js?s={SUGAR_VERSION}&c={JS_CUSTOM_VERSION}"></script>
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="tabForm">
<tr>
<td>
<form action="index.php" method="post" name="popup_query_form" id="the_form">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="dataLabel" nowrap="nowrap">{MOD.LBL_NAME}&nbsp;&nbsp;<input type="text" name="name" size="20" class="dataField" value="{NAME}" /></td>
<td width="20%" align="right">
<input type="hidden" name="module" value="{MODULE_NAME}" />
<input type="hidden" name="action" value="Popup" />
<input type="hidden" name="query" value="true" />
<input type="hidden" name="request_data" value="{request_data}" />
<input type="hidden" name="record_id" value="" />
<input type="submit" name="button" class="button"
title="{APP.LBL_SEARCH_BUTTON_TITLE}"
accessKey="{APP.LBL_SEARCH_BUTTON_KEY}"
value="{APP.LBL_SEARCH_BUTTON_LABEL}" />
<input type="hidden" name="mode" value="{MULTI_SELECT}" />
</td>
</tr>
</table>
</form>
</td>
</tr>
</table>
<script type="text/javascript">
<!--
/* initialize the popup request from the parent */
if(window.document.forms['popup_query_form'].request_data.value == "")
{
window.document.forms['popup_query_form'].request_data.value
= JSON.stringify(window.opener.get_popup_request_data());
}
-->
</script>
<!-- END: SearchHeader -->
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="listView">
<!-- BEGIN: list_nav_row -->
{PAGINATION}
<!-- END: list_nav_row -->
<tr height="20" class="listViewThS1">
<td scope="col" width="5%" class="listViewThS1" NOWRAP>{CHECKALL}</td>
<td scope="col" scope="col" width="35%" class="listViewThS1" NOWRAP>
<slot>
<a href="{ORDER_BY}name" class="listViewThLinkS1">{MOD.LBL_NAME}{arrow_start}{name_arrow}{arrow_end}</a>
</slot>
</td>
</tr>
<!-- BEGIN: row -->
<tr height="20"
onmouseover="setPointer(this, '{ECMDOC.ID}', 'over', '{BG_COLOR}', '{BG_HILITE}', '{BG_CLICK}');"
onmouseout="setPointer(this, '{ECMDOC.ID}', 'out', '{BG_COLOR}', '{BG_HILITE}', '{BG_CLICK}');"
onmousedown="setPointer(this, '{ECMDOC.ID}', 'click', '{BG_COLOR}', '{BG_HILITE}', '{BG_CLICK}');">
<td class="{ROW_COLOR}S1" bgcolor="{BG_COLOR}" valign='top'>{PREROW}</td>
<td scope="row" valign="top" class="{ROW_COLOR}S1" bgcolor="{BG_COLOR}">
<slot>
<{TAG.MAIN} href="#"
onclick="send_back('EcmDoc','{ECMDOC.ID}');"
class="listViewTdLinkS1">{ECMDOC.NAME}</{TAG.MAIN}>
</slot>
</td>
</tr>
<tr>
<td colspan="20" class="listViewHRS1"></td>
</tr>
<!-- END: row -->
</table>
{ASSOCIATED_JAVASCRIPT_DATA}
<!-- END: main -->

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/EcmDocs/EcmDoc.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", "ecmdocs.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/EcmDocs/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 EcmDoc();
$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', 'ECMDOC');
$ListView->setModStrings($mod_strings);
ob_start();
$ListView->processListView($seed_bean, 'main', 'ECMDOC');
$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
?>

View File

@@ -0,0 +1,87 @@
<?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/EcmDocuments/dirstree.php");
$z="select id,ecmdocument_id from ecmdocuments_ecmdocs where ecmdoc_id='".$_REQUEST['record']."' and deleted='0'";
$w=$GLOBALS['db']->query($z);
$ile=mysql_num_rows($w);
while($r=$GLOBALS['db']->fetchByAssoc($w))
{
$z1="select name,id,no,date_entered from ecmdocuments where id='".$r['ecmdocument_id']."' and deleted=0";
$w1=$GLOBALS['db']->query($z1);
$r1=$GLOBALS['db']->fetchByAssoc($w1);
$listecm.='<tr>
<td valign="top" class="tabDetailViewDF"><a href="index.php?module=EcmDocuments&action=DetailView&record='.$r1['id'].'">'.print_title($r1['id']."||".check_block($r1['id'],"")).'</a></td>
<td valign="top" class="tabDetailViewDF">'.$r1['description'].'</td>
<td valign="top" class="tabDetailViewDF">'.$r1['date_entered'].'</td>
</tr>';
}
if($ile>0)
{
print "File is in relation with EcmDocuments, do You want to delete relations? <a href='index.php?module=EcmDocs&action=Delete
&record=".$_REQUEST['record']."
&return_module=EcmDocs
&return_action=index&return_id=".$_REQUEST['return_id']."
'>YES</a> | <a href='index.php?module=EcmDocs&action=DetailView&record=".$_REQUEST['record']."&return_module=EcmDocs&return_action=index'>NO</a><br><br>";
}
else
{
ob_start();
header("Location: index.php?module=EcmDocs&action=Delete&record=".$_REQUEST['record']."&return_module=EcmDocs&return_action=index&return_id=".$_REQUEST['return_id']);
}
print '
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="tabDetailView">
<tr class="listViewPaginationTdS1">
<td valign="top" class="listViewPaginationTdS1">Dir</td>
<td valign="top" class="listViewPaginationTdS1">Description</td>
<td valign="top" class="listViewPaginationTdS1">Date Created </td>
</tr>
'.$listecm.'
</table>';
?>

171
modules/EcmDocs/Save.php Normal file
View File

@@ -0,0 +1,171 @@
<?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/EcmDocs/EcmDoc.php');
require_once('include/formbase.php');
require_once('modules/EcmDocs/uploadfile.php');
//require_once('modules/EcmProducts/ProductsStock.php');
//require_once("modules/EcmSmb/smb.php");
function addInfoToReminder($parent_id,$parent_module,$name,$description,$role_id,$time="")
{
if($time=="")$time=date("Y-m-d H:i:s",mktime(date("H"),date("i"),date("s"),date("m"),date("d"),date("Y")));
else
{
$texp=explode(" ",$time);
$dtexp=explode("-",$texp[0]);
$ttexp=explode(":",$texp[1]);
$time=date("Y-m-d H:i:s",mktime($ttexp[0],$ttexp[1],$ttexp[2],$dtexp[1],$dtexp[2],$dtexp[0]));
}
$z="insert into ecmreminders(id,name,date_entered,date_modified,modified_user_id,created_by,description,deleted,assigned_user_id,date_start,status,reminder_time,parent_id,parent_name,role_id) values('".create_guid()."','".$name."','".$time."','".$time."','".$_SESSION['authenticated_user_id']."','".$_SESSION['authenticated_user_id']."','".$desciption."','0','".$_SESSION['authenticated_user_id']."','".$time."','Planned','3600','".$parent_id."','".$parent_module."','".$role_id."')";
$GLOBALS['db']->query($z);
}
$file_id=add_file("filename",$_REQUEST['record'],"ecmdocs","modules/EcmDocs/files/");
if($_REQUEST['return_module']=="MySettings")$_REQUEST['return_module']="EcmDocuments";
if($_REQUEST['return_action']=="LoadTabSubpanels")$_REQUEST['return_action']="DetailView";
$focus = new EcmDoc();
$r=$GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select name from ecmdocs_group where id='".$_POST['group_id']."'"));
$group_name=$r['name'];
$file = "modules/Accounts/Account.php";
if(file_exists($file)) {
require_once($file);
$acc = new Account();
$acc->retrieve($_POST['account_id']);
$_POST['account_name'] = $acc->name;
}
$file = "modules/Contacts/Contact.php";
if(file_exists($file)) {
require_once($file);
$con = new Contact();
$con->retrieve($_POST['contact_id']);
$_POST['contact_name'] = $con->full_name;
}
$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->group_name = $group_name;
$focus->file_id = $file_id;
$focus->unformat_all_fields();
$focus->save($check_notify);
$return_id = $focus->id;
$reminder_time=1;
/*
if($_REQUEST['account_name']=="")
{
$r=$GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select accounts.id as account_id,accounts.name as account_name from contacts inner join accounts_contacts on contacts.id=accounts_contacts.contact_id inner join accounts on accounts.id=accounts_contacts.account_id where contacts.id='".$_REQUEST['contact_id']."'"));
$account_name=$r['account_name'];
$account_id=$r['account_id'];
$GLOBALS['db']->query("update ecmdocs set account_name='".$account_name."',account_id='".$account_id."' where id='".$return_id."'");
}
*/
if($_REQUEST['should_remind'] == "1") {
$time=$timedate->to_db($_REQUEST['reminder_date']." ".$_REQUEST['hour'].":".$_REQUEST['minutes'].":00");
//require_once('modules/EcmDocs/getecmdocstoecmreminders.php');
$rs = $GLOBALS['db']->query("select id from ecmreminders where parent_id='".$return_id."' and status!='Held' and parent_module='EcmDocs'");
if($rs && is_resource($rs))
if(mysql_num_rows($rs)==0)addInfoToReminder($return_id,"EcmDocs",$focus->name,$focus->description,"",$time);
if($_REQUEST['status']=="Held")$GLOBALS['db']->query("delete from ecmreminders where parent_id='".$return_id."' and parent_module='EcmDocs'");
$GLOBALS['db']->query("update ecmdocs set reminder_time='".$reminder_time."',date='".date("Y-m-d",strtotime($time))."',reminder_date='".$time."', hour='".date("H",strtotime($time))."', minutes='".date("i",strtotime($time))."' where id='".$return_id."'");
} else {
$time=$timedate->to_db($_REQUEST['reminder_date']." ".$_REQUEST['hour'].":".$_REQUEST['minutes'].":00");
$GLOBALS['db']->query("update ecmdocs set reminder_time='-1', date='".date("Y-m-d",strtotime($time))."', reminder_date=NULL, hour=NULL, minutes=NULL where id='".$return_id."'");
}
if($_REQUEST['emaildel'] && $_REQUEST['uid'])
{
require_once("modules/Emails/Email.php");
require_once("modules/InboundEmail/InboundEmail.php");
require_once("include/OutboundEmail/OutboundEmail.php");
$email = new Email();
$email->email2init();
$ie = new InboundEmail();
$ie->email = $email;
$ie->deleteMessageOnMailServer($_REQUEST['uid']);
$ie->deleteMessageFromCache($_REQUEST['uid']);
imap_delete($ie->conn, $_REQUEST['uid']);
$GLOBALS['db']->query("DELETE FROM email_cache WHERE message_id = '".$_REQUEST['uid']."'");
$GLOBALS['db']->query("DELETE FROM email_cache WHERE imap_uid = '".$_REQUEST['uid']."'");
//header("Location: index.php?module=Emails&action=EmailUIAjax&emailUIAction=deleteMessage&mbox=INBOX&ieId=".$_REQUEST['ieId']."&uid=".$_REQUEST['uid']."&return_id=".$return_id);
}
if($_REQUEST['backtoemails']==1)header("Location: index.php?module=Emails&action=index");
else handleRedirect($return_id,'EcmDocs');
?>

View File

@@ -0,0 +1,207 @@
<!--
/*****************************************************************************
* 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.
********************************************************************************/
-->
<!-- BEGIN: main -->
<table cellpadding="0" cellspacing="0" border="0" width="100%" style="border-top: 0px none; margin-bottom: 4px" class="tabForm">
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td valign="top" nowrap="nowrap" class="dataLabel"><span sugar='slot1'>{MOD.LBL_NAME}</span sugar='slot'> </td>
<td width="20%" valign="top" class="dataField"><span sugar='slot1b'>
<input type="text" size="20" name="name_basic" class="dataField" value="{NAME}" />
</span sugar='slot'> </td>
<td width="15%" valign="top" class="dataLabel">{APP.LBL_CURRENT_USER_FILTER}</td>
<td width="55%" valign="top" class="dataField"><input name='current_user_only_basic' onchange='this.form.submit();' class="checkbox" type="checkbox" {current_user_only} /></td>
</tr>
<tr>
<td width="15%" class="dataLabel" valign="top">{MOD.LBL_ACCOUNT_TO}</td>
<td width="20%" valign="top" class="dataField"><input name="account_name_basic" type="text" class="dataField" id="account_name_basic" value="{ACCOUNT_NAME}" size="20" /></td>
<td valign="top" class="dataLabel">{MOD.LBL_REMINDER_DATE} </td>
<td valign="top" class="dataField">
<input name='reminder_date_basic'
onblur="parseDate(this, '{CALENDAR_DATEFORMAT}');"
id='jscal_fieldreminder_date'
type="text"
title="Date"
tabindex='13'
size='11'
maxlength='10'
value="{REMINDER_DATE}" />
<img src="themes/default/images/jscalendar.gif" alt="{APP.LBL_ENTER_DATE}" id="jscal_triggerreminder_date" align="absmiddle" /> <span class="dateFormat">{USER_DATEFORMAT}</span>
<script>
mintajaxget("index.php?to_pdf=1&module=EcmDocs&action=showDate&value="+document.getElementById("jscal_fieldreminder_date").value,"jscal_fieldreminder_date");
Calendar.setup ({inputField : 'jscal_fieldreminder_date', ifFormat : '{CALENDAR_DATEFORMAT}', showsTime : false, button : 'jscal_triggerreminder_date', singleClick : true, step : 1});
</script> </td>
</tr>
<tr>
<td valign="top" class="dataLabel">{MOD.LBL_GROUP_NAME}</td>
<td valign="top" class="dataField"><span sugar='slot6'>
<select tabindex='2' id="group_name_basic" name="group_name_basic" class="dataField">
{GROUP_NAME}
</select>
</span sugar='slot'></td>
<td valign="top" class="dataLabel">{MOD.LBL_DATE_CREATED} </td>
<td valign="top" class="dataField"><input name='date_entered_basic'
onblur="parseDate(this, '{CALENDAR_DATEFORMAT}');"
id='jscal_fielddate_entered'
type="text"
title="Date"
tabindex='10'
size='11'
maxlength='10'
value="{DATE_ENTERED}" />
<img src="themes/default/images/jscalendar.gif" alt="{APP.LBL_ENTER_DATE}" id="jscal_triggerdate_entered" align="absmiddle" /> <span class="dateFormat">{USER_DATEFORMAT}</span>
<script>
mintajaxget("index.php?to_pdf=1&module=EcmDocs&action=showDate&value="+document.getElementById("jscal_fielddate_entered").value,"jscal_fielddate_entered");
Calendar.setup ({inputField : 'jscal_fielddate_entered', ifFormat : '{CALENDAR_DATEFORMAT}', showsTime : false, button : 'jscal_triggerdate_entered', singleClick : true, step : 1});
</script></td>
</tr>
<tr>
<td class="dataLabel" valign="top">{MOD.LBL_WORTH}</td>
<td valign="top" class="dataField"><input name="value_basic" type="text" class="dataField" id="value_basic" value="{VALUE}" size="20" /></td>
<td valign="top" class="dataField">&nbsp;</td>
<td valign="top" class="dataLabel">&nbsp;</td>
</tr>
<tr> </tr>
</table></td>
</tr>
</table>
<!-- END: main -->
<!-- BEGIN: advanced -->
<table width="100%" border="0" cellspacing="0" cellpadding="0" style="border-top: 0px none; margin-bottom: 4px" class="tabForm">
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="3">
<tr>
<td width="20%" valign="top" class="dataLabel"><span sugar='slot1'>{MOD.LBL_NAME}</span sugar='slot'></td>
<td width="30%" valign="top" class="dataField"><span sugar='slot1b'><input name='name' type="text" tabindex='1' size='30' maxlength='50' value="{NAME}"></span sugar='slot'></td>
<td width="20%" valign="top" class="dataLabel"><span sugar='slot2'>{APP.LBL_ASSIGNED_TO}</span sugar='slot'></td>
<td width="30%" valign="top" class="dataField"><span sugar='slot2b'><select tabindex='1' style="width: 150px" size='3' name='assigned_user_id[]' multiple="multiple">{USER_FILTER}</select></span sugar='slot'></td>
<tr>
<td class="dataLabel" valign="top">{MOD.LBL_ACCOUNT_TO}</td>
<td valign="top" class="dataField"><input name="account_name" type="text" class="dataField" id="account_name" value="{ACCOUNT_NAME}" size="30" /></td>
<td class="dataLabel" valign="top">{MOD.LBL_CONTACT_TO}</td>
<td valign="top" class="dataField"><input name="contact_name" type="text" class="dataField" id="contact_name" value="{CONTACT_NAME}" size="30" /></td>
</tr>
<tr>
<td valign="top" class="dataLabel">{MOD.LBL_GROUP_NAME}</td>
<td valign="top" class="dataField"><span sugar='slot6'>
<select tabindex='2' id="group_name_basic" name="group_name" class="dataField">
{GROUP_NAME}
</select>
</span sugar='slot'></td>
<td valign="top" class="dataLabel">{MOD.LBL_REMINDER_DATE} </td>
<td valign="top" class="dataField"><input name='reminder_date'
onblur="parseDate(this, '{CALENDAR_DATEFORMAT}');"
id='jscal_fieldreminder_date'
type="text"
title="Date"
tabindex='13'
size='11'
maxlength='10'
value="{REMINDER_DATE}" />
<img src="themes/default/images/jscalendar.gif" alt="{APP.LBL_ENTER_DATE}" id="jscal_triggerreminder_date" align="absmiddle" /> <span class="dateFormat">{USER_DATEFORMAT}</span>
<script>
mintajaxget("index.php?to_pdf=1&module=EcmDocs&action=showDate&value="+document.getElementById("jscal_fieldreminder_date").value,"jscal_fieldreminder_date");
Calendar.setup ({inputField : 'jscal_fieldreminder_date', ifFormat : '{CALENDAR_DATEFORMAT}', showsTime : false, button : 'jscal_triggerreminder_date', singleClick : true, step : 1});
</script> </td>
</tr>
<tr>
<td class="dataLabel" valign="top">{MOD.LBL_WORTH}</td>
<td valign="top" class="dataField"><input name="value" type="text" class="dataField" id="value_basic" value="{VALUE}" size="30" /></td>
<td valign="top" class="dataLabel">{MOD.LBL_DATE_CREATED} </td>
<td valign="top" class="dataField"><input name='date_entered'
onblur="parseDate(this, '{CALENDAR_DATEFORMAT}');"
id='jscal_fielddate_entered'
type="text"
title="Date"
tabindex='10'
size='11'
maxlength='10'
value="{DATE_ENTERED}" />
<img src="themes/default/images/jscalendar.gif" alt="{APP.LBL_ENTER_DATE}" id="jscal_triggerdate_entered" align="absmiddle" /> <span class="dateFormat">{USER_DATEFORMAT}</span>
<script>
mintajaxget("index.php?to_pdf=1&module=EcmDocs&action=showDate&value="+document.getElementById("jscal_fielddate_entered").value,"jscal_fielddate_entered");
Calendar.setup ({inputField : 'jscal_fielddate_entered', ifFormat : '{CALENDAR_DATEFORMAT}', showsTime : false, button : 'jscal_triggerdate_entered', singleClick : true, step : 1});
</script></td>
</tr>
<tr>
<td valign="top" class="dataLabel">{MOD.LBL_DESCRIPTION}</td>
<td valign="top" class="dataField"><textarea name="description" cols="25" rows="4" id="description" tabindex="`3`" title="File Name">{DESCRIPTION}</textarea></td>
<td valign="top" class="dataLabel">{MOD.LBL_DATE}</td>
<td valign="top" class="dataField"><input name='date'
onblur="parseDate(this, '{CALENDAR_DATEFORMAT}');"
id='jscal_fielddate'
type="text"
title="Date"
tabindex='10'
size='11'
maxlength='10'
value="{DATE}" />
<img src="themes/default/images/jscalendar.gif" alt="{APP.LBL_ENTER_DATE}" id="jscal_triggerdate" align="absmiddle" /> <span class="dateFormat">{USER_DATEFORMAT}</span>
<script>
Calendar.setup ({inputField : 'jscal_fielddate', ifFormat : '{CALENDAR_DATEFORMAT}', showsTime : false, button : 'jscal_triggerdate', singleClick : true, step : 1});
</script></td>
</tr>
<tr>
<td valign="top" class="dataLabel">&nbsp;</td>
<td valign="top" class="dataField">&nbsp;</td>
</tr>
<tr> </tr>
</table>
</td>
</tr>
</table>
<!-- END: advanced -->

View File

@@ -0,0 +1,89 @@
<!--
/*****************************************************************************
* 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.
********************************************************************************/
-->
<!-- BEGIN: main -->
<table cellpadding="0" cellspacing="0" width="100%" border="0" class="listView">
<tr height="20" >
<td scope="col" width="5%" class="listViewThS1"><slot>{MOD.LBL_LIST_NUMBER}</slot></td>
<td scope="col" width="50%" class="listViewThS1"><slot>{MOD.LBL_LIST_SUBJECT}</slot></td>
<td scope="col" width="15%" class="listViewThS1"><slot>{MOD.LBL_LIST_STATUS}</slot></td>
<td scope="col" width="5%" class="listViewThS1"><slot>&nbsp;</slot></td>
<td scope="col" width="50%" class="listViewThS1"><slot>{MOD.LBL_LIST_NAME}</slot></td>
</tr>
<!-- BEGIN: row -->
<tr height="20" onmouseover="setPointer(this, '{ECMDOCS.ID}', 'over', '{BG_COLOR}', '{BG_HILITE}', '{BG_CLICK}');"
onmouseout="setPointer(this, '{ECMDOCS.ID}', 'out', '{BG_COLOR}', '{BG_HILITE}', '{BG_CLICK}');"
onmousedown="setPointer(this, '{ECMDOCS.ID}', 'click', '{BG_COLOR}', '{BG_HILITE}', '{BG_CLICK}');">
<td scope='row' valign=TOP bgcolor="{BG_COLOR}" class="{ROW_COLOR}S1" ><slot>{ECMDOCS.NUMBER}</slot></td>
<td valign=TOP bgcolor="{BG_COLOR}" class="{ROW_COLOR}S1" ><slot>
<a href="{URL_PREFIX}index.php?action=DetailView&module=EcmDocs&record={ECMDOCS.ID}" class="listViewTdLinkS1">{ECMDOCS.NAME}</a></slot>
</td>
<td valign=TOP bgcolor="{BG_COLOR}" class="{ROW_COLOR}S1" ><slot>{ECMDOCS.STATUS}</slot></td>
<td nowrap align="center" valign=TOP bgcolor="{BG_COLOR}" class="{ROW_COLOR}S1" >
<slot>
<a class="listViewTdToolsS1" href="{URL_PREFIX}index.php?action=EditView&module=EcmDocs&record={ECMDOCS.ID}{RETURN_URL}">{EDIT_INLINE_PNG}</a>&nbsp;
<a class="listViewTdToolsS1" href="{URL_PREFIX}index.php?action=EditView&module=EcmDocs&record={ECMDOCS.ID}{RETURN_URL}">{APP.LNK_EDIT}</a>
</slot>
</td>
<td scope='row' valign=TOP bgcolor="{BG_COLOR}" class="{ROW_COLOR}S1" ><slot>{ECMDOCS.NAME}</slot></td>
<td valign=TOP bgcolor="{BG_COLOR}" class="{ROW_COLOR}S1" >
<slot>
<a href="{URL_PREFIX}index.php?action=DetailView&module=EcmDocs&record={ECMDOCS.ID}" class="listViewTdLinkS1">{ECMDOCS.NAME}</a>
</slot>
</td>
</tr>
<tr>
<td colspan="20" class="listViewHRS1"></td>
</tr>
<!-- END: row -->
</table>
<!-- END: main -->

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, 'EcmDocs');
$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' => 'ecmdoc_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='EcmDocs'>\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(\"EcmDocs\", 600, 400, \"\", false, true, {$encoded_popup_request_data});'>\n";
$button .= "</form>\n";
$ListView = new ListView();
$ListView->initNewXTemplate( 'modules/EcmDocs/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=EcmDocs&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", "ECMDOC");
?>

View File

@@ -0,0 +1,14 @@
<?
require_once("modules/EcmDocuments/dirstree.php");
$z="select * from ecmdocs where id='".$_REQUEST['record']."'";
$w=$GLOBALS['db']->query($z);
$r=$GLOBALS['db']->fetchByAssoc($w);
$guid=create_guid();
$GLOBALS['db']->query("INSERT INTO `ecmcorrespondenceins` (`id`, `name`, `date_entered`, `date_modified`, `modified_user_id`, `assigned_user_id`, `created_by`, `deleted`, `description`, `account_from`, `account_to`, `account_name_from`, `account_name_to`, `reg_date`, `document_date`, `delivery_date`, `stamp_date`, `relation`, `file_id`) VALUES ('".$guid."', '".$r['name']."', '".date("Y-m-d H:m:s")."', '".date("Y-m-d H:m:s")."', '".$r['modified_user_id']."', '".$r['assigned_user_id']."', '".$r['created_by']."', 0, '".$r['description']."', '', '".$r['account_id']."', '', '".$r['account_name']."', '".date("Y-m-d")."', NULL, NULL, NULL, 2, '".$r['file_id']."');");
move_relations("ecmdocuments_ecmdocs","ecmdocuments_ecmcorrespondenceins","ecmdoc_id","ecmcorrespondencein_id",$_REQUEST['record'],$guid,1);
$GLOBALS['db']->query("update ecmdocs set deleted='1' where id='".$_REQUEST['record']."'");
header("Location: index.php?module=EcmCorrespondenceIns&action=DetailView&record=".$guid);
?>

View File

@@ -0,0 +1,103 @@
<?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['EcmDoc'] = array (
'column_fields' => Array(
"id",
"name",
"date_entered",
"date_modified",
"modified_user_id",
"assigned_user_id",
"created_by",
//NEW COLUMN FIELDS
"description",
"group_id",
"group_name",
"account_id",
"account_name",
"contact_id",
"contact_name",
"relation",
"value",
"date",
"reminder_time",
"hour",
"minutes",
"reminder_date",
"status"
),
'list_fields' => Array(
'id',
'name',
'assigned_user_name',
'assigned_user_id',
//NEW LIST_FIELDS
'description',
'group_id',
'group_name',
'account_id',
'account_name',
'contact_id',
'contact_name',
'relation',
'value',
'date',
'reminder_time',
'hour',
'minutes',
'reminder_date',
'status'
),
'required_fields' => array(
'name'=>1
),
);
?>

View File

@@ -0,0 +1,164 @@
function doRequest(where,post,doFunction,error) {
this.Display = function(result) { doFunction(result.responseText); }
this.Fail = function(result){ if(error) alert(error);}
YAHOO.util.Connect.asyncRequest('POST',where,{success:this.Display,failure:this.Fail},post);
}
function changeValidateRequired(formname,name,required) {
for(var i=0; i<validate[formname].length; i++)
if(validate[formname][i][0] == name) { validate[formname][i][2] = required; break; }
}
function my_popup(module, field_array, call_back_function, form_name) {
if(!call_back_function) call_back_function = "set_return";
if(!form_name) form_name = "EditView";
return open_popup(module, 600, 400, "", true, false, {"call_back_function":call_back_function,"form_name":form_name,"field_to_name_array":field_array});
}
function addEvent(object,eventName,do_function) {
if(typeof(object) == "string") object = document.getElementById(object);
if(!object) { alert('No object in function addEvent!'); return; }
if(object.addEventListener) {
object.addEventListener(eventName, do_function, false);
} else {
object.attachEvent('on'+eventName, do_function);
}
}
function FormLoader() {
this.module;
this.createModule;
this.fieldName;
this.buttonName = 'FormLoaderButton';
this.load = function(module,createModule,fieldName) {
this.module = module;
this.createModule = createModule;
this.fieldName = fieldName;
}
this.createButton = function() {
var b = document.createElement('input');
b.type = 'button';
b.className = 'button';
b.name = this.buttonName;
b.value = 'Create';
b.FL = this;
b.onclick = function() {
if(this.FL.createModule == '') return;
if(this.FL.onButtonClick) var data = this.FL.onButtonClick();
window.open("index.php?module="+this.FL.module+"&action=formloader&to_pdf=1&loaderAction=ViewForm&loaderFieldName="+this.FL.fieldName+"&createModule="+this.FL.createModule+(data?data:''),"Create10"+this.FL.module,"resizable=yes,scrollbars=no,status=no,height=540,width=700").focus();
}
return b;
}
this.setEditDblClick = function(edit) { edit.FL=this; edit.ondblclick=this.editDblClick; }
this.editDblClick = function() {
if(this.FL.createModule == '') return;
if(this.FL.onEditDblClick) var data = this.FL.onEditDblClick();
window.open("index.php?module="+this.FL.module+"&action=formloader&to_pdf=1&loaderAction=ViewForm&loaderFieldName="+this.FL.fieldName+"&createModule="+this.FL.createModule+(data?data:''),"Create10"+this.FL.module,"resizable=yes,scrollbars=no,status=no,height=540,width=700").focus();
}
this.responseData = function(data) {
if(this.onResponseData) this.onResponseData(data);
}
this.onResponseData;
this.addPostData = function() {
if(this.onAddPostData)
return this.onAddPostData();
else
return '';
}
this.onAddPostData;
this.onButtonClick;
}

View File

@@ -0,0 +1,335 @@
<?php
$module = $_REQUEST['module'];
$cM = $_REQUEST['createModule'];
$lA = $_REQUEST['loaderAction'];
$fN = $_REQUEST['loaderFieldName'];
$record = $_REQUEST['record'];
if($lA == "EditView") {
ob_start();
$_REQUEST['module'] = $cM;
$_REQUEST['action'] = "EditView";
$_REQUEST['record'] = $record;
$_POST['module'] = $cM;
$_POST['action'] = "EditView";
$_POST['record'] = $record;
$_GET['record'] = $record;
include('index.php');
$out = ob_get_contents();
ob_end_clean();
echo $out;
return;
}
if($lA == "get_module_fields") {
global $beanList, $beanFiles;
$file = 'cache/modules/'.$cM.'/'.$beanList[$cM].'vardefs.php';
if(file_exists($file)) {
include($file);
$dict = $GLOBALS['dictionary'][$beanList[$cM]]['fields'];
}
else {
$file = 'modules/'.$cM.'/vardefs.php';
if(file_exists($file)) { include($file); $dict = $dictionary[$beanList[$cM]]['fields']; } else return;
}
$file = $beanFiles[$beanList[$cM]];
if(file_exists($file)) {
require_once($file);
$bean = new $beanList[$cM]();
$bean->retrieve($record);
if(isset($bean->id) && $bean->id != '') {
$arr = array();
foreach($dict as $key => $value) {
if(isset($bean->$value['name']) && (is_string($bean->$value['name']) || is_float($bean->$value['name']) || is_int($bean->$value['name']) || is_bool($bean->$value['name'])))
$arr[$value['name']] = $bean->$value['name'];
}
$json = getJSONobj();
echo '['.str_replace('&quot;','\"',$json->encode($arr)).']';
} else return;
}
return;
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=windows-1250">
<title></title>
<script type="text/javascript" src="include/javascript/sugar_grp1_yui.js?s=5.0.0c&c="></script>
</head>
<body>
<div id="hidder" style="position:absolute;left:0;top:0;width:105%;height:100%;background-color:white;visibility:visible;text-align:center;padding:40px;"><img src="themes/default/images/loading.gif"/></div>
<script language="javascript">
function doRequest(where,post,success,error) {
this.Display = function(result) { success(result.responseText); }
this.Fail = function(result){ if(error) error(result); }
YAHOO.util.Connect.asyncRequest('POST',where,{success:this.Display,failure:this.Fail},post);
}
function iframeLoad() {
var frame = document.getElementById("input_create");
var doc = frame.contentDocument;
if(typeof(doc) == "undefined" || !doc)
doc = frame.contentWindow.document;
//alert(doc.forms.DetailView);
if(doc && doc.forms && ((doc.forms.EditView || doc.forms.DetailView || doc.forms.Save) || doc.return_module_fields)) {
if(doc.forms.EditView) {
} else
if(doc.forms.DetailView) {
var record = doc.forms.DetailView.record;
if(record && record.value != "") {
doRequest(
"index.php",
"module="+module+"&action=formloader&loaderAction=get_module_fields&createModule="+cM+"&to_pdf=1&record="+record.value,
function(result) {
if(result == '')
window.close();
else {
var obj = eval(result);
if(obj) {
obj = obj[0];
eval('window.opener.'+fN+'.responseData(obj)');
//alert(window.parent);
}
window.close();
}
},
function(result) {
window.close();
}
);
} else window.close();
} else
if(doc.forms.Save) {
}
} else { window.close(); return; }
var main = doc.getElementById('main');
if(main) {
var dd = doc.createElement('div');
dd.innerHTML = '<table style="width:100%;"><tr id="main2"></tr></table>';
doc.body.insertBefore(dd,doc.body.firstChild);
doc.getElementById('main2').appendChild(main);
main.style.position = 'absolute';
main.style.left = 0;
main.style.top = 0;
for(var i=1; i<doc.body.childNodes.length; i++) if(doc.body.childNodes[i] !== main && doc.body.childNodes[i].style) {
doc.body.childNodes[i].style.visibility = 'hidden';
}
if(doc && doc.forms && !doc.forms.DetailView) doc.body.FormLoader = true;
}
}
var oldLocation = '';
setInterval(function(){
var frame = document.getElementById("input_create");
if(frame) {
var doc = frame.contentDocument;
if(doc == undefined || doc == null)
doc = frame.contentWindow.document;
if(doc && doc.body && doc.body.FormLoader) {
if(hidder.style.visibility = "visible") hidder.style.visibility = "hidden";
} else {
if(hidder.style.visibility = "hidden") hidder.style.visibility = "visible"
}
}
},60);
</script>
<?php
if($lA == "ViewForm") {
echo '<script language="javascript">
var module = "'.$module.'";
var cM = "'.$cM.'";
var lA = "'.$lA.'";
var fN = "'.$fN.'";
</script>';
$data = '';
foreach($_REQUEST as $key=>$value) {
if(strpos($key,"fl_") === 0) {
$data .= "&".substr($key,3)."=".$value;
}
}
echo "<iframe onload='iframeLoad();' frameborder='no' width='100%' height='100%' id='input_create' name='input_create' src='index.php?module=$module&action=formloader&to_pdf=1&loaderAction=EditView&createModule=$cM".$data."'></iframe>";
}
?>
</body>
</html>

View File

@@ -0,0 +1,7 @@
<?
$r=$GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select accounts.id as account_id,accounts.name as account_name from contacts inner join accounts_contacts on contacts.id=accounts_contacts.contact_id inner join accounts on accounts.id=accounts_contacts.account_id where contacts.id='".$_REQUEST['contact_id']."'"));
$account_name=$r['account_name'];
$account_id=$r['account_id'];
if($_REQUEST['id']==1)print $account_id;
else print $account_name;
?>

View File

@@ -0,0 +1,8 @@
<?
//require_once("modules/EcmProducts/ProductsStock.php");
$w=$GLOBALS['db']->query("select * from ecmdocs where status='Planned' and deleted='0'");
while($r=$GLOBALS['db']->fetchByAssoc($w))
{
addInfoToReminder($r['id'],"EcmDocs",$r['name'],$r['description'],"",$r['reminder_date']);
}
?>

164
modules/EcmDocs/helper.js Normal file
View File

@@ -0,0 +1,164 @@
function showdescription(id,title,desc,minus,object)
{
if(!minus)minus=0;
var sum=17-minus;
document.getElementById("desc").style.display="inline";
document.getElementById("desc-title").innerHTML=title;
document.getElementById("desc-desc").innerHTML=desc;
posy=findPosY(object)+sum;
posx=findPosX(object);
moveDiv(document.getElementById("desc"),posy,posx);
}
function hidedescription()
{
document.getElementById("desc").style.display="none";
}
function mintajaxget(url,tag)
{
var req=mint.Request();
req.Set('timeout',10000000);
req.Set('retryNum',0);
req.OnLoading=function(){$(tag).innerHTML='<img src="themes/default/images/loading.gif" border="0">';}
req.OnSuccess = function(){if($(tag).type=='text'){if(this.responseText!="")$(tag).value=this.responseText;}else{if(this.responseText!="")$(tag).innerHTML=this.responseText;}}
req.Send(url,tag);
}
function mintajaxpost(url,tag,form)
{
var req=mint.Request();
req.OnSuccess=function(){$(tag).innerHTML=this.responseText;}
req.OnLoading=function(){$(tag).innerHTML='<img src="themes/default/images/loading.gif" border="0">';}
req.SendForm(form);
}
function moveDiv(obj, mvTop, mvLeft) {
obj.style.position = "absolute";
obj.style.top = mvTop;
obj.style.left = mvLeft;
}
function getPos(inputElement) {
var coords = new Object();
coords.x = 0;
coords.y = 0;
try {
targetElement = inputElement;
if(targetElement.x && targetElement.y) {
coords.x = targetElement.x;
coords.y = targetElement.y;
} else {
if(targetElement.offsetParent) {
coords.x += targetElement.offsetLeft;
coords.y += targetElement.offsetTop;
while(targetElement = targetElement.offsetParent) {
coords.x += targetElement.offsetLeft;
coords.y += targetElement.offsetTop;
}
} else {
//alert("Could not find any reference for coordinate positioning.");
}
}
return coords;
} catch(error) {
//alert(error.msg);
return coords;
}
}
function findPosX(obj)
{
var curleft = 0;
if(obj.offsetParent)
while(1)
{
curleft += obj.offsetLeft;
if(!obj.offsetParent)
break;
obj = obj.offsetParent;
}
else if(obj.x)
curleft += obj.x;
return curleft;
//return getPos(obj).x;
}
function findPosY(obj)
{
var curtop = 0;
if(obj.offsetParent)
while(1)
{
curtop += obj.offsetTop;
if(!obj.offsetParent)
break;
obj = obj.offsetParent;
}
else if(obj.y)
curtop += obj.y;
return curtop;
//return getPos(obj).y;
}
function showdiv(id,div,minusy,minusx)
{
document.getElementById(div).style.display="inline";
posy=findPosY(document.getElementById(id))-minusy;
posx=findPosX(document.getElementById(id))-minusx;
moveDiv(document.getElementById(div),posy,posx);
}
function hidediv(div)
{
document.getElementById(div).style.display="none";
}
function showprice(id,price,order_by,sorder)
{
document.getElementById('price').value=price;
document.getElementById('product_id').value=id;
document.getElementById('order_by').value=order_by;
document.getElementById('sorder').value=sorder;
document.getElementById('price-block').style.display="block";
}
function getPrice(id,type)
{
var purchase_price=document.getElementById('purchase_price_'+id).value;
var margin_rate=document.getElementById('margin_rate_'+id).value;
var list_price;
list_price=parseFloat(purchase_price)/(1-parseFloat(margin_rate)/100);
if(!isNaN(list_price))document.getElementById('list_price_'+id).value=roundNumber(list_price,2);
}
function CurrencyFormatted(amount)
{
var i = parseFloat(amount);
if(isNaN(i)) { i = 0.00; }
var minus = '';
if(i < 0) { minus = '-'; }
i = Math.abs(i);
i = parseInt((i + .005) * 100);
i = i / 100;
s = new String(i);
if(s.indexOf('.') < 0) { s += '.00'; }
if(s.indexOf('.') == (s.length - 2)) { s += '0'; }
s = minus + s;
return s;
}
function roundN(rnum,rlength)
{
var newnumber = Math.round(rnum*Math.pow(10,rlength))/Math.pow(10,rlength);
return newnumber;
}
function roundNumber(num, dec)
{
if(!isNaN(num))return CurrencyFormatted(roundN(parseFloat(num),dec));
else return "";
}
function ShowHideBlock(id)
{
if(document.getElementById(id).style.display=="block")
{
document.getElementById(id).style.display="none"
}
else
{
document.getElementById(id).style.display="block"
}
}

61
modules/EcmDocs/index.php Normal file
View File

@@ -0,0 +1,61 @@
<?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;
echo "\n<p>\n";
echo get_module_title($mod_strings['LBL_MODULE_ID'], $mod_strings['LBL_MODULE_TITLE'], true);
echo "\n</p>\n";
include ('modules/EcmDocs/ListView.php');
?>

View File

@@ -0,0 +1,156 @@
<?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
'LBL_LIST_NO' => 'No',
'LBL_DATE' => 'Date',
'LBL_GROUP_NAME' => 'Group',
'LBL_LIST_VERSION' => 'Version',
'LBL_MODULE_NAME' => 'Documents',
'LBL_LIST_DATE' => 'Date',
// FOR SYSTEM USE
'LBL_MODULE_NAME' => 'Documents',
'LBL_MODULE_TITLE' => 'Documents: Home',
'LBL_MODULE_ID' => 'Documents',
'LBL_SEARCH_FORM_TITLE' => 'Documents Search',
'LBL_LIST_FORM_TITLE' => 'Documents List',
'LBL_NEW_FORM_TITLE' => 'New Documents',
'LBL_ECMDOCS' => 'Documents:',
'LBL_ECMDOCS_SUBJECT' => 'Documents 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_ECMDOCS' => 'My Files',
'LBL_LIST_ASSIGNED_TO_NAME' => 'Assigned User',
'LBL_LIST_EKMT_DESCRIPTION' => 'Description',
'LBL_LIST_EKMT_GROUP_ID' => 'Group',
'LBL_LIST_EKMT_GROUP_NAME' => 'Group',
'LBL_LIST_EKMT_RELATION' => 'Relation',
'LBL_LIST_REMINDER_TIME' => 'Reminder Time',
'LBL_LIST_WORTH' => 'Worth',
// FOR NOTIFICATION POPUPS
'NTC_DELETE_CONFIRMATION' => 'Are you sure you want to remove this document from this Document?',
'NTC_REMOVE_INVITEE' => 'Are you sure you want to remove this contact from the Document?',
'NTC_REMOVE_ACCOUNT_CONFIRMATION' => 'Are you sure you want to remove this document from this account?',
'ERR_DELETE_RECORD' => 'A record number must be specified to delete the ecmdoc.',
// 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_EKMT_DESCRIPTION' => 'Description',
'LBL_EKMT_GROUP_ID' => 'Group',
'LBL_EKMT_GROUP_NAME' => 'Group',
'LBL_EKMT_RELATION' => 'Relation',
// FOR GROUPS
'LBL_GROUP_MASTER' => 'DOCUMENT INFORMATION',
'LBL_GROUP_EKMT_DESCRIPTION' => '',
'LBL_GROUP_EKMT_GROUP_ID' => '',
'LBL_GROUP_EKMT_GROUP_NAME' => '',
'LBL_GROUP_EKMT_RELATION' => '',
// FOR SUBPANELS
'LBL_ECMDOCS_SUBPANEL_TITLE' => 'Documents',
'LBL_ACTIVITIES_SUBPANEL_TITLE' => 'Activities',
'LBL_HISTORY_SUBPANEL_TITLE' => 'History',
'LBL_ECMDOCS' => 'Documents',
// FOR MENU LABELS
'LNK_NEW_ECMDOCS' => 'Create Document',
'LNK_LIST_ECMDOC' => 'Documents List',
// FOR MENU LINKS
'LNK_NEW_ECMDOC' => 'Create Documents',
'LNK_ECMDOCS_LIST' => 'Documents',
'LNK_ECMDOCS_REPORTS' => 'Documents Reports',
'LNK_NEW_CREATE_GROUP' => 'Create Group',
'LNK_GROUPS' => 'Groups',
// FOR ADDITIONAL MENUS
// FOR DASHLETS
'LBL_LIST_ECMDOCS' => 'Documents',
'LBL_ACCOUNT_TO' => 'Account',
'LBL_CONTACT_TO' => 'Contact',
'LBL_CREATE_BUTTON_LABEL' => 'Create',
'LBL_DESCRIPTION' => 'Description',
'LBL_WORTH' => 'Worth',
'LBL_DATE' => 'Date',
'LBL_REMINDER_DATE' => 'Reminder Date',
'LBL_STATUS' => 'Status',
'LBL_FILES_TO_SAVE' => 'Files to save:',
'LBL_FILE' => 'File',
'LBL_GROUP_NAME_GR' => 'Group Name',
'LBL_LIST_GROUPS_NAME' => 'Name',
'LBL_LIST_GROUPS_DELETE' => 'Delete',
'LBL_REMINDER' => 'Reminder',
'LBL_DETAILVIEW_FILE_LIST' => 'File',
'LBL_DETAILVIEW_FILE_DOWNLOAD' => 'Download',
'LBL_DETAILVIEW_FILE_VERSION' => 'Version',
'LBL_DETAILVIEW_FILE_DATE_CREATED' => 'Date Created',
'LBL_UPLOADING_FILE' => 'Please wait... Uploading a file',
'LBL_GROUPS_ALL' => 'All',
);
?>

View File

@@ -0,0 +1,156 @@
<?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
'LBL_LIST_NO' => 'No',
'LBL_DATE' => 'Date',
'LBL_GROUP_NAME' => 'Group',
'LBL_LIST_VERSION' => 'Version',
'LBL_MODULE_NAME' => 'Documents',
'LBL_LIST_DATE' => 'Date',
// FOR SYSTEM USE
'LBL_MODULE_NAME' => 'Documents',
'LBL_MODULE_TITLE' => 'Documents: Home',
'LBL_MODULE_ID' => 'Documents',
'LBL_SEARCH_FORM_TITLE' => 'Documents Search',
'LBL_LIST_FORM_TITLE' => 'Documents List',
'LBL_NEW_FORM_TITLE' => 'New Documents',
'LBL_ECMDOCS' => 'Documents:',
'LBL_ECMDOCS_SUBJECT' => 'Documents 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_ECMDOCS' => 'My Files',
'LBL_LIST_ASSIGNED_TO_NAME' => 'Assigned User',
'LBL_LIST_EKMT_DESCRIPTION' => 'Description',
'LBL_LIST_EKMT_GROUP_ID' => 'Group',
'LBL_LIST_EKMT_GROUP_NAME' => 'Group',
'LBL_LIST_EKMT_RELATION' => 'Relation',
'LBL_LIST_REMINDER_TIME' => 'Reminder Time',
'LBL_LIST_WORTH' => 'Worth',
// FOR NOTIFICATION POPUPS
'NTC_DELETE_CONFIRMATION' => 'Are you sure you want to remove this document from this Document?',
'NTC_REMOVE_INVITEE' => 'Are you sure you want to remove this contact from the Document?',
'NTC_REMOVE_ACCOUNT_CONFIRMATION' => 'Are you sure you want to remove this document from this account?',
'ERR_DELETE_RECORD' => 'A record number must be specified to delete the ecmdoc.',
// 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_EKMT_DESCRIPTION' => 'Description',
'LBL_EKMT_GROUP_ID' => 'Group',
'LBL_EKMT_GROUP_NAME' => 'Group',
'LBL_EKMT_RELATION' => 'Relation',
// FOR GROUPS
'LBL_GROUP_MASTER' => 'DOCUMENT INFORMATION',
'LBL_GROUP_EKMT_DESCRIPTION' => '',
'LBL_GROUP_EKMT_GROUP_ID' => '',
'LBL_GROUP_EKMT_GROUP_NAME' => '',
'LBL_GROUP_EKMT_RELATION' => '',
// FOR SUBPANELS
'LBL_ECMDOCS_SUBPANEL_TITLE' => 'Documents',
'LBL_ACTIVITIES_SUBPANEL_TITLE' => 'Activities',
'LBL_HISTORY_SUBPANEL_TITLE' => 'History',
'LBL_ECMDOCS' => 'Documents',
// FOR MENU LABELS
'LNK_NEW_ECMDOCS' => 'Create Document',
'LNK_LIST_ECMDOC' => 'Documents List',
// FOR MENU LINKS
'LNK_NEW_ECMDOC' => 'Create Documents',
'LNK_ECMDOCS_LIST' => 'Documents',
'LNK_ECMDOCS_REPORTS' => 'Documents Reports',
'LNK_NEW_CREATE_GROUP' => 'Create Group',
'LNK_GROUPS' => 'Groups',
// FOR ADDITIONAL MENUS
// FOR DASHLETS
'LBL_LIST_ECMDOCS' => 'Documents',
'LBL_ACCOUNT_TO' => 'Account',
'LBL_CONTACT_TO' => 'Contact',
'LBL_CREATE_BUTTON_LABEL' => 'Create',
'LBL_DESCRIPTION' => 'Description',
'LBL_WORTH' => 'Worth',
'LBL_DATE' => 'Date',
'LBL_REMINDER_DATE' => 'Reminder Date',
'LBL_STATUS' => 'Status',
'LBL_FILES_TO_SAVE' => 'Files to save:',
'LBL_FILE' => 'File',
'LBL_GROUP_NAME_GR' => 'Group Name',
'LBL_LIST_GROUPS_NAME' => 'Name',
'LBL_LIST_GROUPS_DELETE' => 'Delete',
'LBL_REMINDER' => 'Reminder',
'LBL_DETAILVIEW_FILE_LIST' => 'File',
'LBL_DETAILVIEW_FILE_DOWNLOAD' => 'Download',
'LBL_DETAILVIEW_FILE_VERSION' => 'Version',
'LBL_DETAILVIEW_FILE_DATE_CREATED' => 'Date Created',
'LBL_UPLOADING_FILE' => 'Please wait... Uploading a file',
'LBL_GROUPS_ALL' => 'Alle',
);
?>

View File

@@ -0,0 +1,156 @@
<?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
'LBL_LIST_NO' => 'Nr',
'LBL_DATE' => 'Data',
'LBL_GROUP_NAME' => 'Grupa',
'LBL_LIST_VERSION' => 'Wersja',
'LBL_MODULE_NAME' => 'Dokumenty',
'LBL_LIST_DATE' => 'Data',
// FOR SYSTEM USE
'LBL_MODULE_NAME' => 'Dokumenty',
'LBL_MODULE_TITLE' => 'Dokumenty: Strona główna',
'LBL_MODULE_ID' => 'Dokumenty',
'LBL_SEARCH_FORM_TITLE' => 'Szukaj dokumentu',
'LBL_LIST_FORM_TITLE' => 'Lista Dokumentów',
'LBL_NEW_FORM_TITLE' => 'Nowy Dokument',
'LBL_ECMDOCS' => 'Dokumenty:',
'LBL_ECMDOCS_SUBJECT' => 'Tytuł dokumentu:',
'LBL_SYSTEM_ID' => 'System ID',
// FOR LIST VIEW
'LBL_LIST_NAME' => 'Nazwa',
'LBL_LIST_SUBJECT' => 'Tytuł',
'LBL_LIST_LAST_MODIFIED' => 'Ostatnia modyfikacja',
'LBL_LIST_MY_ECMDOCS' => 'Moje Pliki',
'LBL_LIST_ASSIGNED_TO_NAME' => 'Przypisany do',
'LBL_LIST_EKMT_DESCRIPTION' => 'Opis',
'LBL_LIST_EKMT_GROUP_ID' => 'Grupa',
'LBL_LIST_EKMT_GROUP_NAME' => 'Grupa',
'LBL_LIST_EKMT_RELATION' => 'Relacja',
'LBL_LIST_REMINDER_TIME' => 'Czas Przypomnienia',
'LBL_LIST_WORTH' => 'Wartość',
// FOR NOTIFICATION POPUPS
'NTC_DELETE_CONFIRMATION' => 'Jesteś pewny że chcesz usunąć ten Dokument?',
'NTC_REMOVE_INVITEE' => 'Jesteś pewny że chcesz usunąć ten kontakt z Dokumentu?',
'NTC_REMOVE_ACCOUNT_CONFIRMATION' => 'Jesteś pewny że chcesz usunąć ten Dokument od tego Klienta?',
'ERR_DELETE_RECORD' => 'Rekord musi być specyficzny aby móc usunąć dany Dokument',
// FOR DEFAULT FIELDS
'LBL_NAME' => 'Nazwa:',
'LBL_SUBJECT' => 'Nazwa:',
'LBL_CREATED_BY' => 'Utworzony Przez:',
'LBL_CREATED' => 'Utworzony Przez:',
'LBL_ASSIGNED_TO' => 'Przypisany Do:',
'LBL_ASSIGNED_USER_ID' => 'Przypisany Do:',
'LBL_DATE_ENTERED' => 'Czas Utworzenia:',
'LBL_DATE_CREATED' => 'Czas Utworzenia:',
'LBL_DATE_MODIFIED' => 'Ostatnia Modyfikacja',
'LBL_MODIFIED_BY' => 'Zmodyfikowane Przez:',
'LBL_MODIFIED' => 'Zmodifikowane Przez:',
'LBL_DATE_LAST_MODIFIED' => 'Data Ostatniej Modyfikacji:',
// FOR NEW FIELDS
'LBL_EKMT_DESCRIPTION' => 'Opis',
'LBL_EKMT_GROUP_ID' => 'Grupa',
'LBL_EKMT_GROUP_NAME' => 'Grupa',
'LBL_EKMT_RELATION' => 'Relacja',
// FOR GROUPS
'LBL_GROUP_MASTER' => 'DOCUMENT INFORMATION',
'LBL_GROUP_EKMT_DESCRIPTION' => '',
'LBL_GROUP_EKMT_GROUP_ID' => '',
'LBL_GROUP_EKMT_GROUP_NAME' => '',
'LBL_GROUP_EKMT_RELATION' => '',
// FOR SUBPANELS
'LBL_ECMDOCS_SUBPANEL_TITLE' => 'Dokumenty',
'LBL_ACTIVITIES_SUBPANEL_TITLE' => 'Działania',
'LBL_HISTORY_SUBPANEL_TITLE' => 'Historia',
'LBL_ECMDOCS' => 'Dokumenty',
// FOR MENU LABELS
'LNK_NEW_ECMDOCS' => 'Utwórz Dokument',
'LNK_LIST_ECMDOC' => 'Lista Dokumentów',
// FOR MENU LINKS
'LNK_NEW_ECMDOC' => 'Utwórz Dokument',
'LNK_ECMDOCS_LIST' => 'Dokumenty',
'LNK_ECMDOCS_REPORTS' => 'Raport Dokumentów',
'LNK_NEW_CREATE_GROUP' => 'Utwórz Grupę',
'LNK_GROUPS' => 'Grupy',
// FOR ADDITIONAL MENUS
// FOR DASHLETS
'LBL_LIST_ECMDOCS' => 'Dokumenty',
'LBL_ACCOUNT_TO' => 'Nazwa Klienta',
'LBL_CONTACT_TO' => 'Nazwa Kontatku',
'LBL_CREATE_BUTTON_LABEL' => 'Utwórz',
'LBL_DESCRIPTION' => 'Opis',
'LBL_WORTH' => 'Wartość',
'LBL_DATE' => 'Data',
'LBL_REMINDER_DATE' => 'Czas Przypomnienia',
'LBL_STATUS' => 'Status',
'LBL_FILES_TO_SAVE' => 'Pliki do zapisania:',
'LBL_FILE' => 'Plik',
'LBL_GROUP_NAME_GR' => 'Nazwa Grupy',
'LBL_LIST_GROUPS_NAME' => 'Nazwa',
'LBL_LIST_GROUPS_DELETE' => 'Usuń',
'LBL_REMINDER' => 'Przypominacz',
'LBL_DETAILVIEW_FILE_LIST' => 'Plik',
'LBL_DETAILVIEW_FILE_DOWNLOAD' => 'Pobierz',
'LBL_DETAILVIEW_FILE_VERSION' => 'Wersja',
'LBL_DETAILVIEW_FILE_DATE_CREATED' => 'Data Utworzenia',
'LBL_UPLOADING_FILE' => 'Proszę czekać... Ładuję plik...',
'LBL_GROUPS_ALL' => 'Wszystkie',
);
?>

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['EcmDocs'] = array(
//LIST OF WHAT SUBPANELS TO SHOW IN THE DETAILVIEW
'subpanel_setup' => array(
),
);
?>

View File

@@ -0,0 +1,19 @@
<?
function list_versions($file_id,$module="EcmDocs")
{
$z="select version,id,date_entered,name from ecmfiles_versions where file_id='".$file_id."' and deleted='0' order by version desc";
$w=$GLOBALS['db']->query($z);
while($r=$GLOBALS['db']->fetchByAssoc($w))
{
$versions.='<tr>
<td valign="top" class="tabDetailViewDF">'.$r['name'].'</td>
<td valign="top" class="tabDetailViewDF"><a href="DownloadEcmFile.php?record='.$r['id'].'">download</a></td>
<td valign="top" class="tabDetailViewDF">'.number_format($r['version'], 1, '.', '').'</td>
<td valign="top" class="tabDetailViewDF">'.$r['date_entered'];
if(check_is_admin($_SESSION['authenticated_user_id']))$versions.='&nbsp;&nbsp;<a style="cursor:pointer;" onclick="if(confirm(\'Are you sure you want to delete this version?\')){location.href=\'index.php?module=EcmDocs&action=DeleteVersion&record='.$r['id'].'&file_id='.$file_id.'&return_module='.$module.'&return_id='.$_REQUEST['record'].'\';}">delete</a>';
$versions.='</td>
</tr>';
}
return $versions;
}
?>

View File

@@ -0,0 +1,67 @@
<?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['EcmDocs'] =
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'),
'reminder_date' => array('query_type' => 'default'),
'date_entered' => array('query_type' => 'default'),
'date' => array('query_type' => 'default'),
'value' => array('query_type' => 'default'),
'description' => array('query_type' => 'default'),
'account_name' => array('query_type' => 'default'),
'contact_name' => array('query_type' => 'default'),
'group_name'=> array('query_type'=>'default', 'options' => 'ecmdocs_group_name_dom', 'template_var' => 'GROUP_NAME'),
);
?>

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 additionalDetailsEcmDoc($fields) {
static $mod_strings;
global $app_strings;
if(empty($mod_strings)) {
global $current_language;
$mod_strings = return_module_language($current_language, 'EcmDocs');
}
$overlib_string = '';
//BUILDER:START overlibstring
if(!empty($fields['DESCRIPTION'])){
$overlib_string .= '<b>'. $mod_strings['LBL_DESCRIPTION'] . '</b> ' . 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=EcmDocs&return_module=EcmDocs&record={$fields['ID']}",
'viewLink' => "index.php?action=DetailView&module=EcmDocs&return_module=EcmDocs&record={$fields['ID']}");
}
?>

View File

@@ -0,0 +1,81 @@
<?php
$viewdefs['EcmDocs']['EditView'] = array(
'templateMeta' => array('maxColumns' => '2',
'widths' => array(
array('label' => '10', 'field' => '30'),
array('label' => '10', 'field' => '30')
),
),
'panels' =>array (
'default' =>
array (
array (
'name',
'assigned_user_name',
),
array (
array (
'name' => 'account_name',
'fields' =>
array (
'account_name',
'account_id',
'btn1',
'createaccount',
),
),
array (
'name' => 'contact_name',
'fields' =>
array (
'contact_name',
'contact_id',
'btn',
'Create',
),
),
),
array (
'',
'group',
),
array (
array (
'name' => 'description',
'displayParams' =>
array (
'rows' => '8',
'cols' => '30',
),
),
'fileinput',
),
array (
'value',
'user_dateformat',
),
array (
'',
'status',
),
array (
'msel',
'',
),
),
)
);
?>

View File

@@ -0,0 +1,104 @@
<?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/EcmDocuments/dirstree.php");
$listViewDefs['EcmDocs'] = array(
'DESCRIPTION' => array(
'default' => true,
'label' => '&nbsp;',
'sortable' => false,
'customCode' => ' ',
'usage' => 'query_only',
),
'NAME' => array(
'width' => '30',
'label' => 'LBL_NAME',
'default' => true,
'customCode' => '<a onmouseover="showdescription(\'EcmDocName_{$ID}\',\'{$NAME}\',\'{$DESCRIPTION}\');" onmouseout="hidedescription();" id="link-EcmDocName_{$ID}" href="index.php?action=DetailView&module=EcmDocs&record={$ID}&offset={$OFFSET}&stamp={$STAMP}&fromunified=1" class="listViewTdLinkS1"><script language="javascript">cut_name("{$NAME}");</script></a>'),
'ACCOUNT_NAME' => array(
'width' => '30',
'label' => 'LBL_ACCOUNT',
'customCode' => '<a onmouseover="
var t=\'{$ACCOUNT_NAME}\';
if(t.length>20)showdescription(\'EcmDocAccountName_{$ID}\',\'{$ACCOUNT_NAME}\',\'\');" onmouseout="
var t=\'{$ACCOUNT_NAME}\';
if(t.length>20)hidedescription();" id="link-EcmDocAccountName_{$ID}" href="index.php?action=DetailView&module=Accounts&record={$ACCOUNT_ID}&offset={$OFFSET}&stamp={$STAMP}" class="listViewTdLinkS1"><script language="javascript">cut_name("{$ACCOUNT_NAME}");</script></a>',
'default' => true),
'GROUP_NAME' => array(
'width' => '20',
'label' => 'LBL_LIST_EKMT_GROUP_NAME',
'default' => true),
'REMINDER_DATE' => array(
'width' => '20',
'label' => 'LBL_LIST_REMINDER_TIME',
'default' => true),
'VALUE' => array(
'label' => 'LBL_LIST_WORTH',
'default' => true,
'width' => 10),
'DATE_ENTERED' => array(
'width' => '20',
'label' => 'LBL_DATE_ENTERED',
'default' => true),
/*
'ASSIGNED_USER_NAME' => array(
'width' => '2',
'label' => 'LBL_LIST_ASSIGNED_USER',
'default' => true),
*/
'pdfLinkString' => array(
'width' => '1',
'label' => '&nbsp;',
'sortable' => false,
'customCode' => '{$PDF_LINK}',
'default' => true),
);
?>

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' => 'EcmDoc',
'varName' => 'ECMDOC',
'orderBy' => 'ecmdocs.name',
'whereClauses' => array(
'name' => 'ecmdocs.name',
),
'searchInputs' => array('name', 'name')
);
?>

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']['EcmDocs'] = array(
'LBL_DETAILVIEW'=>array(
'template' => 'xtpl',
'template_file' => 'modules/EcmDocs/DetailView.html',
'php_file' => 'modules/EcmDocs/DetailView.php',
'type' => 'DetailView',
),
'LBL_EDITVIEW'=>array(
'template' => 'xtpl',
'template_file' => 'modules/EcmDocs/EditView.html',
'php_file' => 'modules/EcmDocs/EditView.php',
'type' => 'EditView',
),
'LBL_LISTVIEW'=>array(
'template' => 'listview',
'meta_file' => 'modules/EcmDocs/listviewdefs.php',
'type' => 'ListView',
),
'LBL_SEARCHFORM'=>array(
'template' => 'xtpl',
'template_file' => 'modules/EcmDocs/SearchForm.html',
'php_file' => 'modules/EcmDocs/ListView.php',
'type' => 'SearchForm',
),
);

View File

@@ -0,0 +1,116 @@
<?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(),
'where' => '',
'list_fields' => array(
/*'date_modified'=>array(
'vname' => 'LBL_LIST_NO',
'widget_class' => 'SubPanelAccountsEcmDocNo',
'sortable'=>false,
'width' => '2%',
),*/
'name'=>array(
'vname' => 'LBL_LIST_NAME',
'widget_class' => 'SubPanelDetailViewLink',
'sortable'=>false,
'width' => '50%',
),
/*'account_id'=>array(
'vname' => '&nbsp;',
'sortable'=>false,
'width' => '50%',
'customCode'=>'&nbsp;',
),
'account_name'=>array(
'vname' => 'Account',
'widget_class' => 'SubPanelDetailViewLinkAccountsEcmDocs',
'sortable'=>false,
'width' => '5%',
),
'version'=>array(
'vname' => 'LBL_LIST_VERSION',
'widget_class' => 'SubPanelEcmDocVersion',
'sortable'=>false,
'width' => '10%',
),
'date_entered'=>array(
'vname' => 'LBL_LIST_DATE',
'sortable'=>false,
'width' => '10%',
),
'edit_button'=>array(
'widget_class' => 'SubPanelEditButton',
'sortable'=>false,
'module' => 'EcmDocs',
'width' => '5%',
),
'remove_button'=>array(
'widget_class' => 'SubPanelRemoveButton',
'sortable'=>false,
'module' => 'EcmDocs',
'width' => '5%',
),
'file_id'=>array(
'usage'=>'query_only',
),
'download_button'=>array(
'widget_class' => 'SubPanelDownloadButton',
'file_id' => 'EcmContracts',
'width' => '5%',
),
*/
),
);
?>

View File

@@ -0,0 +1,115 @@
<?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.
********************************************************************************/
error_reporting(E_PARSE);
$subpanel_layout = array(
'top_buttons' => array(),
'where' => '',
'list_fields' => array(
/*'date_modified'=>array(
'vname' => 'LBL_LIST_NO',
'widget_class' => 'SubPanelAccountsEcmDocNo',
'sortable'=>false,
'width' => '2%',
),*/
'name'=>array(
'vname' => 'LBL_LIST_NAME',
'widget_class' => 'SubPanelDetailViewLink',
'sortable'=>false,
'width' => '50%',
),
/*'account_id'=>array(
'vname' => 'LBL_LIST_NAME',
'widget_class' => 'SubPanelDetailViewLinkEcmDocs',
'sortable'=>false,
'width' => '50%',
),*/
'account_name'=>array(
'vname' => 'Account',
'widget_class' => 'SubPanelDetailViewLinkAccountsEcmDocs',
'sortable'=>false,
'width' => '5%',
),
'version'=>array(
'vname' => 'LBL_LIST_VERSION',
'widget_class' => 'SubPanelEcmDocVersion',
'sortable'=>false,
'width' => '10%',
),
'date_entered'=>array(
'vname' => 'LBL_LIST_DATE',
'sortable'=>false,
'width' => '10%',
),
'edit_button'=>array(
'widget_class' => 'SubPanelEditButton',
'sortable'=>false,
'module' => 'EcmDocs',
'width' => '5%',
),
'remove_button'=>array(
'widget_class' => 'SubPanelRemoveButton',
'sortable'=>false,
'module' => 'EcmDocs',
'width' => '5%',
),
'file_id'=>array(
'usage'=>'query_only',
),
'download_button'=>array(
'widget_class' => 'SubPanelDownloadButton',
'file_id' => 'EcmContracts',
'width' => '5%',
),
),
);
?>

View File

@@ -0,0 +1,114 @@
<?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(),
'where' => '',
'list_fields' => array(
'name'=>array(
'vname' => 'LBL_LIST_NAME',
'widget_class' => 'SubPanelDetailViewLink',
'width' => '30%',
),
'account_id'=>array(
'vname' => 'Account',
'usage' => 'query_only',
'width' => '20%',
),
'account_name'=>array(
'vname' => 'LBL_ACCOUNT',
'widget_class' => 'SubPanelDetailViewLink',
'module_id' => '{$ACCOUNT_ID}',
'width' => '20%',
),
'group_name'=>array(
'vname' => 'Group',
'width' => '20%',
),
'reminder_date'=>array(
'vname' => 'Reminder Time',
'width' => '20%',
),
'value'=>array(
'vname' => 'Worth',
'width' => '10%',
),
'date_entered'=>array(
'vname' => 'LBL_LIST_DATE',
'width' => '20%',
),
'assigned_user_name'=>array(
'vname' => 'User',
'width' => '10%',
),
'edit_button'=>array(
'widget_class' => 'SubPanelEditButton',
'sortable'=>false,
'module' => 'EcmDocs',
'width' => '5%',
),
'remove_button'=>array(
'widget_class' => 'SubPanelRemoveEcmDocButton',
'sortable'=>false,
'module' => 'EcmDocs',
'width' => '5%',
),
'pdf_button'=>array(
'widget_class' => 'SubPanelPdfEcmDocButton',
'sortable'=>false,
'module' => 'EcmDocs',
'width' => '5%',
),
),
);
?>

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,24 @@
<?
$popup_field['EcmDocs']=array(
array(
"field"=>"contact_id",
"if_empty"=>false,
"to_insert"=>"id||"
),
array(
"field"=>"contact_name",
"if_empty"=>false,
"to_insert"=>"salutation||first_name||last_name||"
),
array(
"field"=>"account_id",
"if_empty"=>true,
"to_insert"=>"account_id||"
),
array(
"field"=>"account_name",
"if_empty"=>false,
"to_insert"=>"account_name||"
),
);
?>

View File

@@ -0,0 +1,100 @@
<?
function RowTemplate($r)
{
global $timedate;
$template=' <!-- BEGIN: row -->
<tr height="20">
<td scope=\'row\' valign=TOP class="oddListRowS1" bgcolor="#ffffff"><slot>
<div style="display:inline;" id="show_related_ecm'.$r['id'].'">'.show_related_ecm("ecmdocuments_ecmdocs","ecmdoc_id",$r['id'],"EcmDocs").'</div></td>
<td valign=TOP class="oddListRowS1" bgcolor="#ffffff" nowrap>
<a onmouseover="showdescription(\'EcmDoc_'.$r['id'].'\',\''.namejs($r['name']).'\',\''.namejs($r['description']).'\');" onmouseout="hidedescription();" id="link-EcmDoc_'.$r['id'].'" href="index.php?action=DetailView&module=EcmDocs&record='.$r['id'].'&offset=&stamp=" class="listViewTdLinkS1">
';
$text="";
$t="";
$i=0;
$t=$r['name'];
$num=20;
for($i=0;$i<20;$i++)
{
if($t[$i]=="Ă")$num++;
if($t[$i]=="Å")$num+2;
}
if(strlen($t)>$num-1)
{
for($i=0;$i<=$num;$i++)
{
$text.=$t[$i];
}
$text=$text."...";
}
else
{
$text=$t;
}
$template.=$text.'
</a> </slot>
</td>
<td valign=TOP class="oddListRowS1" bgcolor="#ffffff" nowrap><a onmouseover="
var t=\''.$r['account_name'].'\';
if(t.length>20)
{
showdescription(\'EcmDoc_'.$r['id'].'_name\',\''.namejs($r['account_name']).'\',\'\');
}
"
onmouseout="
var t=\''.$r['account_name'].'\';
if(t.length>20)
{
hidedescription();
}
" id="link-EcmDoc_'.$r['id'].'_name" href="index.php?action=DetailView&module=Accounts&record='.$r['account_id'].'&offset=&stamp=" class="listViewTdLinkS1">';
$text="";
$t="";
$i=0;
$t=$r['account_name'];
$num=20;
for($i=0;$i<20;$i++)
{
if($t[$i]=="Ă" || $t[$i]=="Å")$num++;
}
if(strlen($t)>$num-1)
{
for($i=0;$i<=$num;$i++)
{
$text.=$t[$i];
}
$text=$text."...";
}
else
{
$text=$t;
}
$template.=$text.'
</a></td>
<td valign=TOP class="oddListRowS1" bgcolor="#ffffff" nowrap>';
$date=$r['date_entered'];
$template.=$timedate->to_display(gmdate("Y-m-d",mktime(0, 0, 0, $date[5].$date[6], $date[8].$date[9], $date[0].$date[1].$date[2].$date[3])+86400),"Y-m-d",$timedate->get_date_format());
$template.='</td>';
$za="select version from ecmfiles_versions where file_id='".$r['file_id']."' order by version desc limit 1";
$ro=$GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query($za));
$template.='<td valign=TOP class="oddListRowS1" bgcolor="#ffffff" nowrap>'.$ro['version'].'</td>
<td valign=TOP class="oddListRowS1" bgcolor="#ffffff" nowrap><slot>'.$r['assigned_user_name'].'</slot></td>
<td valign=TOP class="oddListRowS1" bgcolor="#ffffff" nowrap>';
if($r['file_id'])$template.='<a title="PDF" href="DownloadEcmFile.php?file_id='.$r['file_id'].'"><img title="PDF" src="modules/EcmDocuments/images/pdf.gif" width="14" height="14" border="0"></a>';
else $template.='<img src="modules/EcmDocuments/images/pdf-off.gif" width="14" height="14" border="0" />';
$template.='</td>
<td valign=TOP class="oddListRowS1" bgcolor="#ffffff" nowrap>';
if($r['file_id'])$template.='<a title="E-mail" href="index.php?module=Emails&action=EditView&type=out&file_id='.$r['file_id'].'"><img title="E-mail" src="modules/EcmDocuments/images/email.jpg" border="0"></a>';
else $template.='<img src="modules/EcmDocuments/images/email-off.jpg" border="0" />';
$template.='</td>
<td valign=TOP class="oddListRowS1" bgcolor="#ffffff" nowrap><a title="Edit" href="index.php?module=EcmDocs&action=EditView&record='.$r['id'].'"><img title="Edit" src="themes/Sugar/images/edit_inline.gif" border="0"></a></td>
</tr>
<tr>
<td colspan="24" class="listViewHRS1"></td>
</tr>
<!-- END: row -->';
return $template;
}
?>

View File

@@ -0,0 +1,3 @@
<?
print $timedate->to_display($_REQUEST['value'], "Y-m-d", $timedate->get_date_format());
?>

View File

@@ -0,0 +1,15 @@
<?
ob_start();
session_start();
require_once("../../config.php");
$sql=mysql_connect($sugar_config['dbconfig']['db_host_name'],$sugar_config['dbconfig']['db_user_name'],$sugar_config['dbconfig']['db_password']);
mysql_select_db($sugar_config['dbconfig']['db_name']);
$GLOBALS['db']->query("set names utf8");
$GLOBALS['db']->query("set charaecterset utf8");
$z="select version from ecmfiles_versions where file_id='".$_GET['file_id']."' order by version desc limit 1";
$r=$GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query($z));
print $r['version'];
mysql_close($sql);
?>

3
modules/EcmDocs/test.php Normal file
View File

@@ -0,0 +1,3 @@
<?php
die('test');
?>

View File

@@ -0,0 +1,29 @@
<?
function show_time_select($value)
{
$d=floor($value/3600);
$m=$value-$d*3600;
$s=$m/60;
if(!$value)$s=1;
$minutes='<select name="reminder_minutes">';
for($i=0;$i<=59;$i++)
{
$v=$i*60;
$minutes.='<option value="'.$v.'"';
if($i==$s)$minutes.=' selected';
$minutes.='>'.$i.'</option>';
}
$minutes.='</select>';
$hours='<select name="reminder_hours">';
for($i=0;$i<=23;$i++)
{
$v=$i*3600;
$hours.='<option value="'.$v.'"';
if($i==$d)$hours.=' selected';
$hours.='>'.$i.'</option>';
}
$hours.='</select>';
return 'hours: '.$hours.' minutes: '.$minutes;
}
?>

View File

@@ -0,0 +1,59 @@
<form name="ecmdocsQuickCreate" id="ecmdocsQuickCreate" method="POST" action="index.php">
<input type="hidden" name="module" value="EcmDocs">
<input type="hidden" name="return_action" value="{$REQUEST.return_action}">
<input type="hidden" name="return_module" value="{$REQUEST.return_module}">
<input type="hidden" name="return_id" value="{$REQUEST.return_id}">
<input type="hidden" name="action" value='Save'>
<input type="hidden" name="duplicate_parent_id" value="{$REQUEST.duplicate_parent_id}">
<input type="hidden" name="to_pdf" value='1'>
<input id='assigned_user_id' name='assigned_user_id' type="hidden" value="{$ASSIGNED_USER_ID}" />
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td align="left" style="padding-bottom: 2px;">
<input title= "{$APP.LBL_SAVE_BUTTON_TITLE}"
accessKey= "{$APP.LBL_SAVE_BUTTON_KEY}"
class= "button"
type= "submit"
name= "button" {$saveOnclick|default:"onclick=\"return check_form('EcmDocsQuickCreate');\""} value=" {$APP.LBL_SAVE_BUTTON_LABEL} " >
<input title= "{$APP.LBL_CANCEL_BUTTON_TITLE}"
accessKey= "{$APP.LBL_CANCEL_BUTTON_KEY}"
class= "button"
type= "submit"
name= "button" {$cancelOnclick|default:"onclick=\"this.form.action.value='$RETURN_ACTION'; this.form.module.value='$RETURN_MODULE'; this.form.record.value='$RETURN_ID'\""}
value= " {$APP.LBL_CANCEL_BUTTON_LABEL} ">
<input title= "{$APP.LBL_FULL_FORM_BUTTON_TITLE}"
accessKey= "{$APP.LBL_FULL_FORM_BUTTON_KEY}"
class= "button"
type= "submit"
name= "button"
onclick= "this.form.to_pdf.value='0';this.form.action.value='EditView'; this.form.module.value='EcmDocs';"
value= " {$APP.LBL_FULL_FORM_BUTTON_LABEL} ">
</td>
<td align="right" nowrap>
<span class="required">{$APP.LBL_REQUIRED_SYMBOL}</span>
{$APP.NTC_REQUIRED}
</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="tabForm">
<tr>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<th align="left" class="dataLabel" colspan="4">
<h4 class="dataLabel"><slot>{$MOD.LBL_ECMDOC_INFORMATION}</slot></h4>
</th>
</tr>
<tr>
<td valign="top" class="dataLabel" width="15%"><slot>{$MOD.LBL_NAME} <span class="required">{$APP.LBL_REQUIRED_SYMBOL}</span></slot></td>
<td width="35%"><slot><textarea name='name' cols="40" tabindex='1' rows="1">{$NAME}</textarea></slot></td>
</tr>
</table>
</form>
<script>
{$additionalScripts}
</script>

View File

@@ -0,0 +1,127 @@
<?
//require_once("modules/EcmDocuments/guid.php");
function copySmbFile($from,$to)
{
$data=file_get_contents(str_replace("[s]"," ",$from));
$h = fopen($to,'w+');
fwrite($h,$data);
}
function copyToOcr($file_id)
{
$r=$GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select filename from ecmfiles_versions where file_id='".$file_id."' and deleted='0' order by date_entered desc limit 1"));
$exp=explode(".",$r['filename']);
$roz=$exp[count($exp)-1];
$exp1=explode("/",$r['filename']);
$filename=$exp1[count($exp1)-1];
if($roz=="pdf")copy("/srv/www/htdocs/crm/".$r['filename'],"/srv/www/htdocs/crm/extras/OCR/IN/".$filename);
}
function upload_file($nazwa,$gdzie)
{
$time=create_guid();
$plik_tmp = $_FILES[$nazwa]['tmp_name'];
$plik_nazwa = $_FILES[$nazwa]['name'];
$plik_rozmiar = $_FILES[$nazwa]['size'];
$file_extension = strtolower(substr(strrchr($plik_nazwa,"."),1));
if(is_uploaded_file($plik_tmp))
{
if(file_exists($gdzie.$data.".".$file_extension))$time.="n";
move_uploaded_file($plik_tmp,$gdzie.$time.".".$file_extension);
}
return $gdzie.$time.".".$file_extension;
}
function add_samba_file($samba_file)
{
$exp=explode("/",str_replace("[s]"," ",$samba_file));
$sname=$exp[count($exp)-1];
$sexp=explode(".",$sname);
$samba_file="modules/EcmDocs/files/".create_guid().".".$sexp[count($sexp)-1];
copySmbFile("smb://janek:test55...@192.168.1.3/Celtic/CRM/Files/".str_replace("[s]"," ",$_REQUEST['samba_file']),$samba_file);
$file_id=create_guid();
$GLOBALS['db']->query("insert into ecmfiles(id,name,date_entered,deleted) values('".$file_id."','".$sname."','".date("Y-m-d H:m:s")."','0')");
$GLOBALS['db']->query("insert into ecmfiles_versions(id,version,filename,name,file_id,date_entered,deleted) values('".create_guid()."','1.0','".$samba_file."','".$sname."','".$file_id."','".date("Y-m-d H:m:s")."','0')");
copyToOcr($file_id);
return $file_id;
}
function add_file($input_name,$record,$table,$dir)
{
error_reporting(E_ALL);
if($_FILES[$input_name]['name'] || $_SESSION['emails_files'])
{
if($record)
{
$r=$GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query($z="select file_id from ".$table." where id='".$record."'"));
$file_id=$r['file_id'];
}
else $file_id="";
if($file_id=="" || !$file_id)
{
$file_id=create_guid();
if($GLOBALS['db']->query("insert into ecmfiles(id,name,date_entered,deleted) values('".$file_id."','".$_FILES[$input_name]['name']."','".date("Y-m-d H:m:s")."','0')"))
{
if($_SESSION['emails_files'])
{
$ver=1.0;
for($i=0;$i<count($_REQUEST['efiles']);$i++)
{
$nn=explode("/",$_REQUEST['efiles'][$i]);
$nid=$nn[count($nn)-1];
$r=$GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select filename from notes where id='".$nid."'"));
$nname=$r['filename'];
$GLOBALS['db']->query("insert into ecmfiles_versions(id,version,filename,name,file_id,date_entered,deleted) values('".create_guid()."','".$ver."','".$_REQUEST['efiles'][$i]."','".$nname."','".$file_id."','".date("Y-m-d H:m:s")."','0')");
$ver+=0.1;
}
}
elseif($name=upload_file($input_name,$dir))
{
$GLOBALS['db']->query("insert into ecmfiles_versions(id,version,filename,name,file_id,date_entered,deleted) values('".create_guid()."','1.0','".$name."','".$_FILES[$input_name]['name']."','".$file_id."','".date("Y-m-d H:m:s")."','0')");
}
}
}
else
{
$r=$GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select max(version) as max from ecmfiles_versions where file_id='".$file_id."' and deleted='0'"));
$version=$r['max'];
$version=$version+0.1;
if($_SESSION['emails_files'])
{
for($i=0;$i<count($_REQUEST['efiles']);$i++)
{
$nn=explode("/",$_REQUEST['efiles'][$i]);
$nid=$nn[count($nn)-1];
$r=$GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select filename from notes where id='".$nid."'"));
$nname=$r['filename'];
$GLOBALS['db']->query("insert into ecmfiles_versions(id,version,filename,name,file_id,date_entered,deleted) values('".create_guid()."','".$version."','".$_REQUEST['efiles'][$i]."','".$nname."','".$file_id."','".date("Y-m-d H:m:s")."','0')");
}
}
elseif($name=upload_file($input_name,$dir))
{
$GLOBALS['db']->query("insert into ecmfiles_versions(id,version,filename,name,file_id,date_entered,deleted) values('".create_guid()."','".$version."','".$name."','".$_FILES[$input_name]['name']."','".$file_id."','".date("Y-m-d H:m:s")."','0')");
}
}
}
if(isset($_POST['inbound_email_id']))
{
for($i=0;$i<count($_POST['efiles']);$i++)
{
$nn=explode("/",$_POST['efiles'][$i]);
$nid=$nn[count($nn)-1];
$r=$GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select id,name from notes where id='".$nid."'"));
if($_POST['emaildel']==1)$GLOBALS['db']->query("delete from notes where id='".$nid."'");
$nname=$r['id'];
$namef=explode(".",$r['name']);
$fname=$namef[count($namef)-1];
//print "mmm";
if(copy("cache/upload/".$nname,"modules/EcmDocs/files/".$nname.".".$fname))print "ok";
if($_POST['emaildel']==1)unlink("cache/upload/".$nname);
$GLOBALS['db']->query("update ecmfiles_versions set filename='modules/EcmDocs/files/".$nname.".".$fname."' where filename='cache/upload/".$nname."'");
}
if($_POST['emaildel']==1)$GLOBALS['db']->query("delete from emails where id='".$_POST['inbound_email_id']."'");
}
$_SESSION['filename_email']="";
//copyToOcr($file_id);
return $file_id;
}
?>

391
modules/EcmDocs/vardefs.php Normal file
View File

@@ -0,0 +1,391 @@
<?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['EcmDoc'] = array(
'table' => 'ecmdocs',
'audited' => true,
'comment' => 'EcmDocs',
'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' => 'ecmdocs_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' => 'ecmdocs_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' => 'ecmdocs_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',
'unified_search' => true,
),
'group_id' => array(
'type' => 'varchar',
'name' => 'group_id',
'vname' => 'LBL_GROUP_ID',
'comment' => 'Group',
'required_option' => 'true',
'max_size' => '36',
'len' => '36',
),
'group_name' => array(
'type' => 'varchar',
'name' => 'group_name',
'vname' => 'LBL_GROUP_NAME',
'comment' => 'Group',
'required_option' => 'true',
'max_size' => '255',
'unified_search' => true,
'len' => '255',
),
'relation' => array(
'type' => 'int',
'name' => 'relation',
'vname' => 'LBL_RELATION',
'comment' => 'Relation',
'default' => '0',
'max_size' => '1',
'min_value' => '0',
'max_value' => '1',
'len' => '1',
),
'file_id' => array(
'type' => 'varchar',
'name' => 'file_id',
'vname' => 'LBL_FILE_ID',
'comment' => 'File Id',
'required_option' => 'true',
'max_size' => '36',
'len' => '36',
),
'account_id' => array(
'type' => 'varchar',
'name' => 'account_id',
'vname' => 'LBL_ACCOUNT_ID',
'comment' => 'Account',
'required_option' => 'true',
'max_size' => '36',
'len' => '36',
),
'account_name' => array(
'type' => 'varchar',
'name' => 'account_name',
'vname' => 'LBL_ACCOUNT_NAME',
'comment' => 'Account',
'required_option' => 'true',
'max_size' => '255',
'unified_search' => true,
'len' => '255',
),
'contact_id' => array(
'type' => 'varchar',
'name' => 'contact_id',
'vname' => 'LBL_CONTACT_ID',
'comment' => 'Contact',
'required_option' => 'true',
'max_size' => '36',
'len' => '36',
),
'contact_name' => array(
'type' => 'varchar',
'name' => 'contact_name',
'vname' => 'LBL_CONTACT_NAME',
'comment' => 'Contact',
'required_option' => 'true',
'max_size' => '255',
'unified_search' => true,
'len' => '255',
),
'ocr_text' => array(
'type' => 'text',
'name' => 'ocr_text',
'vname' => 'LBL_OCR_TEXT',
'comment' => 'Ocr',
'unified_search' => true,
),
'value' => array(
'type' => 'decimal',
'name' => 'value',
'vname' => 'LBL_VALUE',
'len' => '10,2',
'unified_search' => true,
),
'date' => array(
'type' => 'datetime',
'name' => 'date',
'vname' => 'LBL_DATE',
'unified_search' => true,
),
'reminder_time' => array(
'type' => 'int',
'name' => 'reminder_time',
'vname' => 'LBL_REMINDER_TIME',
'len' => 4,
),
'hour' => array(
'type' => 'int',
'name' => 'hour',
'vname' => 'LBL_REMINDER_TIME',
'len' => 4,
),
'minutes' => array(
'type' => 'int',
'name' => 'minutes',
'vname' => 'LBL_REMINDER_TIME',
'len' => 4,
),
'reminder_date' => array(
'type' => 'datetime',
'name' => 'reminder_date',
'vname' => 'LBL_DATE',
'unified_search' => true,
),
'status' => array(
'type' => 'varchar',
'name' => 'status',
'vname' => 'LBL_STATUS',
),
//FOR SUBPANELS
'account' => array (
'name' => 'account',
'type' => 'link',
'relationship' => 'ecmdocs_account',
'source'=>'non-db',
'vname'=>'LBL_ACCOUNTS'
),
'contact' => array (
'name' => 'contact',
'type' => 'link',
'relationship' => 'ecmdocs_contact',
'source'=>'non-db',
'vname'=>'LBL_CONTACTS'
),
),
//INDICES SECTION
'indices' => array (
array('name' =>'ecmdocsspk', 'type' =>'primary', 'fields'=>array('id')),
array('name' =>'idx_ecmdocs_name', 'type' =>'index', 'fields'=>array('name'))
)
//RELATIONSHIPS SECTION
, 'relationships' => array (
'ecmdocs_assigned_user' => array(
'lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
'rhs_module'=> 'EcmDocs', 'rhs_table'=> 'ecmdocs', 'rhs_key' => 'assigned_user_id',
'relationship_type'=>'one-to-many')
,'ecmdocs_modified_user' => array(
'lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
'rhs_module'=> 'EcmDocs', 'rhs_table'=> 'ecmdocs', 'rhs_key' => 'modified_user_id',
'relationship_type'=>'one-to-many')
,'ecmdocs_created_by' => array(
'lhs_module'=> 'Users', 'lhs_table'=> 'users', 'lhs_key' => 'id',
'rhs_module'=> 'EcmDocs', 'rhs_table'=> 'ecmdocs', 'rhs_key' => 'created_by',
'relationship_type'=>'one-to-many')
,
'ecmdocs_account' => array (
'lhs_module' => 'Accounts', 'lhs_table' => 'accounts', 'lhs_key' => 'id',
'rhs_module' => 'EcmDocs', 'rhs_table' => 'ecmdocs', 'rhs_key' => 'account_id',
'relationship_type' => 'one-to-many'
),
'ecmdocs_contact' => array (
'lhs_module' => 'Contacts', 'lhs_table' => 'contacts', 'lhs_key' => 'id',
'rhs_module' => 'EcmDocs', 'rhs_table' => 'ecmdocs', 'rhs_key' => 'contact_id',
'relationship_type' => 'one-to-many'
),
),
//THIS FLAG ENABLES OPTIMISTIC LOCKING FOR SAVES FROM EDITVIEW
'optimistic_locking'=>true,
);
?>