Add php files
This commit is contained in:
15
modules/EcmDocuments/AddRelation.php
Executable file
15
modules/EcmDocuments/AddRelation.php
Executable file
@@ -0,0 +1,15 @@
|
||||
<?
|
||||
$z="insert into ecmdocuments_".$_GET['relation']."(id,ecmdocument_id,".$_GET['parent_col'].",deleted) values('".create_guid()."','".$_GET['record']."','".$_GET['parent_id']."','0')";
|
||||
print $z;
|
||||
mysql_query($z);
|
||||
if($_GET['relation']=="correspondences" ||
|
||||
$_GET['relation']=="correspondenceouts" ||
|
||||
$_GET['relation']=="contracts" ||
|
||||
$_GET['relation']=="ecminvoices")
|
||||
{
|
||||
$z="update ".$_GET['relation']." set relation='1' where id='".$_GET['parent_id']."'";
|
||||
mysql_query($z);
|
||||
}
|
||||
|
||||
header("Location: index.php?module=EcmDocuments&action=DetailView&record=".$_GET['record']);
|
||||
?>
|
||||
19
modules/EcmDocuments/CloneDir.php
Executable file
19
modules/EcmDocuments/CloneDir.php
Executable file
@@ -0,0 +1,19 @@
|
||||
<?
|
||||
require_once('include/formbase.php');
|
||||
require_once("modules/EcmDocuments/dirstree.php");
|
||||
|
||||
$z="select id,name from ecmdocuments where iddir='".$_GET['idkatalogu']."' order by name desc limit 1";
|
||||
$r=mysql_fetch_array(mysql_query($z));
|
||||
$name=$r['name'];
|
||||
|
||||
$nn=getnextdirnumber($_GET['idkatalogu']);
|
||||
|
||||
$name=$r[count($r)];
|
||||
$idx=create_guid();
|
||||
$z="insert into ecmdocuments(id,iddir,name,isdir,assigned_user_id,modified_user_id,date_entered,date_modified,no) values('".$idx."','".$_GET['idkatalogu']."','".$_GET['dirname']."','1','".$current_user->id."','".$current_user->id."','".date("Y-m-d H:m:s")."','".date("Y-m-d H:m:s")."','".$nn."')";
|
||||
$w=mysql_query($z);
|
||||
|
||||
clone_dir($_REQUEST['idkat'],$idx);
|
||||
clonepermissions($_REQUEST['idkat'],$idx);
|
||||
handleRedirect($_GET['idkat'],'EcmDocuments');
|
||||
?>
|
||||
55
modules/EcmDocuments/CloseAllReminder.php
Executable file
55
modules/EcmDocuments/CloseAllReminder.php
Executable file
@@ -0,0 +1,55 @@
|
||||
<?
|
||||
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']);
|
||||
function getList($type)
|
||||
{
|
||||
$i=0;
|
||||
if($type=="tasks")$status="Completed";
|
||||
else $status="Held";
|
||||
$w=mysql_query("select * from ".$type." where deleted='0' and status!='".$status."' order by date_start desc, time_start asc");
|
||||
while($r=mysql_fetch_array($w))
|
||||
{
|
||||
if($r['date_start']<date("Y-m-d"))
|
||||
{
|
||||
$name[$i]['date_start']=$r['date_start'];
|
||||
$name[$i]['time_start']=$r['time_start'];
|
||||
$name[$i]['name']=$r['name'];
|
||||
$name[$i]['id']=$r['id'];
|
||||
$name[$i]['type']=$type;
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
return $name;
|
||||
}
|
||||
$meetings=getList("meetings");
|
||||
$calls=getList("calls");
|
||||
$tasks=getList("tasks");
|
||||
|
||||
for($i=0;$i<count($meetings);$i++)$name[]=$meetings[$i];
|
||||
for($i=0;$i<count($calls);$i++)$name[]=$calls[$i];
|
||||
for($i=0;$i<count($tasks);$i++)$name[]=$tasks[$i];
|
||||
rsort($name);
|
||||
foreach($name as $value)
|
||||
{
|
||||
if($value['type']=="meetings")
|
||||
{
|
||||
$img="Meetings";
|
||||
$status="Held";
|
||||
}
|
||||
if($value['type']=="calls")
|
||||
{
|
||||
$img="Calls";
|
||||
$status="Held";
|
||||
}
|
||||
if($value['type']=="tasks")
|
||||
{
|
||||
$img="Tasks";
|
||||
$status="Completed";
|
||||
}
|
||||
mysql_query("update ".$value['type']." set status='".$status."' where id='".$value['id']."'");
|
||||
}
|
||||
header("Location: ReminderWindow.php");
|
||||
mysql_close($sql);
|
||||
?>
|
||||
9
modules/EcmDocuments/CloseReminder.php
Executable file
9
modules/EcmDocuments/CloseReminder.php
Executable file
@@ -0,0 +1,9 @@
|
||||
<?
|
||||
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']);
|
||||
mysql_query("update ".$_REQUEST['type']." set status='".$_REQUEST['status']."' where id='".$_REQUEST['record']."'");
|
||||
header("Location: ReminderWindow.php");
|
||||
mysql_close($sql);
|
||||
?>
|
||||
32
modules/EcmDocuments/CreateDir.php
Executable file
32
modules/EcmDocuments/CreateDir.php
Executable file
@@ -0,0 +1,32 @@
|
||||
<?
|
||||
require_once("modules/EcmDocuments/dirstree.php");
|
||||
require_once("include/formbase.php");
|
||||
if($_GET['subfoldername'])
|
||||
{
|
||||
$nn=getnextdirnumber($_REQUEST['record']);
|
||||
$z="insert into ecmdocuments(id,name,iddir,isdir,assigned_user_id,modified_user_id,date_entered,date_modified,created_by,deleted,no) values('".create_guid()."','".$_GET['subfoldername']."','".$_REQUEST['record']."','1','".$current_user->id."','".$current_user->id."','".date("Y-m-d H:m:s")."','".date("Y-m-d H:m:s")."','".$current_user->id."','0','".$nn."')";
|
||||
mysql_query($z);
|
||||
}
|
||||
$bl=explode("||",$_GET['record']."||".check_block($_GET['record'],""));
|
||||
for($i=count($bl)-1;$i>=0;$i--)
|
||||
{
|
||||
$z="select name,id,no from ecmdocuments where id='".$bl[$i]."'";
|
||||
$w=mysql_query($z);
|
||||
$r=mysql_fetch_array($w);
|
||||
if($r['name'])$linked_path.="<a class='utilsLink' href='index.php?module=EcmDocuments&action=DetailView&record=".$r['id']."'>".$r['no'].".".$r['name']."</a> / ";
|
||||
}
|
||||
$pathsamba="";
|
||||
for($i=count($bl)-1;$i>=0;$i--)
|
||||
{
|
||||
$z="select name from ecmdocuments where id='".$bl[$i]."'";
|
||||
$w=mysql_query($z);
|
||||
$r=mysql_fetch_array($w);
|
||||
$c=array("a","s","z","z","c","n","l","<EFBFBD>","e");
|
||||
$p=array("a","s","z","z","c","n","l","o","e");
|
||||
$pathsamba.="/".str_replace($c,$p,$r['name']);
|
||||
}
|
||||
$pathsamba=str_replace("///","/",$pathsamba);
|
||||
$pathsamba="smb://janek:test55...@192.168.1.3/Celtic/CRM/Files".$patsamba."/".$_GET['subfoldername'];
|
||||
mkdir($pathsamba,777);
|
||||
handleRedirect($_REQUEST['record'],"EcmDocuments");
|
||||
?>
|
||||
60
modules/EcmDocuments/CreateProject.php
Executable file
60
modules/EcmDocuments/CreateProject.php
Executable file
@@ -0,0 +1,60 @@
|
||||
<?
|
||||
require_once('include/formbase.php');
|
||||
require_once("modules/EcmDocuments/dirstree.php");
|
||||
|
||||
$z="select name from ecmdocuments where id='".$_GET['fromdir']."'";
|
||||
$w=mysql_query($z);
|
||||
$r=mysql_fetch_array($w);
|
||||
$name=$r['name'];
|
||||
$project_id=createdir($_GET['todir'],$name,getnextdirnumber($_GET['todir']));
|
||||
$projectoneid=269;
|
||||
clone_dir($projectoneid,$project_id);
|
||||
|
||||
$z="select id from ecmdocuments where name='Building Docs' and iddir='".$project_id."'";
|
||||
$w=mysql_query($z);
|
||||
$r=mysql_fetch_array($w);
|
||||
$delbuilding=$r['id'];
|
||||
|
||||
$z="select id from ecmdocuments where name='Corporate' and iddir='".$project_id."'";
|
||||
$w=mysql_query($z);
|
||||
$r=mysql_fetch_array($w);
|
||||
$delcorporate=$r['id'];
|
||||
|
||||
$z="select id from ecmdocuments where name='Acquistion' and iddir='".$project_id."'";
|
||||
$w=mysql_query($z);
|
||||
$r=mysql_fetch_array($w);
|
||||
$delacquisition=$r['id'];
|
||||
|
||||
mysql_query("delete from ecmdocuments where id='".$delbuilding."'");
|
||||
mysql_query("delete from ecmdocuments where id='".$delcorporate."'");
|
||||
mysql_query("delete from ecmdocuments where id='".$delacquisition."'");
|
||||
$acquisition_id=createdir($project_id,"Acquisition",1);
|
||||
|
||||
$z="select name,id from ecmdocuments where iddir='".$_GET['fromdir']."'";
|
||||
$w=mysql_query($z);
|
||||
while($r=mysql_fetch_array($w))
|
||||
{
|
||||
if($r['name']=="Building Docs")$buildingdocs_id=$r['id'];
|
||||
if($r['name']=="Corporate Docs")$corporatedocs_id=$r['id'];
|
||||
if($r['name']!="Corporate Docs" && $r['name']!="Building Docs")
|
||||
{
|
||||
$tab_id[]=$r['id'];
|
||||
$tab_name[]=$r['name'];
|
||||
}
|
||||
}
|
||||
movedir($buildingdocs_id,$project_id,"Building Docs",2);
|
||||
movedir($corporatedocs_id,$project_id,"Corporate Docs",3);
|
||||
$nnn=4;
|
||||
for($i=0;$i<=count($tab_id)-1;$i++)
|
||||
{
|
||||
$name=$tab_name[$i];
|
||||
movedir($tab_id[$i],$acquisition_id,$name,$nnn);
|
||||
$nnn++;
|
||||
}
|
||||
reorganizedir($project_id);
|
||||
reorganizedir($acquisition_id);
|
||||
|
||||
delete_recursive($_GET['fromdir']);
|
||||
|
||||
handleRedirect($project_id,'EcmDocuments');
|
||||
?>
|
||||
50
modules/EcmDocuments/CreateProjectInProgress.php
Executable file
50
modules/EcmDocuments/CreateProjectInProgress.php
Executable file
@@ -0,0 +1,50 @@
|
||||
<?
|
||||
require_once('include/formbase.php');
|
||||
require_once("modules/EcmDocuments/dirstree.php");
|
||||
|
||||
$z="select id from ecmdocuments where iddir='".$_GET['fromdir']."' and name!='Acquisition' and name!='Building Docs' and name!='Corporate Docs'";
|
||||
$w=mysql_query($z);
|
||||
while($r=mysql_fetch_array($w))$del_id[]=$r['id'];
|
||||
for($i=0;$i<=count($del_id)-1;$i++)delete_recursive($del_id[$i]);
|
||||
|
||||
$z="select name from ecmdocuments where id='".$_GET['fromdir']."'";
|
||||
$w=mysql_query($z);
|
||||
$r=mysql_fetch_array($w);
|
||||
$name=$r['name'];
|
||||
|
||||
$project_id=create_guid();
|
||||
$z="insert into ecmdocuments(id,name,date_entered,date_modified,modified_user_id,assigned_user_id,created_by,iddir,isdir,no) values('".$project_id."','".$name."','".date("Y-m-d H:m:s")."','".date("Y-m-d H:m:s")."','".$current_user->id."','".$current_user->id."','".$current_user->id."','".$_GET['todir']."','1','".getnextdirnumber($_GET['todir'])."')";
|
||||
$w=mysql_query($z);
|
||||
|
||||
|
||||
$z="select id from ecmdocuments where iddir='".$_GET['fromdir']."' and name='Acquisition'";
|
||||
$w=mysql_query($z);
|
||||
$r=mysql_fetch_array($w);
|
||||
$acquisition_id=$r['id'];
|
||||
|
||||
$z="select id,name from ecmdocuments where iddir='".$_GET['fromdir']."' and name='Building Docs'";
|
||||
$w=mysql_query($z);
|
||||
$r=mysql_fetch_array($w);
|
||||
$building_id=$r['id'];
|
||||
$building_name=$r['name'];
|
||||
movedir($building_id,$project_id,$building_name,1);
|
||||
|
||||
$z="select id,name from ecmdocuments where iddir='".$_GET['fromdir']."' and name='Corporate Docs'";
|
||||
$w=mysql_query($z);
|
||||
$r=mysql_fetch_array($w);
|
||||
$corporate_id=$r['id'];
|
||||
$corporate_name=$r['name'];
|
||||
movedir($corporate_id,$project_id,$corporate_nam,2);
|
||||
|
||||
$z="select id,name from ecmdocuments where iddir='".$acquisition_id."'";
|
||||
$w=mysql_query($z);
|
||||
$nr=3;
|
||||
while($r=mysql_fetch_array($w))
|
||||
{
|
||||
movedir($r['id'],$project_id,$r['name'],$nr);
|
||||
$nr++;
|
||||
}
|
||||
delete_recursive($_GET['fromdir']);
|
||||
|
||||
handleRedirect($project_id,'EcmDocuments');
|
||||
?>
|
||||
@@ -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.
|
||||
********************************************************************************/
|
||||
|
||||
global $current_user;
|
||||
|
||||
$dashletData['MyEcmDocumentsDashlet']['searchFields'] = array(
|
||||
'date_entered' => array('default' => ''),
|
||||
'date_modified' => array('default' => ''),
|
||||
'assigned_user_id' => array('type' => 'assigned_user_name',
|
||||
'default' => $current_user->name)
|
||||
);
|
||||
|
||||
$dashletData['MyEcmDocumentsDashlet']['columns'] = array(
|
||||
'name' => array(
|
||||
'width' => '40',
|
||||
'label' => 'LBL_LIST_NAME',
|
||||
'link' => true,
|
||||
'default' => true),
|
||||
'date_entered' => array(
|
||||
'width' => '15',
|
||||
'label' => 'LBL_DATE_ENTERED'),
|
||||
'date_modified' => array(
|
||||
'width' => '15',
|
||||
'label' => 'LBL_DATE_MODIFIED'),
|
||||
'created_by' => array(
|
||||
'width' => '8',
|
||||
'label' => 'LBL_CREATED'),
|
||||
'assigned_user_name' => array(
|
||||
'width' => '8',
|
||||
'label' => 'LBL_LIST_ASSIGNED_USER'),
|
||||
);
|
||||
?>
|
||||
@@ -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['MyEcmDocumentsDashlet'] = array(
|
||||
'title' => translate('LBL_LIST_MY_ECMDOCUMENTS', 'EcmDocuments'),
|
||||
'icon' => 'modules/EcmDocuments/images/EcmDocuments.gif',
|
||||
'description' => 'A customizable view into EcmDocuments',
|
||||
'category' => 'Module Views'
|
||||
);
|
||||
?>
|
||||
@@ -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/EcmDocuments/EcmDocument.php');
|
||||
require_once('modules/EcmDocuments/Dashlets/MyEcmDocumentsDashlets/MyEcmDocumentsDashlet.data.php');
|
||||
|
||||
class MyEcmDocumentsDashlet extends DashletGeneric {
|
||||
function MyEcmDocumentsDashlet($id, $def = null) {
|
||||
global $current_user, $app_strings, $dashletData;
|
||||
parent::DashletGeneric($id, $def);
|
||||
|
||||
$this->searchFields = $dashletData['MyEcmDocumentsDashlet']['searchFields'];
|
||||
$this->columns = $dashletData['MyEcmDocumentsDashlet']['columns'];
|
||||
|
||||
if(empty($def['title']))
|
||||
$this->title = translate('LBL_LIST_MY_ECMDOCUMENTS', 'EcmDocuments');
|
||||
$this->seedBean = new EcmDocument();
|
||||
}
|
||||
|
||||
function displayOptions() {
|
||||
$this->processDisplayOptions();
|
||||
$this->configureSS->assign('searchFields', $this->currentSearchFields);
|
||||
return $this->configureSS->fetch($this->configureTpl);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
67
modules/EcmDocuments/Delete.php
Executable file
67
modules/EcmDocuments/Delete.php
Executable 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/EcmDocuments/EcmDocument.php');
|
||||
|
||||
$focus = new EcmDocument();
|
||||
|
||||
// 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']);
|
||||
?>
|
||||
34
modules/EcmDocuments/DeleteDir.php
Executable file
34
modules/EcmDocuments/DeleteDir.php
Executable file
@@ -0,0 +1,34 @@
|
||||
<?
|
||||
require_once("include/formbase.php");
|
||||
require_once("modules/EcmDocuments/dirstree.php");
|
||||
|
||||
$r=mysql_fetch_array(mysql_query("select iddir from ecmdocuments where id='".$_REQUEST['record']."'"));
|
||||
$iddir=$r['iddir'];
|
||||
delete_recursive($_REQUEST['record']);
|
||||
reorganizedir($iddir);
|
||||
$relations=array("accounts","calls","contacts","contracts","correspondences","ecmfiles","ecminvoices","emails","meetings","notes","quotes","tasks");
|
||||
foreach($relations as $rel)deleterelations($_REQUEST['record'],"ecmdocuments_".$rel,"ecmdocument_id");
|
||||
$_SESSION['optionsafterdeletedir']=1;
|
||||
$bl=explode("||",$_GET['record']."||".check_block($_GET['record'],""));
|
||||
for($i=count($bl)-1;$i>=0;$i--)
|
||||
{
|
||||
$z="select name,id,no from ecmdocuments where id='".$bl[$i]."'";
|
||||
$w=mysql_query($z);
|
||||
$r=mysql_fetch_array($w);
|
||||
if($r['name'])$linked_path.="<a class='utilsLink' href='index.php?module=EcmDocuments&action=DetailView&record=".$r['id']."'>".$r['no'].".".$r['name']."</a> / ";
|
||||
}
|
||||
$pathsamba="";
|
||||
for($i=count($bl)-1;$i>=0;$i--)
|
||||
{
|
||||
$z="select name from ecmdocuments where id='".$bl[$i]."'";
|
||||
$w=mysql_query($z);
|
||||
$r=mysql_fetch_array($w);
|
||||
$c=array("a","s","z","z","c","n","l","<EFBFBD>","e");
|
||||
$p=array("a","s","z","z","c","n","l","o","e");
|
||||
$pathsamba.="/".str_replace($c,$p,$r['name']);
|
||||
}
|
||||
$pathsamba=str_replace("///","/",$pathsamba);
|
||||
$pathsamba="smb://janek:test55...@192.168.1.3/Celtic/CRM/Files".$patsamba;
|
||||
unlink($pathsamba);
|
||||
handleRedirect($iddir,"EcmDocuments");
|
||||
?>
|
||||
78
modules/EcmDocuments/DeleteEcmRelation.php
Executable file
78
modules/EcmDocuments/DeleteEcmRelation.php
Executable file
@@ -0,0 +1,78 @@
|
||||
<?
|
||||
if($_REQUEST['relation']=="ecmdocuments_contacts")
|
||||
{
|
||||
$module="Contacts";
|
||||
$parent_id="contact_id";
|
||||
}
|
||||
if($_REQUEST['relation']=="ecmdocuments_accounts")
|
||||
{
|
||||
$module="Accounts";
|
||||
$parent_id="account_id";
|
||||
}
|
||||
if($_REQUEST['relation']=="ecmdocuments_ecmcorrespondenceins")
|
||||
{
|
||||
$module="EcmCorrespondenceIns";
|
||||
$parent_id="ecmcorrespondencein_id";
|
||||
}
|
||||
if($_REQUEST['relation']=="ecmdocuments_ecmcorrespondenceouts")
|
||||
{
|
||||
$module="EcmCorrespondenceOuts";
|
||||
$parent_id="ecmcorrespondenceout_id";
|
||||
}
|
||||
if($_REQUEST['relation']=="ecmdocuments_ecminvoiceins")
|
||||
{
|
||||
$module="EcmInvoiceIns";
|
||||
$parent_id="ecminvoicein_id";
|
||||
}
|
||||
if($_REQUEST['relation']=="ecmdocuments_ecminvoiceouts")
|
||||
{
|
||||
$module="EcmInvoiceOuts";
|
||||
$parent_id="ecminvoiceout_id";
|
||||
}
|
||||
if($_REQUEST['relation']=="ecmdocuments_ecmcontracts")
|
||||
{
|
||||
$module="EcmContracts";
|
||||
$parent_id="ecmcontract_id";
|
||||
}
|
||||
if($_REQUEST['relation']=="ecmdocuments_ecmdocs")
|
||||
{
|
||||
$module="EcmDocs";
|
||||
$parent_id="ecmdoc_id";
|
||||
}
|
||||
if($_REQUEST['relation']=="ecmdocuments_emails")
|
||||
{
|
||||
$module="Emails";
|
||||
$parent_id="email_id";
|
||||
}
|
||||
if($_REQUEST['relation']=="ecmdocuments_calls")
|
||||
{
|
||||
$module="Calls";
|
||||
$parent_id="call_id";
|
||||
}
|
||||
if($_REQUEST['relation']=="ecmdocuments_meetings")
|
||||
{
|
||||
$module="Meetings";
|
||||
$parent_id="meeting_id";
|
||||
}
|
||||
if($_REQUEST['relation']=="ecmdocuments_notes")
|
||||
{
|
||||
$module="Notes";
|
||||
$parent_id="note_id";
|
||||
}
|
||||
if($_REQUEST['relation']=="ecmdocuments_tasks")
|
||||
{
|
||||
$module="Tasks";
|
||||
$parent_id="task_id";
|
||||
}
|
||||
|
||||
$w=mysql_query("select id,ecmdocument_id,".$parent_id." from ".$_REQUEST['relation']." where ecmdocument_id='".$_REQUEST['ecmdocument_id']."' and ".$parent_id."='".$_REQUEST['id']."' and deleted='0'");
|
||||
$r=mysql_fetch_array($w);
|
||||
$ids=$r['id'];
|
||||
|
||||
|
||||
$z="update ".$_REQUEST['relation']." set deleted='1' where id='".$ids."'";
|
||||
|
||||
print $z;
|
||||
if(mysql_query($z))print "ok";
|
||||
header("Location: index.php?module=".$module."&action=DetailView&record=".$_REQUEST['id']);
|
||||
?>
|
||||
524
modules/EcmDocuments/DetailView.php
Executable file
524
modules/EcmDocuments/DetailView.php
Executable file
@@ -0,0 +1,524 @@
|
||||
<?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('modules/EcmDocuments/EcmDocument.php');
|
||||
require_once('modules/EcmDocuments/Forms.php');
|
||||
require_once('modules/EcmDocuments/dirstree.php');
|
||||
require_once('include/DetailView/DetailView.php');
|
||||
|
||||
global $mod_strings;
|
||||
global $app_strings;
|
||||
global $current_user;
|
||||
if(!$_REQUEST['record'])header("Location: index.php?module=EcmDocuments&action=index");
|
||||
$focus = new EcmDocument();
|
||||
|
||||
$detailView = new DetailView();
|
||||
$offset = 0;
|
||||
$tabsr=array('ecmdocs');
|
||||
foreach($tabsr as $tabsre)updateno("ecmdocuments_".$tabsre,$_REQUEST['record']);
|
||||
|
||||
// ONLY LOAD A RECORD IF A RECORD ID IS GIVEN;
|
||||
// A RECORD ID IS NOT GIVEN WHEN VIEWING IN LAYOUT EDITOR
|
||||
$_SESSION['ecmdocuments_stamp']=0;
|
||||
$_SESSION['last_ecm_id']=$_REQUEST['record'];
|
||||
$_SESSION['back_request_uri']=$_SERVER['REQUEST_URI'];
|
||||
$_SESSION['listviewlink']=0;
|
||||
if(!$_REQUEST['record'])$_REQUEST['record']=1;
|
||||
if (isset($_REQUEST['offset']) or isset($_REQUEST['record'])) {
|
||||
$result = $detailView->processSugarBean("ECMDOCUMENT", $focus, $offset);
|
||||
if($result == null) {
|
||||
sugar_die($app_strings['ERROR_NO_RECORD']);
|
||||
}
|
||||
$focus = $result;
|
||||
}else{
|
||||
header("Location: index.php?module=EcmDocuments&action=index");
|
||||
}
|
||||
|
||||
if(isset($_REQUEST['isDuplicate']) && $_REQUEST['isDuplicate'] == 'true') {
|
||||
$focus->id = "";
|
||||
}
|
||||
$bl=explode("||",$_GET['record']."||".check_block($_GET['record'],""));
|
||||
for($i=count($bl)-1;$i>=0;$i--)
|
||||
{
|
||||
$z="select name,id,no from ecmdocuments where id='".$bl[$i]."'";
|
||||
$w=mysql_query($z);
|
||||
$r=mysql_fetch_array($w);
|
||||
if($r['name'])$linked_path.="<a class='utilsLink' href='index.php?module=EcmDocuments&action=DetailView&record=".$r['id']."'>".$r['no'].".".$r['name']."</a> / ";
|
||||
}
|
||||
echo "\n<p>\n";
|
||||
echo get_module_title($mod_strings['LBL_MODULE_ID'], $mod_strings['LBL_MODULE_NAME'].": ".$linked_path."",true);
|
||||
echo "\n</p>\n";
|
||||
global $theme;
|
||||
$theme_path = "themes/".$theme."/";
|
||||
$image_path = $theme_path."images/";
|
||||
require_once($theme_path.'layout_utils.php');
|
||||
|
||||
$za="select id from ecmdocuments where iddir='".$_GET['record']."' and deleted='0'";
|
||||
$wy=mysql_query($za);
|
||||
$katalogi_liczba=mysql_num_rows($wy);
|
||||
|
||||
$w1=mysql_query("select id from ecmdocuments_shortcuts where userid='".$current_user->id."' and iddir='".$_REQUEST['record']."'");
|
||||
if(mysql_num_rows($w1)>0)$shortcut=1;
|
||||
else $shortcut=0;
|
||||
|
||||
$r1=mysql_fetch_array(mysql_query("select ecmdocuments_permissions.read,ecmdocuments_permissions.write,ecmdocuments_permissions.delete,ecmdocuments_permissions.add from ecmdocuments_permissions where ecmdocuments_permissions.iddir like '".$_REQUEST['record']."' and ecmdocuments_permissions.userid like '".$current_user->id."'"));
|
||||
$pread=$r1['read'];
|
||||
$pwrite=$r1['write'];
|
||||
$pdelete=$r1['delete'];
|
||||
$padd=$r1['add'];
|
||||
if($pread==1 || check_is_admin($_SESSION['authenticated_user_id']) || check_admin_permission($_SESSION['authenticated_user_id']))
|
||||
{
|
||||
$GLOBALS['log']->info("EcmDocument detail view");
|
||||
$r=mysql_fetch_array(mysql_query("select iddir,show_details,show_options,show_search,show_smb,assigned_user_id,cloning,isdir,shortcut from ecmdocuments where id='".$focus->id."'"));
|
||||
$iddir=$r['iddir'];
|
||||
|
||||
$xtpl=new XTemplate ('modules/EcmDocuments/DetailView.html');
|
||||
$xtpl->assign("MOD", $mod_strings);
|
||||
$xtpl->assign("APP", $app_strings);
|
||||
$xtpl->assign("THEME", $theme);
|
||||
$xtpl->assign("GRIDLINE", $gridline);
|
||||
$xtpl->assign("IMAGE_PATH", $image_path);
|
||||
$xtpl->assign("PRINT_URL", "index.php?".$GLOBALS['request_string']);
|
||||
$xtpl->assign("ID", $focus->id);
|
||||
$xtpl->assign("IDDIR", $iddir);
|
||||
$xtpl->assign("NAME", $focus->name);
|
||||
$xtpl->assign("DATE_ENTERED", $focus->date_entered);
|
||||
$xtpl->assign("DATE_MODIFIED", $focus->date_modified);
|
||||
$xtpl->assign("SCIEZKA",print_title($_GET['record']."||".check_block($_GET['record'],"")));
|
||||
$xtpl->assign("SCIEZKA1",str_replace(" / ","/",print_title($_GET['record']."||".check_block($_GET['record'],""))));
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$r1=mysql_fetch_array(mysql_query("select projects_in_progress_dir,projects_dir from ecmdocuments where id='".$iddir."'"));
|
||||
$pindir=$r1['projects_in_progress_dir'];
|
||||
$pdir=$r1['projects_dir'];
|
||||
|
||||
if($pindir==1)
|
||||
{
|
||||
$xtpl->assign("DIRTYPE",'<tr>
|
||||
<td valign="top" class="tabDetailViewDL">Dir Type</td>
|
||||
<td valign="top" class="tabDetailViewDF">Projects In Progress <a href="index.php?module=EcmDocuments&action=CreateProject&fromdir='.$_REQUEST['record'].'&todir='.$projectsdir.'">Create Project</a></td>
|
||||
<td class="tabDetailViewDL" valign="top"> </td>
|
||||
<td class="tabDetailViewDF"> </td>
|
||||
</tr>');
|
||||
}
|
||||
if($pdir==1)
|
||||
{
|
||||
$xtpl->assign("DIRTYPE",'<tr>
|
||||
<td valign="top" class="tabDetailViewDL">Dir Type</td>
|
||||
<td valign="top" class="tabDetailViewDF">Projects</td>
|
||||
<td class="tabDetailViewDL" valign="top"> </td>
|
||||
<td class="tabDetailViewDF"> </td>
|
||||
</tr>');
|
||||
}
|
||||
|
||||
//BUILDER:END of xtpl
|
||||
|
||||
$assigned_user_id=$r['assigned_user_id'];
|
||||
$cloning=$r['cloning'];
|
||||
|
||||
$isdir=$r['isdir'];
|
||||
$su=$r['show_upload'];
|
||||
$sd=$r['show_details'];
|
||||
$so=$r['show_options'];
|
||||
$ss=$r['show_search'];
|
||||
$ssmb=$r['show_smb'];
|
||||
if($su)
|
||||
{
|
||||
$imgu="basic";
|
||||
$classu="w";
|
||||
}
|
||||
else
|
||||
{
|
||||
$imgu="advanced";
|
||||
$classu="n";
|
||||
}
|
||||
if($sd)
|
||||
{
|
||||
$imgd="basic";
|
||||
$classd="w";
|
||||
}
|
||||
else
|
||||
{
|
||||
$imgd="advanced";
|
||||
$classd="n";
|
||||
}
|
||||
if($so)
|
||||
{
|
||||
$imgo="basic";
|
||||
$classo="w";
|
||||
}
|
||||
else
|
||||
{
|
||||
$imgo="advanced";
|
||||
$classo="n";
|
||||
if($_SESSION['optionsafterdeletedir'])$classo="w";
|
||||
$_SESSION['optionsafterdeletedir']=0;
|
||||
}
|
||||
if($ss)
|
||||
{
|
||||
$imgs="basic";
|
||||
$classs="w";
|
||||
}
|
||||
else
|
||||
{
|
||||
$imgs="advanced";
|
||||
$classs="w";
|
||||
}
|
||||
if($ssmb)
|
||||
{
|
||||
$imgsmb="basic";
|
||||
$classsmb="w";
|
||||
}
|
||||
else
|
||||
{
|
||||
$imgsmb="advanced";
|
||||
$classsmb="n";
|
||||
}
|
||||
|
||||
|
||||
if($katalogi_liczba==0)
|
||||
{
|
||||
|
||||
$pathsamba="";
|
||||
for($i=count($bl)-1;$i>=0;$i--)
|
||||
{
|
||||
$z="select name from ecmdocuments where id='".$bl[$i]."'";
|
||||
$w=mysql_query($z);
|
||||
$r=mysql_fetch_array($w);
|
||||
$c=array("ą","ś","ż","ź","ć","ń","ł","ó","ę");
|
||||
$p=array("a","s","z","z","c","n","l","o","e");
|
||||
$pathsamba.="/".str_replace($c,$p,$r['name']);
|
||||
}
|
||||
$pathsamba=str_replace("///","/",$pathsamba);
|
||||
$pathsamba=str_replace(" ","[s]",$pathsamba);
|
||||
|
||||
|
||||
$sambablock='<table width="100%" cellpadding="0" cellspacing="0" border="0" class="h3Row"><tr><td nowrap><h3><a style="cursor:pointer;" class=\'utilsLink\' onclick="displayshowblock(\'ListViewSmb\');"><input type="hidden" id="ListViewSmb_input" value="'.$ssmb.'" /><img src=\'themes/Sugar/images/'.$imgsmb.'_search.gif\' id=\'ListViewSmb_image\' width=\'8\' height=\'8\' alt="Hide" border="0" align="absmiddle"></a> Celtic Files</h3></td><td width=\'100%\'><IMG height=\'1\' width=\'1\' src=\'include/images/blank.gif\' alt=\'\'></td></tr></table><div id="ListViewSmb" class="'.$classsmb.'"></div><script language="javascript">mintajaxget("ListViewSmb.php?ps='.$pathsamba.'&start=0&order_by=Name&sorder=asc&db_id='.$_REQUEST['record'].'","ListViewSmb");</script>
|
||||
</td>
|
||||
</tr>
|
||||
</table>';
|
||||
}
|
||||
else $sambablock="";
|
||||
|
||||
$xtpl->assign("SAMBABLOCK",$sambablock);
|
||||
|
||||
$xtpl->assign("IMGD",$imgd);
|
||||
$xtpl->assign("CLASSD",$classd);
|
||||
|
||||
$r1=mysql_fetch_array(mysql_query("select ecmdocuments_permissions.read,ecmdocuments_permissions.write,ecmdocuments_permissions.delete,ecmdocuments_permissions.add from ecmdocuments_permissions where ecmdocuments_permissions.iddir='".$iddir."' and ecmdocuments_permissions.userid='".$current_user->id."'"));
|
||||
$pread=$r1['read'];
|
||||
$pwrite=$r1['write'];
|
||||
$pdelete=$r1['delete'];
|
||||
$padd=$r1['add'];
|
||||
$r1=mysql_fetch_array(mysql_query("select treeread from users where id='".$current_user->id."'"));
|
||||
$treeread=$r1['treeread'];
|
||||
/*<tr><td nowrap><h3><a name="ecmdocuments"></a>
|
||||
<a style="cursor:pointer;" class="utilsLink" onclick="displayshowblock(\'searchblock\');"><input type="hidden" id="searchblock_input" value="1" /><img id="searchblock_image" src="themes/'.$theme.'/images/'.$imgs.'_search.gif" width="8" height="8" alt="Hide" border="0" align="absmiddle"></a> Search</h3></td><td width="100%"><IMG height="1" width="1" src="include/images/blank.gif" alt=""></td></tr>
|
||||
</table>
|
||||
<div id="searchblock" class="'.$classs.'">
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="tabDetailView">
|
||||
<tr>
|
||||
<td COLSPAN="20" style="padding: 0px;">
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%">';
|
||||
$searchblock.='*/
|
||||
$searchblock='<form action="index.php?module=EcmDocuments&action=SearchDir&record='.$_REQUEST['record'].'" enctype="multipart/form-data" name="Search" method="post">
|
||||
<ul class="tablist">';
|
||||
|
||||
if($_GET['gotodir']==1)
|
||||
{
|
||||
$active="active";
|
||||
$current="current";
|
||||
}
|
||||
else
|
||||
{
|
||||
$actived="active";
|
||||
$currentd="current";
|
||||
}
|
||||
$searchblock.='
|
||||
<li class="'.$actived.'"><a class="'.$currentd.'" href="index.php?module=EcmDocuments&action=DetailView&record='.$_GET['record'].'&tab=Tree">Detail View</a></li>';
|
||||
if($_GET['action']=="SearchProjects" || $_GET['gotodir']==1)
|
||||
{
|
||||
$searchblock.='
|
||||
<li class="'.$active.'"><a class="'.$current.'" href="index.php?module=EcmDocuments&action=DetailView&record='.$_GET['record'].'&tab=Tree&gotodir=1">Tree</a></li>
|
||||
<li><a href="index.php?module=EcmDocuments&action=SearchProjects&record='.$_GET['record'].'&tab=All&start=1">All</a></li>
|
||||
<li><a href="index.php?module=EcmDocuments&action=SearchProjects&record='.$_GET['record'].'&tab=EcmDocs&start=1">EcmFiles</a></li>';
|
||||
/*
|
||||
<li><a href="index.php?module=EcmDocuments&action=SearchProjects&record='.$_GET['record'].'&tab=EcmCorrespondenceIns&start=1">Correspondence In</a></li>
|
||||
<li><a href="index.php?module=EcmDocuments&action=SearchProjects&record='.$_GET['record'].'&tab=EcmCorrespondenceOuts&start=1">Correspondence Out</a></li>
|
||||
<li><a href="index.php?module=EcmDocuments&action=SearchProjects&record='.$_GET['record'].'&tab=EcmContracts&start=1">Contracts</a></li>
|
||||
<li><a href="index.php?module=EcmDocuments&action=SearchProjects&record='.$_GET['record'].'&tab=EcmInvoiceIns&start=1">Invoice In</a></li>
|
||||
<li><a href="index.php?module=EcmDocuments&action=SearchProjects&record='.$_GET['record'].'&tab=EcmInvoiceOuts&start=1">Invoice Out</a></li>';
|
||||
*/
|
||||
}
|
||||
else
|
||||
{
|
||||
$searchblock.='
|
||||
<li><a href="index.php?module=EcmDocuments&action=SearchProjects&record='.$_GET['record'].'&tab=All&start=1">Search</a></li>';
|
||||
}
|
||||
$searchblock.='
|
||||
</ul>';
|
||||
if($_GET['gotodir']==1)
|
||||
{
|
||||
$searchblock.='
|
||||
<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">Go To File/Dir</span sugar="slot"></td>
|
||||
<td width="30%" valign="top" class="dataField"><span sugar="slot1b"><input type="text" name="searchdir" value="'.$_SESSION['searchdir'].'"></span sugar="slot"></td>
|
||||
<td width="20%" valign="top" class="dataLabel"><span sugar="slot`3`"></span sugar="slot"></td>
|
||||
<td width="30%" valign="top" class="dataField"><span sugar="slot`3`b">
|
||||
</span sugar="slot"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table><input type="submit" name="searchdirsubmit" value="Search" class="button">
|
||||
</form>';
|
||||
}
|
||||
|
||||
|
||||
$r=mysql_fetch_array(mysql_query("select treesearch from users where id='".$_SESSION['authenticated_user_id']."'"));
|
||||
$treesearch=$r['treesearch'];
|
||||
if($treesearch==1 || is_admin($current_user))$xtpl->assign("SEARCHBLOCK",$searchblock);
|
||||
|
||||
|
||||
|
||||
if($current_user->id==$assigned_user_id || check_is_admin($_SESSION['authenticated_user_id']) || ($treeread && $focus->ACLAccess('Edit')) || $padd)
|
||||
{
|
||||
$optionsblock='<table cellspacing="0" cellpadding="0" border="0" width="100%">';
|
||||
$optionsblock.='
|
||||
<tr>
|
||||
<td width="30%" valign="top" class="tabDetailViewDL"><span sugar="slot2">Create Subfolder</span sugar="slot"></td>
|
||||
<td width="70%" valign="top" class="tabDetailViewDF"><span sugar="slot2b"><input type="text" name="subfoldername"> <input type="submit" name="createsubfolder" class="button" value="Create"></span sugar="slot"></td>
|
||||
</tr>
|
||||
';
|
||||
|
||||
if($cloning==1)
|
||||
{
|
||||
$optionsblock.='
|
||||
<input type="hidden" name="idkatalogu" value="'.$iddir.'" />
|
||||
<input type="hidden" name="idkat" value="'.$_REQUEST['record'].'" />
|
||||
<input type="hidden" name="katalog" value="'.str_replace(" / ","/",print_title($_GET['record']."||".check_block($_GET['record'],""))).'" />
|
||||
<tr>
|
||||
<td width="30%" valign="top" class="tabDetailViewDL"><span sugar="slot2">Clone Dir</span sugar="slot"></td>
|
||||
<td width="70%" valign="top" class="tabDetailViewDF"><span sugar="slot2b"><input class="input" type="text" name="dirname" /> <input class="button" type="submit" name="clonedir" value="Clone Dir" /></span sugar="slot"></td>
|
||||
</tr>
|
||||
';
|
||||
}
|
||||
}
|
||||
if($current_user->id==$assigned_user_id || check_is_admin($_SESSION['authenticated_user_id']) || ($treeread && $focus->ACLAccess('Delete')) || $pdelete)
|
||||
{
|
||||
$optionsblock.='
|
||||
<tr>
|
||||
<td width="30%" valign="top" class="tabDetailViewDL"><span sugar="slot2">Delete Folder</span sugar="slot"></td>
|
||||
<td width="70%" valign="top" class="tabDetailViewDF"><span sugar="slot2b"><input type="submit" name="deletedir" class="button" value="Delete"></span sugar="slot"></td>
|
||||
</tr>
|
||||
';
|
||||
}
|
||||
|
||||
if(check_is_admin($_SESSION['authenticated_user_id']) || ($treeread && $focus->ACLAccess('Edit')) || $pwrite)
|
||||
{
|
||||
$xtpl->assign("PERMISSIONS","<a href='index.php?module=EcmDocuments&action=SetPermissions&record=".$_GET['record']."'>Set Permissions</a>");
|
||||
$optionsblock.='
|
||||
<tr>
|
||||
<td width="30%" valign="top" class="tabDetailViewDL"><span sugar="slot2">Set Permissions</span sugar="slot"></td>
|
||||
<td width="70%" valign="top" class="tabDetailViewDF"><span sugar="slot2b"><input type="button" name="deletedir" class="button" value="Set" onclick="document.location.href=\'index.php?module=EcmDocuments&action=SetPermissions&record='.$_GET['record'].'\';"></span sugar="slot"></td>
|
||||
</tr>';
|
||||
$optionsblock.='
|
||||
<tr>
|
||||
<td width="30%" valign="top" class="tabDetailViewDL"><span sugar="slot2">Set Dirs Order</span sugar="slot"></td>
|
||||
<td width="70%" valign="top" class="tabDetailViewDF"><span sugar="slot2b"><input type="button" name="dirsorder" class="button" value="Set" onclick="document.location.href=\'index.php?module=EcmDocuments&action=DirsOrder&record='.$_GET['record'].'\';"></span sugar="slot"></td>
|
||||
</tr>';
|
||||
|
||||
if($pindir==1)
|
||||
{
|
||||
$optionsblock.='
|
||||
<tr>
|
||||
<td width="30%" valign="top" class="tabDetailViewDL"><span sugar="slot2">Create Project</span sugar="slot"></td>
|
||||
<td width="70%" valign="top" class="tabDetailViewDF"><span sugar="slot2b"><input type="button" name="createproject" class="button" value="Create" onclick="document.location.href=\'index.php?module=EcmDocuments&action=CreateProject&fromdir='.$_REQUEST['record'].'&todir='.$projectsdir.'\';"></span sugar="slot"></td>
|
||||
</tr>
|
||||
';
|
||||
}
|
||||
if($pdir==1)
|
||||
{
|
||||
$optionsblock.='
|
||||
<tr>
|
||||
<td width="30%" valign="top" class="tabDetailViewDL"><span sugar="slot2">Back to In Progress</span sugar="slot"></td>
|
||||
<td width="70%" valign="top" class="tabDetailViewDF"><span sugar="slot2b"><input type="button" name="createproject" class="button" value="Back" onclick="document.location.href=\'index.php?module=EcmDocuments&action=CreateProjectInProgress&fromdir='.$_REQUEST['record'].'&todir='.$projectsinprogressdir.'\';"></span sugar="slot"></td>
|
||||
</tr>';
|
||||
}
|
||||
$optionsblock.='</table>';
|
||||
}
|
||||
|
||||
|
||||
$xtpl->assign("OPTIONSBLOCK",$optionsblock);
|
||||
|
||||
if($cloning==1)$cloningchecked="checked";
|
||||
else $cloningchecked="";
|
||||
if($shortcut==1)$shortcutchecked="checked";
|
||||
else $shortcutchecked="";
|
||||
$r=mysql_fetch_array(mysql_query("select id from users where user_name='".$focus->assigned_user_name."'"));
|
||||
$user_id=$r['id'];
|
||||
$selectuser="<select name='selectuser'><option value=''>select</option>";
|
||||
$z="select id,user_name from users order by user_name asc";
|
||||
$w=mysql_query($z);
|
||||
while($r=mysql_fetch_array($w))
|
||||
{
|
||||
$selectuser.="<option value='".$r['id']."'";
|
||||
if($user_id==$r['id'])$selectuser.=" selected";
|
||||
$selectuser.=">".$r['user_name']."</option>";
|
||||
}
|
||||
$selectuser."</select>";
|
||||
if(check_is_admin($_SESSION['authenticated_user_id']) || $assigned_user_id==$current_user->id || check_admin_permission($_SESSION['authenticated_user_id']) || ($treeread && $focus->ACLAccess('View')) || $pread)
|
||||
{
|
||||
$xtpl->assign("SHORTCUT","<input type='checkbox' value='1' name='shortcut' ".$shortcutchecked.">");
|
||||
$xtpl->assign("CLONING","<input type='checkbox' value='1' name='cloning' ".$cloningchecked.">");
|
||||
$xtpl->assign("SAVEINFO",'<input name="saveinfo" type="submit" class="button" id="saveinfo" value="Save" />');
|
||||
$xtpl->assign("NAME","<input type='hidden' name='katalog' value='".str_replace(" / ","/",print_title($_GET['record']."||".check_block($_GET['record'],"")))."' /><input type='text' size='35' name='name' class='input' value='".$focus->name."'>");
|
||||
$xtpl->assign("ASSIGNED_TO",$selectuser);
|
||||
$xtpl->assign("DESCRIPTION",'<textarea name="description" rows="4" cols="30">'.$focus->description.'</textarea>');
|
||||
if($cloning==1)$xtpl->assign("CLONE",'<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td width="15%" valign="top" class="tabDetailViewDL"><span sugar="slot2b">
|
||||
<form action="index.php?module=EcmDocuments&action=CloneDir" method="post">
|
||||
<input type="hidden" name="idkatalogu" value="'.$iddir.'" />
|
||||
<input type="hidden" name="idkat" value="'.$_REQUEST['record'].'" />
|
||||
<input type="hidden" name="katalog" value="'.str_replace(" / ","/",print_title($_GET['record']."||".check_block($_GET['record'],""))).'" />
|
||||
Clone Dir Name</td><td class="tabDetailViewDF">
|
||||
<input class="input" type="text" name="dirname" />
|
||||
<span class="tabDetailViewDL"><span sugar="slot3">
|
||||
<input class="button" type="submit" name="clonedir" value="Clone Dir" />
|
||||
</span sugar="slot"></span>
|
||||
</form></td>
|
||||
</tr>
|
||||
</table>');
|
||||
else $xtpl->assign("CLONE","");
|
||||
}
|
||||
else
|
||||
{
|
||||
$xtpl->assign("SHORTCUT",$shortcutchecked);
|
||||
$xtpl->assign("CLONING",$cloningchecked);
|
||||
$xtpl->assign("SAVEINFO","");
|
||||
$xtpl->assign("NAME", $focus->name);
|
||||
$xtpl->assign("ASSIGNED_TO", $focus->assigned_user_name);
|
||||
$xtpl->assign("DESCRIPTION",$focus->description);
|
||||
$xtpl->assign("CLONE","");
|
||||
}
|
||||
if(
|
||||
($treeread && $focus->ACLAccess('View')) ||
|
||||
$pread ||
|
||||
check_admin_permission($_SESSION['authenticated_user_id'])
|
||||
)
|
||||
$xtpl->assign("SHORTCUT","<input type='checkbox' value='1' name='shortcut' ".$shortcutchecked.">");
|
||||
if(is_admin($current_user))$xtpl->assign("PERMISSIONS","<a href='index.php?module=EcmDocuments&action=SetPermissions&record=".$_GET['record']."'>Set Permissions</a>");
|
||||
if(is_admin($current_user) && $_REQUEST['module'] != 'DynamicLayout' && !empty($_SESSION['editinplace'])){
|
||||
$xtpl->assign("ADMIN_EDIT","<a href='index.php?action=index&module=DynamicLayout&from_action=".$_REQUEST['action'] ."&from_module=".$_REQUEST['module'] ."&record=".$_REQUEST['record']. "'>".get_image($image_path."EditLayout","border='0' alt='Edit Layout' align='bottom'")."</a>");
|
||||
}
|
||||
|
||||
$xtpl->assign("CREATED_BY", $focus->created_by_name);
|
||||
$xtpl->assign("MODIFIED_BY", $focus->modified_by_name);
|
||||
$r=mysql_fetch_array(mysql_query("select show_details from ecmdocuments where id='".$_REQUEST['record']."'"));
|
||||
$xtpl->assign("FIRSTBLOCKINPUTVALUE", $r['show_details']);
|
||||
|
||||
$detailView->processListNavigation($xtpl, "ECMDOCUMENT", $offset, $focus->is_AuditEnabled());
|
||||
|
||||
// ADDING CUSTOM FIELDS:
|
||||
require_once('modules/DynamicFields/templates/Files/DetailView.php');
|
||||
|
||||
/*
|
||||
// PRO only
|
||||
$xtpl->assign("TEAM", $focus->assigned_name);
|
||||
$xtpl->parse("main.pro");
|
||||
// PRO only
|
||||
*/
|
||||
if(!empty($focus->id)) {
|
||||
$merge_button = <<<EOQ
|
||||
<input title="{$app_strings['LBL_DUP_MERGE']}" accessKey="M" class="button" onclick="this.form.return_module.value='EcmDocuments'; this.form.return_action.value='DetailView';this.form.return_id.value='{$focus->id}'; this.form.action.value='Step1'; this.form.module.value='MergeRecords';" type="submit" name="Merge" value=" {$app_strings['LBL_DUP_MERGE']} "/>
|
||||
EOQ;
|
||||
$xtpl->assign("FIND_DUPES_MERGE_BUTTON", $merge_button);
|
||||
}
|
||||
|
||||
$xtpl->parse("main");
|
||||
$xtpl->out("main");
|
||||
/*
|
||||
$sub_xtpl = $xtpl;
|
||||
$old_contents = ob_get_contents();
|
||||
ob_end_clean();
|
||||
ob_start();
|
||||
echo $old_contents;
|
||||
*/
|
||||
require_once('include/SubPanel/SubPanelTiles.php');
|
||||
$subpanel = new SubPanelTiles($focus, 'EcmDocuments');
|
||||
error_reporting(E_ALL);
|
||||
echo $subpanel->display();
|
||||
|
||||
|
||||
|
||||
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('EcmDocuments')));
|
||||
$str = "<script>
|
||||
YAHOO.util.Event.addListener(window, 'load', SUGAR.util.fillShortcuts, $savedSearchSelects);
|
||||
</script>";
|
||||
echo $str;
|
||||
}
|
||||
else print "You do not have permissions to view this record";
|
||||
?>
|
||||
117
modules/EcmDocuments/DirsOrder.php
Executable file
117
modules/EcmDocuments/DirsOrder.php
Executable file
@@ -0,0 +1,117 @@
|
||||
<?
|
||||
$z="select id from ecmdocuments where iddir='".$_REQUEST['record']."' and deleted='0'";
|
||||
$w=mysql_query($z);
|
||||
$ile=mysql_num_rows($w);
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
function SendBoxes()
|
||||
{
|
||||
var boxes = new Array();
|
||||
var child = document.getElementById("container").childNodes; // tablica element<6E>w w kontenerze
|
||||
|
||||
for(var i = 0; i < child.length; i++) {
|
||||
boxes.push(child[i].id); // dodajemy numer kolejnego box-u do tablicy "boxes"
|
||||
}
|
||||
|
||||
var req = mint.Request();
|
||||
|
||||
//req.AddParam("boxes", boxes.toString()); // funkcja toString() zwraca liste element<6E>w w tablicy(czyli w tym przypadku numer<65>w) oddzielonych przecinkami, parametr "boxes" bedzie wiec zawieral wartosci typu 0,2,5,3,... itd
|
||||
req.Send("modules/EcmDocuments/SaveDirsOrder.php?record=<?print $_REQUEST['record'];?>&boxes="+boxes.toString(),"boxy");
|
||||
return true;
|
||||
}
|
||||
|
||||
function OnLoadMint()
|
||||
{
|
||||
<?
|
||||
$z="select id from ecmdocuments where iddir='".$_REQUEST['record']."' and deleted='0' order by no asc";
|
||||
$w=mysql_query($z);
|
||||
while($r=mysql_fetch_array($w))
|
||||
{
|
||||
print 'var box =mint.gui.RegisterDragObject("'.$r['id'].'");
|
||||
box.SetBBox("container");';
|
||||
}
|
||||
?>
|
||||
|
||||
var zone = mint.gui.RegisterDropZone("container");
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
<style type="text/css">
|
||||
|
||||
.box
|
||||
{
|
||||
width: 375px;
|
||||
height: 15px;
|
||||
clear: none;
|
||||
float: left;
|
||||
cursor: move;
|
||||
margin: 2px;
|
||||
font: 10px Verdana;
|
||||
text-align: center;
|
||||
border: 1px solid Black;
|
||||
background-color: #E6E6E6;
|
||||
}
|
||||
|
||||
#container
|
||||
{
|
||||
width: 380px;
|
||||
height: <?print 15*$ile+6*($ile);?>px;
|
||||
clear: none;
|
||||
float: left;
|
||||
margin: 2px;
|
||||
padding: 4px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
|
||||
<body onLoad="OnLoadMint();">
|
||||
<table width='100%' cellpadding='0' cellspacing='0' border='0' class='moduleTitle'><tr><td valign='top'>
|
||||
</td><td width='100%'><h2>Set Dirs Order:
|
||||
<?
|
||||
$z="select name from ecmdocuments where id='".$_REQUEST['record']."'";
|
||||
$w=mysql_query($z);
|
||||
$r=mysql_fetch_array($w);
|
||||
print " ".$r['name'];
|
||||
?>
|
||||
</h2></td>
|
||||
</tr></table>
|
||||
<table cellpadding="0" cellspacing="0" border="0" width="100%">
|
||||
<tr>
|
||||
<td style="padding-bottom: 2px;">
|
||||
<input type="button" onClick="if(SendBoxes()){document.location.href='index.php?module=EcmDocuments&action=DirsOrder&record=<?print $_REQUEST['record'];?>';}" value="Save" class="button">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<br>
|
||||
<div id="boxy"></div>
|
||||
<p>
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="tabForm">
|
||||
<tr>
|
||||
<td class="dataLabel">
|
||||
|
||||
<div id="container">
|
||||
<?
|
||||
$z="select id,name,no from ecmdocuments where iddir='".$_REQUEST['record']."' and deleted='0' order by no asc";
|
||||
$w=mysql_query($z);
|
||||
while($r=mysql_fetch_array($w))
|
||||
{
|
||||
print '<div id="'.$r['id'].'" class="box" style="width: 375px;
|
||||
height: 15px;
|
||||
clear: none;
|
||||
float: left;
|
||||
cursor: move;
|
||||
margin: 2px;
|
||||
font: 10px Verdana;
|
||||
text-align: center;
|
||||
border: 1px solid Black;
|
||||
background-color: #E6E6E6;">'.$r['no'].'.'.$r['name'].'</div>';
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
246
modules/EcmDocuments/EcmDocument.php
Executable file
246
modules/EcmDocuments/EcmDocument.php
Executable file
@@ -0,0 +1,246 @@
|
||||
<?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 EcmDocument extends SugarBean {
|
||||
var $field_name_map = array();
|
||||
// STANDARD FIELDS
|
||||
var $id;
|
||||
var $date_entered;
|
||||
var $date_modified;
|
||||
var $modified_user_id;
|
||||
var $assigned_user_id;
|
||||
var $name;
|
||||
|
||||
//TABLE COLUMNS
|
||||
var $description;
|
||||
|
||||
// RELATED FIELDS
|
||||
var $created_by;
|
||||
var $created_by_name;
|
||||
var $modified_by_name;
|
||||
var $assigned_user_name;
|
||||
|
||||
// SUBPANELS RELATED
|
||||
|
||||
// MODULE OBJECT DETAILS
|
||||
var $module_dir = 'EcmDocuments';
|
||||
var $table_name = "ecmdocuments";
|
||||
var $object_name = "EcmDocument";
|
||||
|
||||
//RELATED TABLE NAMES
|
||||
|
||||
|
||||
// USED TO RETRIEVE RELATED FIELDS FROM FORM POSTS.
|
||||
var $additional_column_fields = Array(
|
||||
'assigned_user_name',
|
||||
'assigned_user_id',
|
||||
'modified_user_id',
|
||||
'created_by',
|
||||
);
|
||||
|
||||
var $relationship_fields = Array(
|
||||
//RELATIONSHIP FIELDS
|
||||
|
||||
);
|
||||
|
||||
function EcmDocument() {
|
||||
parent::SugarBean();
|
||||
$this->setupCustomFields('EcmDocuments');
|
||||
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 .= "
|
||||
ecmdocuments.*
|
||||
,users.user_name as assigned_user_name";
|
||||
if($custom_join){
|
||||
$query .= $custom_join['select'];
|
||||
}
|
||||
$query .= " FROM ecmdocuments
|
||||
LEFT JOIN users
|
||||
ON ecmdocuments.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 ecmdocuments.name";
|
||||
|
||||
return $query;
|
||||
}
|
||||
|
||||
function create_export_query($order_by, $where){
|
||||
$custom_join = $this->custom_fields->getJOIN();
|
||||
$query = "SELECT
|
||||
ecmdocuments.*,
|
||||
users.user_name assigned_user_name";
|
||||
if($custom_join){
|
||||
$query .= $custom_join['select'];
|
||||
}
|
||||
$query .= " FROM ecmdocuments ";
|
||||
|
||||
$query .= " LEFT JOIN users
|
||||
ON ecmdocuments.assigned_user_id=users.id";
|
||||
if($custom_join){
|
||||
$query .= $custom_join['join'];
|
||||
}
|
||||
$query .= "";
|
||||
$where_auto = " ecmdocuments.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 ecmdocuments.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, 'EcmDocuments');
|
||||
|
||||
// THE NEW LISTVIEW CODE ONLY FETCHES COLUMNS THAT WE'RE DISPLAYING AND NOT ALL
|
||||
// THE COLUMNS SO WE NEED THESE CHECKS.
|
||||
$the_array['NAME'] = (($this->name == "") ? "<em>blank</em>" : $this->name);
|
||||
$the_array['ENCODED_NAME'] = $this->name;
|
||||
return $the_array;
|
||||
}
|
||||
|
||||
/**
|
||||
BUILDS A GENERIC SEARCH BASED ON THE QUERY STRING USING OR.
|
||||
DO NOT INCLUDE ANY $THIS-> BECAUSE THIS IS CALLED ON WITHOUT HAVING THE CLASS INSTANTIATED.
|
||||
*/
|
||||
function build_generic_where_clause ($the_query_string) {
|
||||
$where_clauses = Array();
|
||||
$the_query_string = PearDatabase::quote(from_html($the_query_string));
|
||||
array_push($where_clauses, "ecmdocuments.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("ECMDOCUMENTS_DESCRIPTION", $ecmdocuments->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);
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
99
modules/EcmDocuments/EcmDocumentsQuickCreate.php
Executable file
99
modules/EcmDocuments/EcmDocumentsQuickCreate.php
Executable 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/EcmDocuments/EcmDocument.php');
|
||||
require_once('include/javascript/javascript.php');
|
||||
|
||||
class EcmDocumentsQuickCreate extends QuickCreate {
|
||||
|
||||
var $javascript;
|
||||
|
||||
function process() {
|
||||
global $current_user, $timedate, $app_list_strings, $current_language, $mod_strings;
|
||||
$mod_strings = return_module_language($current_language, 'EcmDocuments');
|
||||
|
||||
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(\"ecmdocumentsQuickCreate\")) return SUGAR.subpanelUtils.inlineSave(this.form.id, \"ecmdocuments\"); else return false;'");
|
||||
$this->ss->assign('cancelOnclick', "onclick='return SUGAR.subpanelUtils.cancelCreate(\"subpanel_ecmdocuments\")';");
|
||||
}
|
||||
|
||||
$this->ss->assign('viaAJAX', $this->viaAJAX);
|
||||
|
||||
$this->javascript = new javascript();
|
||||
$this->javascript->setFormName('ecmdocumentsQuickCreate');
|
||||
|
||||
$focus = new EcmDocument();
|
||||
$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' => 'ecmdocumentsQuickCreate',
|
||||
'field_to_name_array' => array(
|
||||
'id' => 'account_id',
|
||||
'name' => 'account_name',
|
||||
),
|
||||
);
|
||||
|
||||
$encoded_popup_request_data = $json->encode($popup_request_data);
|
||||
$this->ss->assign('encoded_popup_request_data', $encoded_popup_request_data);
|
||||
}
|
||||
}
|
||||
?>
|
||||
276
modules/EcmDocuments/EditView.php
Executable file
276
modules/EcmDocuments/EditView.php
Executable file
@@ -0,0 +1,276 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/*****************************************************************************
|
||||
* The contents of this file are subject to the RECIPROCAL PUBLIC LICENSE
|
||||
* Version 1.1 ("License"); You may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
* http://opensource.org/licenses/rpl.php. Software distributed under the
|
||||
* License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
|
||||
* either express or implied.
|
||||
*
|
||||
* You may:
|
||||
* a) Use and distribute this code exactly as you received without payment or
|
||||
* a royalty or other fee.
|
||||
* b) Create extensions for this code, provided that you make the extensions
|
||||
* publicly available and document your modifications clearly.
|
||||
* c) Charge for a fee for warranty or support or for accepting liability
|
||||
* obligations for your customers.
|
||||
*
|
||||
* You may NOT:
|
||||
* a) Charge for the use of the original code or extensions, including in
|
||||
* electronic distribution models, such as ASP (Application Service
|
||||
* Provider).
|
||||
* b) Charge for the original source code or your extensions other than a
|
||||
* nominal fee to cover distribution costs where such distribution
|
||||
* involves PHYSICAL media.
|
||||
* c) Modify or delete any pre-existing copyright notices, change notices,
|
||||
* or License text in the Licensed Software
|
||||
* d) Assert any patent claims against the Licensor or Contributors, or
|
||||
* which would in any way restrict the ability of any third party to use the
|
||||
* Licensed Software.
|
||||
*
|
||||
* You must:
|
||||
* a) Document any modifications you make to this code including the nature of
|
||||
* the change, the authors of the change, and the date of the change.
|
||||
* b) Make the source code for any extensions you deploy available via an
|
||||
* Electronic Distribution Mechanism such as FTP or HTTP download.
|
||||
* c) Notify the licensor of the availability of source code to your extensions
|
||||
* and include instructions on how to acquire the source code and updates.
|
||||
* d) Grant Licensor a world-wide, non-exclusive, royalty-free license to use,
|
||||
* reproduce, perform, modify, sublicense, and distribute your extensions.
|
||||
*
|
||||
* The Original Code is: CommuniCore
|
||||
* Olavo Farias
|
||||
* 2006-04-7 olavo.farias@gmail.com
|
||||
*
|
||||
* The Initial Developer of the Original Code is CommuniCore.
|
||||
* Portions created by CommuniCore are Copyright (C) 2005 CommuniCore Ltda
|
||||
* All Rights Reserved.
|
||||
********************************************************************************/
|
||||
|
||||
// INCLUDE SUPPPORT MODULES
|
||||
require_once('XTemplate/xtpl.php');
|
||||
require_once('data/Tracker.php');
|
||||
|
||||
// INCLUDE MODULE OBJECT AND FORMS
|
||||
require_once('modules/EcmDocuments/EcmDocument.php');
|
||||
require_once('modules/EcmDocuments/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 EcmDocument();
|
||||
|
||||
// IF PROCESSING AN EXISTING RECORD, RETRIEVE IT
|
||||
if(isset($_REQUEST['record'])) {
|
||||
$focus->retrieve($_REQUEST['record']);
|
||||
$focus->unformat_all_fields();
|
||||
}
|
||||
if(isset($_REQUEST['isDuplicate']) && $_REQUEST['isDuplicate'] == 'true') {
|
||||
$focus->id = "";
|
||||
$focus->simplemodule_number = "";
|
||||
}
|
||||
|
||||
$prefillArray = array(
|
||||
'priority' => 'priority',
|
||||
'name' => 'name',
|
||||
'description' => 'description',
|
||||
'status' => 'status',
|
||||
'type' => 'type',
|
||||
);
|
||||
|
||||
foreach($prefillArray as $requestKey => $focusVar) {
|
||||
if (isset($_REQUEST[$requestKey]) && is_null($focus->$focusVar)) {
|
||||
$focus->$focusVar = urldecode($_REQUEST[$requestKey]);
|
||||
}
|
||||
}
|
||||
|
||||
// BUILD MODULE TITLE LINE
|
||||
echo "\n<p>\n";
|
||||
echo get_module_title($mod_strings['LBL_MODULE_ID'], $mod_strings['LBL_MODULE_NAME'].": ".$focus->name, true);
|
||||
echo "\n</p>\n";
|
||||
|
||||
global $theme;
|
||||
$theme_path = "themes/".$theme."/";
|
||||
$image_path = $theme_path."images/";
|
||||
require_once ($theme_path.'layout_utils.php');
|
||||
|
||||
$GLOBALS['log']->info("EcmDocuments detail view");
|
||||
|
||||
// ASSIGN XTEMPLATE
|
||||
$xtpl = new XTemplate ('modules/EcmDocuments/EditView.html');
|
||||
|
||||
// FILL XTEMPLATE MODULE & APPLICATION LANGUAGE STRINGS
|
||||
$xtpl->assign("MOD", $mod_strings);
|
||||
$xtpl->assign("APP", $app_strings);
|
||||
$xtpl->assign("CALENDAR_DATEFORMAT", $timedate->get_cal_date_format());
|
||||
|
||||
if (isset($_REQUEST['return_module'])) $xtpl->assign("RETURN_MODULE", $_REQUEST['return_module']);
|
||||
if (isset($_REQUEST['return_action'])) $xtpl->assign("RETURN_ACTION", $_REQUEST['return_action']);
|
||||
if (isset($_REQUEST['return_id'])) $xtpl->assign("RETURN_ID", $_REQUEST['return_id']);
|
||||
|
||||
if (empty($_REQUEST['return_id'])) {
|
||||
$xtpl->assign("RETURN_ACTION", 'index');
|
||||
}
|
||||
|
||||
///////////////////////////////////////
|
||||
// SETUP POPUPS START
|
||||
// Users Popup
|
||||
$json = getJSONobj();
|
||||
$popup_request_data = array(
|
||||
'call_back_function' => 'set_return',
|
||||
'form_name' => 'EditView',
|
||||
'field_to_name_array' => array(
|
||||
'id' => 'assigned_user_id',
|
||||
'user_name' => 'assigned_user_name',
|
||||
),
|
||||
);
|
||||
$xtpl->assign('encoded_users_popup_request_data', $json->encode($popup_request_data));
|
||||
//
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
// ACCOUNT_ID WILL BE SET WHEN USER CHOOSES TO CREATE A NEW SIMPLEMODULE FROM ACCOUNT DETAIL VIEW.
|
||||
if (isset($_REQUEST['account_id'])) $xtpl->assign("ACCOUNT_ID", $_REQUEST['account_id']);
|
||||
if (isset($_REQUEST['contact_id'])) $xtpl->assign("CONTACT_ID", $_REQUEST['contact_id']);
|
||||
|
||||
// SET THE CASE_ID, IF SET.
|
||||
// WITH NEW CONCEPT OF SUBPANELS IT,
|
||||
// WHEN THE SUBPANEL IS DISPLAYED IT PULLS FROM THE CLASS NAME WHICH IN THE SITUATION OF CASES IS ACASE SO THE FORM IS GENERATED
|
||||
// WITH ACASE_ID INSTEAD OF CASE_ID, SO I HAVE DONE THE MAPPING HERE
|
||||
if (isset($_REQUEST['acase_id'])) $xtpl->assign("CASE_ID",$_REQUEST['acase_id']);
|
||||
else if(isset($_REQUEST['case_id'])) $xtpl->assign("CASE_ID",$_REQUEST['case_id']);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// QUICK SEARCH SETUP
|
||||
require_once('include/QuickSearchDefaults.php');
|
||||
$qsd = new QuickSearchDefaults();
|
||||
$sqs_objects = array(
|
||||
'assigned_user_name' => $qsd->getQSUser(),
|
||||
/*
|
||||
//BUILDER:START Pro only
|
||||
'team_name' => $qsd->getQSTeam()
|
||||
//BUILDER:END Pro only
|
||||
*/
|
||||
);
|
||||
$quicksearch_js = $qsd->getQSScripts();
|
||||
$quicksearch_js .= '<script type="text/javascript" language="javascript">sqs_objects = ' . $json->encode($sqs_objects) . '</script>';
|
||||
// QUICK SEARCH SETUP
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// ASSIGN GLOBAL VARIABLES
|
||||
$xtpl->assign("THEME", $theme);
|
||||
$xtpl->assign("IMAGE_PATH", $image_path);$xtpl->assign("PRINT_URL", "index.php?".$GLOBALS['request_string']);
|
||||
$xtpl->assign("JAVASCRIPT", get_set_focus_js().get_validate_record_js(). $quicksearch_js);
|
||||
$xtpl->assign("USER_DATEFORMAT", '('. $timedate->get_user_date_format().')');
|
||||
$xtpl->assign("CALENDAR_DATEFORMAT", $timedate->get_cal_date_format());
|
||||
// ASSIGN GLOBAL VARIABLES
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// ASSIGN MODULE DEFAULT VARIABLES
|
||||
$xtpl->assign("ID", $focus->id);
|
||||
if (!empty($focus->name))
|
||||
$xtpl->assign("NAME", $focus->name);
|
||||
else $xtpl->assign("NAME", "");
|
||||
$xtpl->assign("DATE_ENTERED", $focus->date_entered);
|
||||
$xtpl->assign("DATE_MODIFIED", $focus->date_modified);
|
||||
$xtpl->assign("CREATED_BY", $focus->created_by_name);
|
||||
$xtpl->assign("MODIFIED_BY", $focus->modified_by_name);
|
||||
|
||||
if (empty($focus->assigned_user_id) && empty($focus->id)) $focus->assigned_user_id = $current_user->id;
|
||||
if (empty($focus->assigned_name) && empty($focus->id)) $focus->assigned_user_name = $current_user->user_name;
|
||||
$xtpl->assign("ASSIGNED_USER_OPTIONS", get_select_options_with_id(get_user_array(TRUE, "Active", $focus->assigned_user_id), $focus->assigned_user_id));
|
||||
$xtpl->assign("ASSIGNED_USER_NAME", $focus->assigned_user_name);
|
||||
$xtpl->assign("ASSIGNED_USER_ID", $focus->assigned_user_id );
|
||||
|
||||
// ASSIGN MODULE SPECIFIC VARIABLES
|
||||
|
||||
|
||||
|
||||
$xtpl->assign("EKMT_DESCRIPTION", $focus->ekmt_description);
|
||||
|
||||
// ASSIGN MODULE DROPDOWNS WITH DEFAULT KEY
|
||||
|
||||
// ASSIGN MODULE VARIABLES AFFECTED BY DUPLICATE ACTION
|
||||
if(!isset($_REQUEST['isDuplicate'])) {
|
||||
$focus->id = "";
|
||||
}
|
||||
|
||||
|
||||
// ASSIGN MODULE DROPDOWNS WITHOUT DEFAULT KEY
|
||||
|
||||
//BUILDER:END of xtpl
|
||||
|
||||
// ADD CUSTOM FIELDS
|
||||
require_once('modules/DynamicFields/templates/Files/EditView.php');
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// USER ASSIGNMENT
|
||||
global $current_user;
|
||||
if(is_admin($current_user) && $_REQUEST['module'] != 'DynamicLayout' && !empty($_SESSION['editinplace'])){
|
||||
$record = '';
|
||||
// USER ASSIGNMENT
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
if(!empty($_REQUEST['record'])){
|
||||
$record = $_REQUEST['record'];
|
||||
}
|
||||
$xtpl->assign("ADMIN_EDIT","<a href='index.php?action=index&module=DynamicLayout&from_action=".$_REQUEST['action'] ."&from_module=".$_REQUEST['module'] ."&record=".$record. "'>".get_image($image_path."EditLayout","border='0' alt='Edit Layout' align='bottom'")."</a>");
|
||||
}
|
||||
|
||||
|
||||
|
||||
$xtpl->parse("main");
|
||||
$xtpl->out("main");
|
||||
require_once('include/javascript/javascript.php');
|
||||
$javascript = new javascript();
|
||||
$javascript->setFormName('EditView');
|
||||
$javascript->setSugarBean($focus);
|
||||
$javascript->addAllFields('');
|
||||
|
||||
//BUILDER:START Pro only
|
||||
// $javascript->addFieldGeneric( 'team_name', 'varchar', $app_strings['LBL_TEAM'] ,'true');
|
||||
// $javascript->addToValidateBinaryDependency('team_name', 'alpha', $app_strings['ERR_SQS_NO_MATCH_FIELD'] . $app_strings['LBL_TEAM'], 'false', '', 'team_id');
|
||||
//BUILDER:END Pro only
|
||||
|
||||
$javascript->addToValidateBinaryDependency('assigned_user_name', 'alpha', $app_strings['ERR_SQS_NO_MATCH_FIELD'] . $app_strings['LBL_ASSIGNED_TO'], 'false', '', 'assigned_user_id');
|
||||
|
||||
echo $javascript->getScript();
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// SELECT CHANGES TEXT INPUT FIELD
|
||||
/*
|
||||
$prob_array = $json->encode($app_list_strings['sales_probability_dom']);
|
||||
$prePopProb = '';
|
||||
if(empty($focus->id)) $prePopProb = 'document.getElementsByName(\'sales_stage\')[0].onchange();';
|
||||
echo <<<EOQ
|
||||
<script>
|
||||
prob_array = $prob_array;
|
||||
document.getElementsByName('sales_stage')[0].onchange = function() {
|
||||
if(typeof(document.getElementsByName('sales_stage')[0].value) != "undefined" && prob_array[document.getElementsByName('sales_stage')[0].value]) {
|
||||
document.getElementsByName('probability')[0].value = prob_array[document.getElementsByName('sales_stage')[0].value];
|
||||
}
|
||||
};
|
||||
$prePopProb
|
||||
</script>
|
||||
EOQ;
|
||||
*/
|
||||
//
|
||||
/// SELECT CHANGES TEXT INPUT FIELD
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
require_once('modules/SavedSearch/SavedSearch.php');
|
||||
$savedSearch = new SavedSearch();
|
||||
$json = getJSONobj();
|
||||
$savedSearchSelects = $json->encode(array($GLOBALS['app_strings']['LBL_SAVED_SEARCH_SHORTCUT'] . '<br>' . $savedSearch->getSelect('EcmDocuments')));
|
||||
$str = "<script>
|
||||
YAHOO.util.Event.addListener(window, 'load', SUGAR.util.fillShortcuts, $savedSearchSelects);
|
||||
</script>";
|
||||
echo $str;
|
||||
|
||||
?>
|
||||
111
modules/EcmDocuments/Forms.php
Executable file
111
modules/EcmDocuments/Forms.php
Executable 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('EcmDocuments', '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="EcmDocumentSave" onSubmit="return check_form('EcmDocumentsSave')" method="POST" action="index.php">
|
||||
<input type="hidden" name="module" value="EcmDocuments">
|
||||
<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} <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/EcmDocuments/EcmDocument.php');
|
||||
$javascript = new javascript();
|
||||
$javascript->setFormName('EcmDocumentsSave}');
|
||||
$javascript->setSugarBean(new EcmDocument());
|
||||
$javascript->addRequiredFields('');
|
||||
$the_form .= $javascript->getScript();
|
||||
$the_form .= get_left_form_footer();
|
||||
|
||||
return $the_form;
|
||||
}
|
||||
|
||||
?>
|
||||
238
modules/EcmDocuments/ListView.php
Executable file
238
modules/EcmDocuments/ListView.php
Executable file
@@ -0,0 +1,238 @@
|
||||
<?php
|
||||
/*****************************************************************************
|
||||
* The contents of this file are subject to the RECIPROCAL PUBLIC LICENSE
|
||||
* Version 1.1 ("License"); You may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
* http://opensource.org/licenses/rpl.php. Software distributed under the
|
||||
* License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
|
||||
* either express or implied.
|
||||
*
|
||||
* You may:
|
||||
* a) Use and distribute this code exactly as you received without payment or
|
||||
* a royalty or other fee.
|
||||
* b) Create extensions for this code, provided that you make the extensions
|
||||
* publicly available and document your modifications clearly.
|
||||
* c) Charge for a fee for warranty or support or for accepting liability
|
||||
* obligations for your customers.
|
||||
*
|
||||
* You may NOT:
|
||||
* a) Charge for the use of the original code or extensions, including in
|
||||
* electronic distribution models, such as ASP (Application Service
|
||||
* Provider).
|
||||
* b) Charge for the original source code or your extensions other than a
|
||||
* nominal fee to cover distribution costs where such distribution
|
||||
* involves PHYSICAL media.
|
||||
* c) Modify or delete any pre-existing copyright notices, change notices,
|
||||
* or License text in the Licensed Software
|
||||
* d) Assert any patent claims against the Licensor or Contributors, or
|
||||
* which would in any way restrict the ability of any third party to use the
|
||||
* Licensed Software.
|
||||
*
|
||||
* You must:
|
||||
* a) Document any modifications you make to this code including the nature of
|
||||
* the change, the authors of the change, and the date of the change.
|
||||
* b) Make the source code for any extensions you deploy available via an
|
||||
* Electronic Distribution Mechanism such as FTP or HTTP download.
|
||||
* c) Notify the licensor of the availability of source code to your extensions
|
||||
* and include instructions on how to acquire the source code and updates.
|
||||
* d) Grant Licensor a world-wide, non-exclusive, royalty-free license to use,
|
||||
* reproduce, perform, modify, sublicense, and distribute your extensions.
|
||||
*
|
||||
* The Original Code is: CommuniCore
|
||||
* Olavo Farias
|
||||
* 2006-04-7 olavo.farias@gmail.com
|
||||
*
|
||||
* The Initial Developer of the Original Code is CommuniCore.
|
||||
* Portions created by CommuniCore are Copyright (C) 2005 CommuniCore Ltda
|
||||
* All Rights Reserved.
|
||||
********************************************************************************/
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
|
||||
require_once ('XTemplate/xtpl.php');
|
||||
require_once ("data/Tracker.php");
|
||||
require_once ('modules/EcmDocuments/EcmDocument.php');
|
||||
require_once ('themes/'.$theme.'/layout_utils.php');
|
||||
require_once ('log4php/LoggerManager.php');
|
||||
require_once('include/ListView/ListViewSmarty.php');
|
||||
|
||||
require_once('modules/Currencies/Currency.php');
|
||||
|
||||
if(file_exists('custom/modules/EcmDocuments/metadata/listviewdefs.php')){
|
||||
require_once('custom/modules/EcmDocuments/metadata/listviewdefs.php');
|
||||
}else{
|
||||
require_once('modules/EcmDocuments/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, 'EcmDocuments');
|
||||
|
||||
global $urlPrefix;
|
||||
global $currentModule;
|
||||
|
||||
global $theme;
|
||||
global $current_user;
|
||||
// FOCUS_LIST IS THE MEANS OF PASSING DATA TO A LISTVIEW.
|
||||
global $focus_list;
|
||||
|
||||
// SETUP QUICKSEARCH
|
||||
require_once('include/QuickSearchDefaults.php');
|
||||
$qsd = new QuickSearchDefaults();
|
||||
|
||||
// CLEAR THE DISPLAY COLUMNS BACK TO DEFAULT WHEN CLEAR QUERY IS CALLED
|
||||
if(!empty($_REQUEST['clear_query']) && $_REQUEST['clear_query'] == 'true')
|
||||
$current_user->setPreference('ListViewDisplayColumns', array(), 0, $currentModule);
|
||||
|
||||
$savedDisplayColumns = $current_user->getPreference('ListViewDisplayColumns', $currentModule); // GET USER DEFINED DISPLAY COLUMNS
|
||||
|
||||
$json = getJSONobj();
|
||||
|
||||
$seedEcmDocument = new EcmDocument(); // SEED BEAN
|
||||
$searchForm = new SearchForm('EcmDocuments', $seedEcmDocument); // 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['EcmDocuments'][$col]))
|
||||
$displayColumns[$col] = $listViewDefs['EcmDocuments'][$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['EcmDocuments'] 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
|
||||
$z="select * from ecmdocuments_permissions where ecmdocuments_permissions.iddir='1' and ecmdocuments_permissions.userid='".$current_user->id."'";
|
||||
$w=$GLOBALS['db']->query($z);
|
||||
$r=$GLOBALS['db']->fetchByAssoc($w);
|
||||
$read[0]=$r['read'];
|
||||
$ids[0]=$r['iddir'];
|
||||
|
||||
$z="select * from ecmdocuments_permissions where ecmdocuments_permissions.iddir='64' and ecmdocuments_permissions.userid='".$current_user->id."'";
|
||||
$w=$GLOBALS['db']->query($z);
|
||||
$r=$GLOBALS['db']->fetchByAssoc($w);
|
||||
$read[1]=$r['read'];
|
||||
$ids[1]=$r['iddir'];
|
||||
|
||||
if((int)$read[0]==1)$or="and ecmdocuments.id='".$ids[0]."'";
|
||||
if((int)$read[1]==1)$or="and ecmdocuments.id='".$ids[1]."'";
|
||||
if((int)$read[0]==1 && (int)$read[1]==1)$or="and (ecmdocuments.id='".$ids[0]."' or ecmdocuments.id='".$ids[1]."')";
|
||||
if(is_admin($current_user))$or="";
|
||||
|
||||
if (!isset($where)) $where = " ecmdocuments.iddir='0' ".$or;
|
||||
if($_GET['record']!="")$where=" ecmdocuments.iddir='".$_GET['record']."' ";
|
||||
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, "EcmDocument"); // 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");
|
||||
}
|
||||
$r=$GLOBALS['db']->fetchByAssoc($GLOBALS['db']->query("select treesearch from users where id='".$_SESSION['authenticated_user_id']."'"));
|
||||
$treesearch=$r['treesearch'];
|
||||
if($treesearch==1 || is_admin($current_user))
|
||||
{
|
||||
print '<form action="index.php?module=EcmDocuments&action=SearchDir&record='.$_REQUEST['record'].'" enctype="multipart/form-data" method="post">
|
||||
<ul class="tablist">
|
||||
<li class="active"><a class="current" href="index.php?module=EcmDocuments&action=DetailView&record='.$_GET['record'].'&tab=Tree">Tree</a></li>
|
||||
<li><a href="index.php?module=EcmDocuments&action=SearchProjects&record='.$_GET['record'].'&tab=All&start=1">All</a></li>
|
||||
<li><a href="index.php?module=EcmDocuments&action=SearchProjects&record='.$_GET['record'].'&tab=EcmDocs&start=1">EcmFiles</a></li>
|
||||
<li><a href="index.php?module=EcmDocuments&action=SearchProjects&record='.$_GET['record'].'&tab=EcmCorrespondenceIns&start=1">Correspondence In</a></li>
|
||||
<li><a href="index.php?module=EcmDocuments&action=SearchProjects&record='.$_GET['record'].'&tab=EcmCorrespondenceOuts&start=1">Correspondence Out</a></li>
|
||||
<li><a href="index.php?module=EcmDocuments&action=SearchProjects&record='.$_GET['record'].'&tab=EcmContracts&start=1">Contracts</a></li>
|
||||
<li><a href="index.php?module=EcmDocuments&action=SearchProjects&record='.$_GET['record'].'&tab=EcmInvoiceIns&start=1">Invoice In</a></li>
|
||||
<li><a href="index.php?module=EcmDocuments&action=SearchProjects&record='.$_GET['record'].'&tab=EcmInvoiceOuts&start=1">Invoice Out</a>
|
||||
</ul>
|
||||
<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">Go To File/Dir</span sugar="slot"></td>
|
||||
<td width="30%" valign="top" class="dataField"><span sugar="slot1b"><input type="text" name="searchdir" value="'.$_SESSION['searchdir'].'"></span sugar="slot"></td>
|
||||
<td width="20%" valign="top" class="dataLabel"><span sugar="slot`3`"></span sugar="slot"></td>
|
||||
<td width="30%" valign="top" class="dataField"><span sugar="slot`3`b">
|
||||
</span sugar="slot"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table><input type="submit" name="searchdirsubmit" value="Search" class="button">
|
||||
</form>
|
||||
<br>';
|
||||
}
|
||||
// START DISPLAY
|
||||
// WHICH TAB OF SEARCH FORM TO DISPLAY
|
||||
/*
|
||||
if(!isset($_REQUEST['search_form']) || $_REQUEST['search_form'] != 'false') {
|
||||
$searchForm->setup();
|
||||
if(isset($_REQUEST['searchFormTab']) && $_REQUEST['searchFormTab'] == 'advanced_search') {
|
||||
$searchForm->displayAdvanced();
|
||||
}elseif(isset($_REQUEST['searchFormTab']) && $_REQUEST['searchFormTab'] == 'saved_views'){
|
||||
$searchForm->displaySavedViews($listViewDefs, $lv);
|
||||
}else {
|
||||
$searchForm->displayBasic();
|
||||
}
|
||||
}
|
||||
echo $qsd->GetQSScripts();*/
|
||||
$lv->setup($seedEcmDocument, 'include/ListView/ListViewGeneric.tpl', $where, $params);
|
||||
$savedSearchName = empty($_REQUEST['saved_search_select_name']) ? '' : (' - ' . $_REQUEST['saved_search_select_name']);
|
||||
echo get_form_header($current_module_strings['LBL_LIST_FORM_TITLE'] . $savedSearchName, '', false);
|
||||
echo $lv->display();
|
||||
|
||||
$savedSearch = new SavedSearch();
|
||||
$json = getJSONobj();
|
||||
// FILLS IN SAVED VIEWS SELECT BOX ON SHORTCUT MENU
|
||||
$savedSearchSelects = $json->encode(array($GLOBALS['app_strings']['LBL_SAVED_SEARCH_SHORTCUT'] . '<br>' . $savedSearch->getSelect('EcmDocuments')));
|
||||
$str = "<script>
|
||||
YAHOO.util.Event.addListener(window, 'load', SUGAR.util.fillShortcuts, $savedSearchSelects);
|
||||
</script>";
|
||||
echo $str;
|
||||
?>
|
||||
38
modules/EcmDocuments/ListViewAjax.php
Executable file
38
modules/EcmDocuments/ListViewAjax.php
Executable file
@@ -0,0 +1,38 @@
|
||||
<?
|
||||
function ListViewAjax($where,$table,$module)
|
||||
{
|
||||
require_once("modules/".$module."/row_template.php");
|
||||
|
||||
if($where)$z="SELECT ".$table.".*,users.user_name as assigned_user_name FROM ".$table." LEFT JOIN users ON (".$table.".assigned_user_id=users.id) WHERE ".$where." and ".$table.".deleted='0'";
|
||||
else $z="SELECT ".$table.".*,users.user_name as assigned_user_name FROM ".$table." LEFT JOIN users ON (".$table.".assigned_user_id=users.id) WHERE ".$table.".deleted='0'";
|
||||
if($_REQUEST['order_by'])$z.=" ORDER BY ".$_REQUEST['order_by'];
|
||||
if($_REQUEST['sorder'])$z.=" ".$_REQUEST['sorder'];
|
||||
$w=mysql_query($z);
|
||||
$num=mysql_num_rows($w);
|
||||
$html=$z.'
|
||||
<table cellpadding="0" cellspacing="0" width="100%" border="0" class="listView">
|
||||
<tr>
|
||||
<td COLSPAN="20" align="right">
|
||||
<table border="0" cellpadding="0" cellspacing="0" width="100%"><tr><td align="left" class="listViewPaginationTdS1"><a id=\'export_link\' onclick=\'return export_overlib();\' href="#" class="listViewPaginationLinkS1"><img src=\'themes/Sugar/images/export.gif\' width=\'10\' height=\'9\' alt=\'Export\' border=\'0\' align=\'absmiddle\'> Export</a> | Selected: <input class=\'listViewPaginationTdS1\' style=\'border: 0px; background: transparent; font-size: inherit; color: inherit\' type=\'text\' readonly name=\'selectCount[]\' value=\'0\' /></td>
|
||||
<td nowrap align="right" class="listViewPaginationTdS1" id=\'listViewPaginationButtons\'><img src=\'themes/Sugar/images/start_off.gif\' width=\'13\' height=\'11\' alt=\'Start\' border=\'0\' align=\'absmiddle\'> Start <img src=\'themes/Sugar/images/previous_off.gif\' width=\'8\' height=\'11\' alt=\'Previous\' border=\'0\' align=\'absmiddle\'> Previous <span class=\'pageNumbers\'>(1 - 7 of 7)</span> Next <img src=\'themes/Sugar/images/next_off.gif\' width=\'8\' height=\'11\' alt=\'Next\' border=\'0\' align=\'absmiddle\'> End <img src=\'themes/Sugar/images/end_off.gif\' width=\'13\' height=\'11\' alt=\'End\' border=\'0\' align=\'absmiddle\'></td></tr></table>
|
||||
</td>
|
||||
</tr>';
|
||||
$html.=HeaderTemplate();
|
||||
while($r=mysql_fetch_array($w))
|
||||
{
|
||||
$html.=RowTemplate($r);
|
||||
}
|
||||
$html.="</table>";
|
||||
return $html;
|
||||
}
|
||||
|
||||
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']);
|
||||
mysql_query("set names utf8");
|
||||
mysql_query("set charaecter set utf8");
|
||||
echo ListViewAjax($_REQUEST['where'],$_REQUEST['table'],$_REQUEST['module']);
|
||||
mysql_close($sql);
|
||||
?>
|
||||
|
||||
74
modules/EcmDocuments/Menu.php
Executable file
74
modules/EcmDocuments/Menu.php
Executable file
@@ -0,0 +1,74 @@
|
||||
<?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.
|
||||
********************************************************************************/
|
||||
/*********************************************************************************
|
||||
* EACH INDEX OF MODULE_MENU MUST BE AN ARRAY OF:
|
||||
* THE LINK URL, DISPLAY TEXT FOR THE LINK, AND THE ICON NAME.
|
||||
********************************************************************************/
|
||||
|
||||
global $mod_strings;
|
||||
|
||||
$selectshortcut="<select onchange='location.href=this.value;'><option>select</option>";
|
||||
$z1="select iddir from ecmdocuments_shortcuts where userid='".$_SESSION['authenticated_user_id']."'";
|
||||
$w1=$GLOBALS['db']->query($z1);
|
||||
while($r1=$GLOBALS['db']->fetchByAssoc($w1))
|
||||
{
|
||||
$shdir=$r1['iddir'];
|
||||
$z="select name,id from ecmdocuments where id='".$shdir."'";
|
||||
$w=$GLOBALS['db']->query($z);
|
||||
$r=$GLOBALS['db']->fetchByAssoc($w);
|
||||
$selectshortcut.="<option value='index.php?module=EcmDocuments&action=DetailView&record=".$r['id']."'>".$r['name']."</option>";
|
||||
}
|
||||
$selectshortcut.="</select>";
|
||||
|
||||
if(ACLController::checkAccess('EcmDocuments', 'list', true))
|
||||
$module_menu[] = Array('#', " ".$selectshortcut, '');
|
||||
if(ACLController::checkAccess('EcmDocuments','list', true)) $module_menu[] = Array('#', '<span style="display: none">wp_shortcut_fill_0</span>', '');
|
||||
|
||||
?>
|
||||
100
modules/EcmDocuments/Merge.php
Executable file
100
modules/EcmDocuments/Merge.php
Executable file
@@ -0,0 +1,100 @@
|
||||
<?
|
||||
print $_REQUEST['return_module'];
|
||||
if($_REQUEST['return_module']=="Contacts")
|
||||
{
|
||||
$field_id="contact_id";
|
||||
$table="contacts";
|
||||
}
|
||||
if($_REQUEST['return_module']=="Accounts")
|
||||
{
|
||||
$field_id="account_id";
|
||||
$table="accounts";
|
||||
}
|
||||
function getValue($field,$items)
|
||||
{
|
||||
global $field_id,$table;
|
||||
foreach($items as $item)$wh[]="id='".$item."'";
|
||||
$where=implode(" or ",$wh);
|
||||
|
||||
$query=mysql_query("select ".$field." from ".$table." where (".$where.") and deleted='0' order by date_modified desc");
|
||||
while($row=mysql_fetch_array($query))
|
||||
{
|
||||
if($row[$field])return $row[$field];
|
||||
else continue;
|
||||
}
|
||||
}
|
||||
function setRelations($relation,$items,$merged_item)
|
||||
{
|
||||
global $field_id,$table;
|
||||
foreach($items as $item)
|
||||
{
|
||||
mysql_query("update ".$relation." set ".$field_id."='".$merged_item."' where ".$field_id."='".$item."'");
|
||||
if($table=="contacts")
|
||||
{
|
||||
$r=mysql_fetch_array(mysql_query("select first_name,last_name from contacts where id='".$merged_item."'"));
|
||||
$name=$r['first_name']." ".$r['last_name'];
|
||||
mysql_query("update tasks set parent_id='".$merged_item."',parent_name='".$name."' where parent_id='".$item."'");
|
||||
}
|
||||
if($table=="accounts")
|
||||
{
|
||||
$r=mysql_fetch_array(mysql_query("select name from accounts where id='".$merged_item."'"));
|
||||
$name=$r['name'];
|
||||
mysql_query("update ecmcontracts set contractant_id='".$merged_item."',contractant_name='".$name."' where contractant_id='".$item."'");
|
||||
mysql_query("update ecmcontracts set group_id='".$merged_item."',group_name='".$name."' where group_id='".$item."'");
|
||||
mysql_query("update ecmcorrespondenceins set account_from='".$merged_item."',account_name_from='".$name."' where account_from='".$item."'");
|
||||
mysql_query("update ecmcorrespondenceins set account_to='".$merged_item."',account_name_to='".$name."' where account_to='".$item."'");
|
||||
mysql_query("update ecmcorrespondenceouts set account_from='".$merged_item."',account_from_name='".$name."' where account_from='".$item."'");
|
||||
mysql_query("update ecmcorrespondenceouts set account_to='".$merged_item."',account_to_name='".$name."' where account_to='".$item."'");
|
||||
mysql_query("update ecminvoiceins set from_id='".$merged_item."',from_name='".$name."' where from_id='".$item."'");
|
||||
mysql_query("update ecminvoiceins set to_id='".$merged_item."',to_name='".$name."' where to_id='".$item."'");
|
||||
mysql_query("update ecminvoiceouts set from_id='".$merged_item."',from_name='".$name."' where from_id='".$item."'");
|
||||
mysql_query("update ecminvoiceouts set to_id='".$merged_item."',to_name='".$name."' where to_id='".$item."'");
|
||||
|
||||
mysql_query("update meetings set account_id='".$merged_item."',account_name='".$name."' where account_id='".$item."'");
|
||||
mysql_query("update calls set account_id='".$merged_item."',account_name='".$name."' where account_id='".$item."'");
|
||||
mysql_query("update tasks set account_id='".$merged_item."',account_name='".$name."' where account_id='".$item."'");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach($_REQUEST['check'] as $check)
|
||||
{
|
||||
if($check!=$_REQUEST['first'])$va[]=$check;
|
||||
}
|
||||
if(!$_REQUEST['first'])$_REQUEST['first']=$va[0];
|
||||
foreach($va as $v)
|
||||
{
|
||||
if($v!=$_REQUEST['first'])$items[]=$v;
|
||||
}
|
||||
|
||||
$merged_item=$_REQUEST['first'];
|
||||
|
||||
//print "first: ".$merged_item;
|
||||
if($_REQUEST['return_module']=="Contacts")
|
||||
{
|
||||
$fields=array("salutation","first_name","last_name","lead_source","title","department","reports_to_id","birthdate","do_not_call","phone_home","phone_mobile","phone_work","phone_other","phone_fax","email1","email2","assistant","assistant_phone","email_opt_out","primary_address_street","primary_address_city","primary_address_state","primary_address_postalcode","primary_address_country","alt_address_street","alt_address_city","alt_address_state","alt_address_postalcode","alt_address_country","description","portal_name","portal_active","portal_app","invalid_email");
|
||||
$relations=array("calls_contacts","ecmdocuments_contacts","emails_contacts","meetings_contacts","projects_contacts","contacts_users");
|
||||
}
|
||||
if($_REQUEST['return_module']=="Accounts")
|
||||
{
|
||||
$fields=array("parent_id","account_type","industry","annual_revenue","phone_fax","billing_address_street","billing_address_city","billing_address_state","billing_address_postalcode","billing_address_country","description","rating","phone_office","phone_alternate","email1","email2","website","ownership","employees","sic_code","ticker_symbol","shipping_address_street","shipping_address_city","shipping_address_state","shipping_address_postalcode","shipping_address_country","bank","bank_no");
|
||||
$relations=array('ecmdocuments_accounts','accounts_contacts','accounts_opportunities');
|
||||
}
|
||||
foreach($fields as $field)
|
||||
{
|
||||
$r=mysql_fetch_array(mysql_query("select ".$field." from ".$table." where id='".$merged_item."'"));
|
||||
if(!$r[$field])$fi[]=$field."='".getValue($field,$items)."'";
|
||||
}
|
||||
$set=implode(",",$fi);
|
||||
|
||||
mysql_query("update ".$table." set ".$set." where id='".$merged_item."'");
|
||||
foreach($relations as $relation)setRelations($relation,$items,$merged_item);
|
||||
|
||||
foreach($items as $item)
|
||||
{
|
||||
mysql_query("update ".$table." set modified_user_id='".$_SESSION['authenticated_user_id']."',date_modified='".date("Y-m-d H:i:s")."',deleted='1' where id='".$item."'");
|
||||
}
|
||||
|
||||
if($_REQUEST['backtounified']==1)header("Location: ".$_SERVER['HTTP_REFERER']);
|
||||
else header("Location: index.php?module=".$_REQUEST['return_module']."&action=index#title");
|
||||
?>
|
||||
57
modules/EcmDocuments/Popup.php
Executable file
57
modules/EcmDocuments/Popup.php
Executable 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();
|
||||
|
||||
?>
|
||||
147
modules/EcmDocuments/Popup_picker.php
Executable file
147
modules/EcmDocuments/Popup_picker.php
Executable 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/EcmDocuments/EcmDocument.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", "ecmdocuments.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/EcmDocuments/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 EcmDocument();
|
||||
$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', 'ECMDOCUMENT');
|
||||
$ListView->setModStrings($mod_strings);
|
||||
|
||||
ob_start();
|
||||
$ListView->processListView($seed_bean, 'main', 'ECMDOCUMENT');
|
||||
$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
|
||||
?>
|
||||
418
modules/EcmDocuments/ReminderWindow.php
Executable file
418
modules/EcmDocuments/ReminderWindow.php
Executable file
@@ -0,0 +1,418 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2" />
|
||||
<title>Celtic CRM</title>
|
||||
</head>
|
||||
<body>
|
||||
<?
|
||||
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']);
|
||||
session_start();
|
||||
mysql_query("set names utf8");
|
||||
|
||||
if($_POST['update1']==1)
|
||||
{
|
||||
if(count($_POST['check']))
|
||||
{
|
||||
foreach($_POST['check'] as $check)
|
||||
{
|
||||
if($check)
|
||||
{
|
||||
$time_start=date("H:i:s",strtotime($_REQUEST['date'][6].$_REQUEST['date'][7].$_REQUEST['date'][8].$_REQUEST['date'][9]."-".$_REQUEST['date'][3].$_REQUEST['date'][4]."-".$_REQUEST['date'][0].$_REQUEST['date'][1]." ".$_REQUEST['hour'].":".$_REQUEST['minute'].":00")-7200);
|
||||
mysql_query("update calls set date_start='".$_REQUEST['date'][6].$_REQUEST['date'][7].$_REQUEST['date'][8].$_REQUEST['date'][9]."-".$_REQUEST['date'][3].$_REQUEST['date'][4]."-".$_REQUEST['date'][0].$_REQUEST['date'][1]."',time_start='".$time_start."' where id='".$check."'");
|
||||
mysql_query("update meetings set date_start='".$_REQUEST['date'][6].$_REQUEST['date'][7].$_REQUEST['date'][8].$_REQUEST['date'][9]."-".$_REQUEST['date'][3].$_REQUEST['date'][4]."-".$_REQUEST['date'][0].$_REQUEST['date'][1]."',time_start='".$time_start."' where id='".$check."'");
|
||||
mysql_query("update tasks set date_start='".$_REQUEST['date'][6].$_REQUEST['date'][7].$_REQUEST['date'][8].$_REQUEST['date'][9]."-".$_REQUEST['date'][3].$_REQUEST['date'][4]."-".$_REQUEST['date'][0].$_REQUEST['date'][1]."',time_start='".$time_start."' where id='".$check."'");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if($_POST['closeselected1']==1)
|
||||
{
|
||||
if(count($_POST['check']))
|
||||
{
|
||||
foreach($_POST['check'] as $check)
|
||||
{
|
||||
if($check)
|
||||
{
|
||||
mysql_query("update calls set status='Held',reminder_time='-1' where id='".$check."'");
|
||||
mysql_query("update meetings set status='Held',reminder_time='-1' where id='".$check."'");
|
||||
mysql_query("update tasks set status='Completed' where id='".$check."'");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if($_POST['discard1']==1)
|
||||
{
|
||||
if(count($_POST['check']))
|
||||
{
|
||||
foreach($_POST['check'] as $check)
|
||||
{
|
||||
if($check)
|
||||
{
|
||||
mysql_query("update calls set reminder_time='-1' where id='".$check."'");
|
||||
mysql_query("update meetings set reminder_time='-1' where id='".$check."'");
|
||||
//mysql_query("update tasks set reminder_time='-1' where id='".$check."'");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if($_POST['updatesec1']==1)
|
||||
{
|
||||
if(count($_POST['check']))
|
||||
{
|
||||
foreach($_POST['check'] as $check)
|
||||
{
|
||||
if($check)
|
||||
{
|
||||
/*
|
||||
$r=mysql_fetch_array(mysql_query("select reminder_time,date_start,time_start from calls where id='".$check."'"));
|
||||
if($r['date_start'] && $r['time_start'] && $r['reminder_time'])
|
||||
{
|
||||
$rt=$r['reminder_time'];
|
||||
$new_date=gmdate("Y-m-d H:i:s",time()+$_POST['sec']+$rt);
|
||||
$ndate=explode(" ",$new_date);
|
||||
mysql_query("update calls set date_start='".$ndate[0]."',time_start='".$ndate[1]."' where id='".$check."'");
|
||||
}
|
||||
$r=mysql_fetch_array(mysql_query("select reminder_time,date_start,time_start from meetings where id='".$check."'"));
|
||||
if($r['date_start'] && $r['time_start'] && $r['reminder_time'])
|
||||
{
|
||||
$rt=$r['reminder_time'];
|
||||
$new_date=gmdate("Y-m-d H:i:s",time()+$_POST['sec']+$rt);
|
||||
$ndate=explode(" ",$new_date);
|
||||
mysql_query("update meetings set date_start='".$ndate[0]."',time_start='".$ndate[1]."' where id='".$check."'");
|
||||
}
|
||||
$r=mysql_fetch_array(mysql_query("select date_start,time_start from tasks where id='".$check."'"));
|
||||
if($r['date_start'] && $r['time_start'])
|
||||
{
|
||||
$rt=$r['reminder_time'];
|
||||
$new_date=gmdate("Y-m-d H:i:s",time()+$_POST['sec']+$rt);
|
||||
$ndate=explode(" ",$new_date);
|
||||
mysql_query("update tasks set date_start='".$ndate[0]."',time_start='".$ndate[1]."' where id='".$check."'");
|
||||
}
|
||||
*/
|
||||
$r=mysql_fetch_array(mysql_query("select reminder_time,date_start,time_start from calls where id='".$check."'"));
|
||||
if($r['date_start'] && $r['time_start'] && $r['reminder_time'])
|
||||
{
|
||||
$ts=explode(":",$r['time_start']);
|
||||
$ds=explode("-",$r['date_start']);
|
||||
$new_date=gmdate("Y-m-d H:i:s",mktime($ts[0],$ts[1],$ts[2],$ds[1],$ds[2],$ds[0])+$_POST['rsec']+7200);
|
||||
$ndate=explode(" ",$new_date);
|
||||
mysql_query("update calls set date_start='".$ndate[0]."',time_start='".$ndate[1]."' where id='".$check."'");
|
||||
}
|
||||
$r=mysql_fetch_array(mysql_query("select reminder_time,date_start,time_start from meetings where id='".$check."'"));
|
||||
if($r['date_start'] && $r['time_start'] && $r['reminder_time'])
|
||||
{
|
||||
$ts=explode(":",$r['time_start']);
|
||||
$ds=explode("-",$r['date_start']);
|
||||
$new_date=gmdate("Y-m-d H:i:s",mktime($ts[0],$ts[1],$ts[2],$ds[1],$ds[2],$ds[0])+$_POST['rsec']+7200);
|
||||
$ndate=explode(" ",$new_date);
|
||||
mysql_query("update meetings set date_start='".$ndate[0]."',time_start='".$ndate[1]."' where id='".$check."'");
|
||||
}
|
||||
$r=mysql_fetch_array(mysql_query("select date_start,time_start from tasks where id='".$check."'"));
|
||||
if($r['date_start'] && $r['time_start'])
|
||||
{
|
||||
$ts=explode(":",$r['time_start']);
|
||||
$ds=explode("-",$r['date_start']);
|
||||
$new_date=gmdate("Y-m-d H:i:s",mktime($ts[0],$ts[1],$ts[2],$ds[1],$ds[2],$ds[0])+$_POST['rsec']+7200);
|
||||
$ndate=explode(" ",$new_date);
|
||||
mysql_query("update tasks set date_start='".$ndate[0]."',time_start='".$ndate[1]."' where id='".$check."'");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if($_POST['reminder1']==1)
|
||||
{
|
||||
if(count($_POST['check']))
|
||||
{
|
||||
foreach($_POST['check'] as $check)
|
||||
{
|
||||
if($check)
|
||||
{
|
||||
$r=mysql_fetch_array(mysql_query("select reminder_time from calls where id='".$check."'"));
|
||||
$rtime=$r['reminder_time']-$_REQUEST['reminder_minutes']+$_REQUEST['reminder_hours'];
|
||||
if($rtime<0)$rtime=60;
|
||||
mysql_query("update calls set reminder_time='".$rtime."' where id='".$check."'");
|
||||
|
||||
$r=mysql_fetch_array(mysql_query("select reminder_time from meetings where id='".$check."'"));
|
||||
$rtime=$r['reminder_time']-$_REQUEST['reminder_minutes']+$_REQUEST['reminder_hours'];
|
||||
if($rtime<0)$rtime=60;
|
||||
mysql_query("update meetings set reminder_time='".$rtime."' where id='".$check."'");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
<script type="text/javascript" src="include/javascript/cookie.js?s=4.5.0g&c="></script>
|
||||
<script>jscal_today = 1.213179783E+012; if(typeof app_strings == "undefined") app_strings = new Array();</script>
|
||||
<script type="text/javascript" src="../../jscalendar/calendar.js?s=4.5.0g&c="></script>
|
||||
<script type="text/javascript" src="../../jscalendar/lang/calendar-en.js?s=4.5.0g&c="></script>
|
||||
<script type="text/javascript" src="../../jscalendar/calendar-setup_3.js?s=4.5.0g&c="></script>
|
||||
<script src="../../include/javascript/yui/YAHOO.js?s=4.5.0g&c="></script>
|
||||
<script src="../../include/javascript/yui/log.js?s=4.5.0g&c="></script>
|
||||
<script src="../../include/javascript/yui/dom.js?s=4.5.0g&c="></script>
|
||||
<script src="../../include/javascript/yui/event.js?s=4.5.0g&c="></script>
|
||||
<script src="../../include/javascript/yui/animation.js?s=4.5.0g&c="></script>
|
||||
<script src="../../include/javascript/yui/connection.js?s=4.5.0g&c="></script>
|
||||
<script src="../../include/javascript/yui/dragdrop.js?s=4.5.0g&c="></script>
|
||||
<script src="../../include/javascript/yui/ygDDList.js?s=4.5.0g&c="></script>
|
||||
<script src="mintajax.js"></script>
|
||||
<script type="text/javascript" src="../../include/javascript/sugar_3.js?s=4.5.0g&c="></script>
|
||||
<script type="text/javascript">
|
||||
var time_reg_format = '([0-9]{1,2}):([0-9]{1,2})';
|
||||
var date_reg_format = '([0-9]{1,2}).([0-9]{1,2}).([0-9]{4})';
|
||||
var date_reg_positions = {'d': 1,'m': 2,'Y': 3};
|
||||
var time_separator = ':';
|
||||
var cal_date_format = '%d.%m.%Y';
|
||||
var time_offset = 0;
|
||||
</script>
|
||||
<script type="text/javascript" src="../../cache/jsLanguage/en_us.js?s=4.5.0g&c=&j=4"></script>
|
||||
<script type="text/javascript" src="../../cache/jsLanguage/Contacts/en_us.js?s=4.5.0g&c=&j=4"></script>
|
||||
<script type="text/javascript" src="../../include/javascript/sugar_3.js?s=4.5.0g&c="></script>
|
||||
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
||||
<style type="text/css">
|
||||
@import url("../../themes/Sugar/style.css?s=4.5.0g&c=");
|
||||
</style>
|
||||
<link href="../../themes/Sugar/colors.sugar.css?s=4.5.0g&c=" rel="stylesheet" type="text/css" title="sugar" />
|
||||
<link rel="stylesheet" type="text/css" media="all" href="../../themes/Sugar/calendar-win2k-cold-1.css?s=4.5.0g&c=">
|
||||
|
||||
|
||||
<table width="618" cellpadding="0" cellspacing="0" border="0" class="h3Row">
|
||||
<tr>
|
||||
<td nowrap><h3>Remind List</h3></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
<form action="ReminderWindow.php" method="POST">
|
||||
<table width="618" border="0" cellspacing="0" cellpadding="0" class="listView">
|
||||
<tr>
|
||||
<td scope="col" width="30" class="listViewThS1" NOWRAP><input type="checkbox" name="selectall" id="selectall" value="1" onclick="selectallitems();" /></td>
|
||||
<td scope="col" width="20" class="listViewThS1" NOWRAP> </td>
|
||||
<td scope="col" width="212" class="listViewThS1" nowrap="nowrap">Name </td>
|
||||
<td scope="col" width="79" class="listViewThS1" nowrap="nowrap">Reminder </td>
|
||||
<td scope="col" width="122" class="listViewThS1" nowrap="nowrap">Time </td>
|
||||
<td scope="col" width="30" class="listViewThS1" NOWRAP> </td>
|
||||
<td scope="col" width="30" class="listViewThS1" NOWRAP> </td>
|
||||
</tr>
|
||||
</table>
|
||||
<div style="overflow:auto;height:300px;width:618px;">
|
||||
<?
|
||||
function getList($type)
|
||||
{
|
||||
$i=0;
|
||||
if($type=="tasks")
|
||||
{
|
||||
$rem="";
|
||||
$status="Completed";
|
||||
}
|
||||
else
|
||||
{
|
||||
$rem=" and reminder_time!='-1'";
|
||||
$status="Held";
|
||||
}
|
||||
$w=mysql_query("select * from ".$type." where deleted='0' and assigned_user_id='".$_SESSION['authenticated_user_id']."' and status!='".$status."'".$rem." order by date_start desc, time_start asc");
|
||||
while($r=mysql_fetch_array($w))
|
||||
{
|
||||
$ts=explode(":",$r['time_start']);
|
||||
$ds=explode("-",$r['date_start']);
|
||||
if(mktime($ts[0],$ts[1],$ts[2],$ds[1],$ds[2],$ds[0])+7200<=mktime(date("H"),date("i"),date("s"),date("m"),date("d"),date("Y"))+$r['reminder_time'])
|
||||
{
|
||||
$name[$i]['date_start']=$r['date_start'];
|
||||
$ts=explode(":",$r['time_start']);
|
||||
$ds=explode("-",$r['date_start']);
|
||||
$name[$i]['time_start']=date("H:i:s",@mktime($ts[0],$ts[1],$ts[2],$ds[1],$ds[2],$ds[0])+7200);
|
||||
$name[$i]['name']=$r['name'];
|
||||
$name[$i]['id']=$r['id'];
|
||||
$name[$i]['type']=$type;
|
||||
$name[$i]['reminder_time']=$r['reminder_time'];
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
return $name;
|
||||
}
|
||||
$meetings=getList("meetings");
|
||||
$calls=getList("calls");
|
||||
$tasks=getList("tasks");
|
||||
if(count($meetings)+count($calls)+count($tasks)==0)print '<script>window.close();</script>';
|
||||
|
||||
for($i=0;$i<count($meetings);$i++)$name[]=$meetings[$i];
|
||||
for($i=0;$i<count($calls);$i++)$name[]=$calls[$i];
|
||||
for($i=0;$i<count($tasks);$i++)$name[]=$tasks[$i];
|
||||
//print_r($name);
|
||||
rsort($name);
|
||||
$o=0;
|
||||
foreach($name as $value)
|
||||
{
|
||||
if($value['type']=="meetings")
|
||||
{
|
||||
$img="Meetings";
|
||||
$status="Held";
|
||||
}
|
||||
if($value['type']=="calls")
|
||||
{
|
||||
$img="Calls";
|
||||
$status="Held";
|
||||
}
|
||||
if($value['type']=="tasks")
|
||||
{
|
||||
$img="Tasks";
|
||||
$status="Completed";
|
||||
}
|
||||
if($o==0)
|
||||
{
|
||||
$check=" checked";
|
||||
$sdate_start=$value['date_start'];
|
||||
$stime_start=$value['time_start'];
|
||||
$st=explode(":",$stime_start);
|
||||
$hour=$st[0];
|
||||
$minute=$st[1];
|
||||
$o++;
|
||||
}
|
||||
else $check="";
|
||||
$ts=explode(":",$value['time_start']);
|
||||
|
||||
if($value['reminder_time'] != -1)
|
||||
{
|
||||
$ts=explode(":",$value['time_start']);
|
||||
$ds=explode("-",$value['date_start']);
|
||||
$rem=date("H:i:s",mktime($ts[0],$ts[1],$ts[2],$ds[1],$ds[2],$ds[0])-$value['reminder_time']);
|
||||
}
|
||||
else $rem="";
|
||||
print '<table cellspacing="0" cellpadding="0" border="0" width="600">
|
||||
<tr><td valign="top" width="30" class="oddListRowS1" bgcolor="#ffffff"><input onclick="show(\''.$value['id'].'\',\''.$value['date_start'][8].$value['date_start'][9].'.'.$value['date_start'][5].$value['date_start'][6].'.'.$value['date_start'][0].$value['date_start'][1].$value['date_start'][2].$value['date_start'][3].'\',\''.$ts[0].'\',\''.$ts[1].'\');" type="checkbox" name="check[]" id="check'.$value['id'].'" value="'.$value['id'].'" '.$check.'></td>
|
||||
<td valign="top" width="30" class="oddListRowS1" bgcolor="#ffffff"><img src="../../themes/Sugar/images/'.$img.'.gif" border="0"></td>
|
||||
<td valign="top" width="220" class="oddListRowS1" bgcolor="#ffffff"><div style="overflow:hidden;width:220px;"><a href="#" class="listViewTdLinkS1" style="cursor:pointer;" onclick="window.open(\'../../index.php?module='.$img.'&action=DetailView&record='.$value['id'].'&close=1\',\'CRM\',\'height=780,width=1014, toolbar=yes, menubar=yes, scrollbars=yes, resizable=yes, location=yes, directories=yes, status=yes\',\'\').focus();">'.$value['name'].'</a></div></td>
|
||||
<td valign="top" width="120" class="oddListRowS1" bgcolor="#ffffff">'.$rem.'</td>
|
||||
<td valign="top" width="120" class="oddListRowS1" bgcolor="#ffffff"><div style="overflow:hidden;width:120px;">'.$value['date_start'][8].$value['date_start'][9].'.'.$value['date_start'][5].$value['date_start'][6].'.'.$value['date_start'][0].$value['date_start'][1].$value['date_start'][2].$value['date_start'][3].' '.$value['time_start'].'</div></td>
|
||||
<td valign="top" width="30" class="oddListRowS1" bgcolor="#ffffff"><a style="cursor:pointer;" onclick="window.open(\'../../index.php?module='.$img.'&action=EditView&record='.$value['id'].'\',\'CRM\',\'\',\'\');"><img src="../../themes/Sugar/images/edit_inline.gif" border="0"></a></td>
|
||||
<td valign="top" width="30" class="oddListRowS1" bgcolor="#ffffff"><a href="CloseReminder.php?type='.$value['type'].'&record='.$value['id'].'&status='.$status.'"><img src="../../themes/Sugar/images/close_inline.gif" border="0"></a></td>
|
||||
</tr></table>';
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
<br />
|
||||
<div id="close" style="display:block;">
|
||||
<br />
|
||||
<!--<input type="hidden" name="discard1" value="0" /><input type="submit" name="discard" class="button" onclick="this.form.discard1.value='1';" value="Discard Selected" />-->
|
||||
<input type="hidden" name="closeselected1" value="0" /><input type="submit" class="button" name="closeselected" value="Close Selected" onclick="this.form.closeselected1.value='1';" />
|
||||
</div>
|
||||
<br />
|
||||
<ul class="tablist">
|
||||
<li id="li-postponeby" class="active"><a class="current" id="a-postponeby" href="javascript:showdiv('postponeby');">Postpone By</a></li>
|
||||
<li id="li-postponeto"><a id="a-postponeto" href="javascript:showdiv('postponeto');">Postpone To</a></li>
|
||||
<li id="li-reminder"><a id="a-reminder" href="javascript:showdiv('reminder');">Reminder</a></li>
|
||||
</ul>
|
||||
|
||||
<div id="postponeby" style="display:block;">
|
||||
<br />
|
||||
<select name='rsec' id='rsec'>
|
||||
<OPTION value='300'>5 min</OPTION>
|
||||
<OPTION value='600'>10 min</OPTION>
|
||||
<OPTION value='900'>15 min</OPTION>
|
||||
<OPTION value='1800'>30 min</OPTION>
|
||||
<OPTION value='3600'>1 hour.</OPTION>
|
||||
<OPTION value='7200'>2 hours</OPTION>
|
||||
<OPTION value='14400'>4 hours</OPTION>
|
||||
<OPTION value='28800'>8 hours</OPTION>
|
||||
<OPTION value='43200'>12 hours</OPTION>
|
||||
<OPTION value='86400'>1 day</OPTION>
|
||||
<OPTION value='172800'>2 days</OPTION>
|
||||
<OPTION value='259200'>3 days</OPTION>
|
||||
<OPTION value='345600'>4 days</OPTION>
|
||||
<OPTION value='604800'>1 week</OPTION>
|
||||
<OPTION value='1209600'>2 weeks</OPTION>
|
||||
</select>
|
||||
<input type="hidden" name="updatesec1" value="0" /><input style="display:inline" type="submit" class="button" value="Update" name="updatesec" onclick="this.form.updatesec1.value='1';" />
|
||||
</div>
|
||||
<div id="postponeto" style="display:none;">
|
||||
<br />
|
||||
Date: <input name="date" id="date" onblur="parseDate(this, '%d.%m.%Y');" size="11" maxlength="10" type="text" value="<?print $sdate_start[8].$sdate_start[9].".".$sdate_start[5].$sdate_start[6].".".$sdate_start[0].$sdate_start[1].$sdate_start[2].$sdate_start[3];?>" /> <img src="../../themes/Sugar/images/jscalendar.gif" alt="%d.%m.%Y" id="date_trigger" align="absmiddle">
|
||||
<script type="text/javascript">
|
||||
Calendar.setup ({
|
||||
inputField : "date", ifFormat : "%d.%m.%Y", showsTime : false, button : "date_trigger", singleClick : true, step : 1
|
||||
});
|
||||
</script> Time:
|
||||
<select name='hour' id='hour'>
|
||||
<OPTION value='00' <?if($hour=="00")print "selected";?>>00</OPTION>
|
||||
<OPTION value='01' <?if($hour=="01")print "selected";?>>01</OPTION>
|
||||
<OPTION value='02' <?if($hour=="02")print "selected";?>>02</OPTION>
|
||||
<OPTION value='03' <?if($hour=="03")print "selected";?>>03</OPTION>
|
||||
<OPTION value='04' <?if($hour=="04")print "selected";?>>04</OPTION>
|
||||
<OPTION value='05' <?if($hour=="05")print "selected";?>>05</OPTION>
|
||||
<OPTION value='06' <?if($hour=="06")print "selected";?>>06</OPTION>
|
||||
<OPTION value='07' <?if($hour=="07")print "selected";?>>07</OPTION>
|
||||
<OPTION value='08' <?if($hour=="08")print "selected";?>>08</OPTION>
|
||||
<OPTION value='09' <?if($hour=="09")print "selected";?>>09</OPTION>
|
||||
<OPTION value='10' <?if($hour=="10")print "selected";?>>10</OPTION>
|
||||
<OPTION value='11' <?if($hour=="11")print "selected";?>>11</OPTION>
|
||||
<OPTION value='12' <?if($hour=="12")print "selected";?>>12</OPTION>
|
||||
<OPTION value='13' <?if($hour=="13")print "selected";?>>13</OPTION>
|
||||
<OPTION value='14' <?if($hour=="14")print "selected";?>>14</OPTION>
|
||||
<OPTION value='15' <?if($hour=="15")print "selected";?>>15</OPTION>
|
||||
<OPTION value='16' <?if($hour=="16")print "selected";?>>16</OPTION>
|
||||
<OPTION value='17' <?if($hour=="17")print "selected";?>>17</OPTION>
|
||||
<OPTION value='18' <?if($hour=="18")print "selected";?>>18</OPTION>
|
||||
<OPTION value='19' <?if($hour=="19")print "selected";?>>19</OPTION>
|
||||
<OPTION value='20' <?if($hour=="20")print "selected";?>>20</OPTION>
|
||||
<OPTION value='21' <?if($hour=="21")print "selected";?>>21</OPTION>
|
||||
<OPTION value='22' <?if($hour=="22")print "selected";?>>22</OPTION>
|
||||
<OPTION value='23' <?if($hour=="23")print "selected";?>>23</OPTION>
|
||||
</select>:
|
||||
<select name='minute' id='minute'>
|
||||
<OPTION value='0' <?if($minute=="0")print "selected";?>>00</OPTION>
|
||||
<OPTION value='15' <?if($minute=="15")print "selected";?>>15</OPTION>
|
||||
<OPTION value='30' <?if($minute=="30")print "selected";?>>30</OPTION>
|
||||
<OPTION value='45' <?if($minute=="45")print "selected";?>>45</OPTION>
|
||||
</select> <input type="hidden" name="update1" value="0" /><input style="display:inline" type="submit" class="button" value="Update" name="update" onclick="this.form.update1.value='1';" />
|
||||
</div>
|
||||
<div id="reminder" style="display:none;">
|
||||
<br />
|
||||
<?
|
||||
include("../../modules/Calls/time_select.php");
|
||||
print show_time_select("");
|
||||
?>
|
||||
<input type="hidden" name="reminder1" value="0" /><input style="display:inline" type="submit" class="button" value="Update" name="reminder" onclick="this.form.reminder1.value='1';" />
|
||||
</div>
|
||||
</form>
|
||||
<script>
|
||||
function selectallitems()
|
||||
{
|
||||
<?
|
||||
foreach($name as $value)
|
||||
{
|
||||
print 'if(document.getElementById("selectall").checked==true){document.getElementById("check'.$value['id'].'").checked=true}else {document.getElementById("check'.$value['id'].'").checked=false} ;
|
||||
';
|
||||
}
|
||||
?>
|
||||
}
|
||||
function show(id,date,hour,minute)
|
||||
{
|
||||
document.getElementById("date").value=date;
|
||||
document.getElementById("hour").value=hour;
|
||||
document.getElementById("minute").value=minute;
|
||||
}
|
||||
function showdiv(id)
|
||||
{
|
||||
document.getElementById('postponeto').style.display="none";
|
||||
document.getElementById('postponeby').style.display="none";
|
||||
document.getElementById('reminder').style.display="none";
|
||||
document.getElementById('li-postponeto').className="";
|
||||
document.getElementById('li-postponeby').className="";
|
||||
document.getElementById('li-reminder').className="";
|
||||
document.getElementById('a-postponeto').className="";
|
||||
document.getElementById('a-postponeby').className="";
|
||||
document.getElementById('a-reminder').className="";
|
||||
document.getElementById(id).style.display="block";
|
||||
document.getElementById('li-'+id).className="active";
|
||||
document.getElementById('a-'+id).className="current";
|
||||
}
|
||||
</script>
|
||||
<?
|
||||
mysql_close($sql);
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
87
modules/EcmDocuments/Save.php
Executable file
87
modules/EcmDocuments/Save.php
Executable file
@@ -0,0 +1,87 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/*****************************************************************************
|
||||
* The contents of this file are subject to the RECIPROCAL PUBLIC LICENSE
|
||||
* Version 1.1 ("License"); You may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
* http://opensource.org/licenses/rpl.php. Software distributed under the
|
||||
* License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
|
||||
* either express or implied.
|
||||
*
|
||||
* You may:
|
||||
* a) Use and distribute this code exactly as you received without payment or
|
||||
* a royalty or other fee.
|
||||
* b) Create extensions for this code, provided that you make the extensions
|
||||
* publicly available and document your modifications clearly.
|
||||
* c) Charge for a fee for warranty or support or for accepting liability
|
||||
* obligations for your customers.
|
||||
*
|
||||
* You may NOT:
|
||||
* a) Charge for the use of the original code or extensions, including in
|
||||
* electronic distribution models, such as ASP (Application Service
|
||||
* Provider).
|
||||
* b) Charge for the original source code or your extensions other than a
|
||||
* nominal fee to cover distribution costs where such distribution
|
||||
* involves PHYSICAL media.
|
||||
* c) Modify or delete any pre-existing copyright notices, change notices,
|
||||
* or License text in the Licensed Software
|
||||
* d) Assert any patent claims against the Licensor or Contributors, or
|
||||
* which would in any way restrict the ability of any third party to use the
|
||||
* Licensed Software.
|
||||
*
|
||||
* You must:
|
||||
* a) Document any modifications you make to this code including the nature of
|
||||
* the change, the authors of the change, and the date of the change.
|
||||
* b) Make the source code for any extensions you deploy available via an
|
||||
* Electronic Distribution Mechanism such as FTP or HTTP download.
|
||||
* c) Notify the licensor of the availability of source code to your extensions
|
||||
* and include instructions on how to acquire the source code and updates.
|
||||
* d) Grant Licensor a world-wide, non-exclusive, royalty-free license to use,
|
||||
* reproduce, perform, modify, sublicense, and distribute your extensions.
|
||||
*
|
||||
* The Original Code is: CommuniCore
|
||||
* Olavo Farias
|
||||
* 2006-04-7 olavo.farias@gmail.com
|
||||
*
|
||||
* The Initial Developer of the Original Code is CommuniCore.
|
||||
* Portions created by CommuniCore are Copyright (C) 2005 CommuniCore Ltda
|
||||
* All Rights Reserved.
|
||||
********************************************************************************/
|
||||
|
||||
require_once('modules/EcmDocuments/EcmDocument.php');
|
||||
require_once('include/formbase.php');
|
||||
|
||||
$focus = new EcmDocument();
|
||||
|
||||
$focus->retrieve($_POST['record']);
|
||||
if(!$focus->ACLAccess('Save')){
|
||||
ACLController::displayNoAccess(true);
|
||||
sugar_cleanup(true);
|
||||
}
|
||||
if (!empty($_POST['assigned_user_id']) && ($focus->assigned_user_id != $_POST['assigned_user_id']) && ($_POST['assigned_user_id'] != $current_user->id)) {
|
||||
$check_notify = TRUE;
|
||||
}else{
|
||||
$check_notify = FALSE;
|
||||
}
|
||||
|
||||
foreach($focus->column_fields as $field){
|
||||
if(isset($_POST[$field])){
|
||||
$value = $_POST[$field];
|
||||
$focus->$field = $value;
|
||||
}
|
||||
}
|
||||
|
||||
foreach($focus->additional_column_fields as $field){
|
||||
if(isset($_POST[$field])){
|
||||
$value = $_POST[$field];
|
||||
$focus->$field = $value;
|
||||
}
|
||||
}
|
||||
|
||||
$focus->unformat_all_fields();
|
||||
$focus->save($check_notify);
|
||||
$return_id = $focus->id;
|
||||
|
||||
handleRedirect($return_id,'EcmDocuments');
|
||||
|
||||
?>
|
||||
22
modules/EcmDocuments/SaveDirsOrder.php
Executable file
22
modules/EcmDocuments/SaveDirsOrder.php
Executable file
@@ -0,0 +1,22 @@
|
||||
<?
|
||||
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']);
|
||||
$b=explode(",",str_replace(" ","",$_GET['boxes']));
|
||||
$i=1;
|
||||
foreach($b as $box)
|
||||
{
|
||||
if(strlen($box)>=1 && $box!="" && $box!=" ")$boxy[]=$box;
|
||||
}
|
||||
for($i=1;$i<=count($boxy);$i++)
|
||||
{
|
||||
$z="update ecmdocuments set no='".$i."' where id='".$boxy[$i-1]."' and iddir='".$_REQUEST['record']."'";
|
||||
if(mysql_query($z))$ok=1;
|
||||
else $error="Error";
|
||||
}
|
||||
if($error)print $error;
|
||||
else print "Saved";
|
||||
?>
|
||||
167
modules/EcmDocuments/SaveFile.php
Executable file
167
modules/EcmDocuments/SaveFile.php
Executable file
@@ -0,0 +1,167 @@
|
||||
<?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/EcmDocument.php');
|
||||
require_once('modules/EcmDocuments/dirstree.php');
|
||||
require_once('include/formbase.php');
|
||||
require_once('modules/EcmFiles/uploadfile.php');
|
||||
//print $_POST['iddir'];
|
||||
$z="select * from ecmfiles where name='".$_FILES['filename']['name']."' and docs='".$_POST['iddir']."'";
|
||||
$ile=mysql_num_rows(mysql_query($z));
|
||||
if($_FILES['filename']['name'])
|
||||
{
|
||||
if($ile==0)
|
||||
{
|
||||
$version=1.0;
|
||||
$dir=date("YmdHms");
|
||||
mkdir("modules/EcmFiles/files/".$dir,0777);
|
||||
$uploadfile=upload_file('filename','modules/EcmFiles/files/'.$dir.'/');
|
||||
$z="insert into ecmfiles
|
||||
(
|
||||
id,
|
||||
assigned_user_id,
|
||||
modified_user_id,
|
||||
created_by,
|
||||
date_entered,
|
||||
date_modified,
|
||||
name,
|
||||
sltk_filename,
|
||||
fileid,
|
||||
dir,
|
||||
version,
|
||||
docs,
|
||||
aktual,
|
||||
no
|
||||
)
|
||||
values
|
||||
(
|
||||
'',
|
||||
'".$current_user->id."',
|
||||
'".$current_user->id."',
|
||||
'".$current_user->id."',
|
||||
'".date("Y-m-d H:m:s")."',
|
||||
'".date("Y-m-d H:m:s")."',
|
||||
'".$_FILES['filename']['name']."',
|
||||
'".$uploadfile."',
|
||||
'".$_POST['fileid']."',
|
||||
'".$dir."',
|
||||
'".$version."',
|
||||
'".$_REQUEST['iddir']."',
|
||||
'1',
|
||||
'".getmaxdirel($_REQUEST['iddir'])."'
|
||||
)";
|
||||
//print nl2br($z)."<br>";
|
||||
$w=mysql_query($z);
|
||||
$fileid=mysql_insert_id();
|
||||
}
|
||||
else
|
||||
{
|
||||
$z="select * from ecmfiles where name='".$_FILES['filename']['name']."' and docs='".$_POST['iddir']."' and aktual='1'";
|
||||
$r=mysql_fetch_array(mysql_query($z));
|
||||
$no=$r['no'];
|
||||
mysql_query("update ecmfiles set aktual=0 where name='".$_FILES['filename']['name']."' and docs='".$_POST['iddir']."'");
|
||||
$z="select * from ecmfiles where name='".$_FILES['filename']['name']."' and docs='".$_POST['iddir']."' order by version desc limit 1";
|
||||
$r=mysql_fetch_array(mysql_query($z));
|
||||
$dir=$r['dir'];
|
||||
$version=$r['version'];
|
||||
$v=explode(".",$version);
|
||||
(int)$v[0];
|
||||
(int)$v[1];
|
||||
if($v[1]>9)
|
||||
{
|
||||
$v[0]++;
|
||||
$v[1]=0;
|
||||
}
|
||||
else
|
||||
{
|
||||
$v[1]++;
|
||||
}
|
||||
$versionplus=$v[0].".".$v[1];
|
||||
$uploadfile=upload_file('filename','modules/EcmFiles/files/'.$dir.'/');
|
||||
$z="insert into ecmfiles
|
||||
(
|
||||
id,
|
||||
assigned_user_id,
|
||||
modified_user_id,
|
||||
created_by,
|
||||
date_entered,
|
||||
date_modified,
|
||||
name,
|
||||
sltk_filename,
|
||||
fileid,
|
||||
dir,
|
||||
version,
|
||||
docs,
|
||||
aktual,
|
||||
no
|
||||
)
|
||||
values
|
||||
(
|
||||
'',
|
||||
'".$current_user->id."',
|
||||
'".$current_user->id."',
|
||||
'".$current_user->id."',
|
||||
'".date("Y-m-d H:m:s")."',
|
||||
'".date("Y-m-d H:m:s")."',
|
||||
'".$_FILES['filename']['name']."',
|
||||
'".$uploadfile."',
|
||||
'".$_POST['fileid']."',
|
||||
'".$dir."',
|
||||
'".$versionplus."',
|
||||
'".$_REQUEST['iddir']."',
|
||||
'1',
|
||||
'".$no."'
|
||||
)";
|
||||
$w=mysql_query($z);
|
||||
$fileid=$_POST['fileid'];
|
||||
}
|
||||
}
|
||||
print "<script language='javascript'>document.location.href='index.php?module=EcmDocuments&action=DetailView&record=".$_POST['iddir']."';</script>";
|
||||
?>
|
||||
90
modules/EcmDocuments/SaveInformation.php
Executable file
90
modules/EcmDocuments/SaveInformation.php
Executable file
@@ -0,0 +1,90 @@
|
||||
<?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');
|
||||
require_once('include/formbase.php');
|
||||
if($_POST['createsubfolder'])header("Location: index.php?module=EcmDocuments&action=CreateDir&record=".$_GET['record']."&subfoldername=".$_POST['subfoldername']);
|
||||
elseif($_POST['deletedir'])header("Location: index.php?module=EcmDocuments&action=DeleteDir&record=".$_GET['record']);
|
||||
elseif($_POST['clonedir'])header("Location: index.php?module=EcmDocuments&action=CloneDir&record=".$_GET['record']."&idkatalogu=".$_POST['idkatalogu']."&idkat=".$_POST['idkat']."&katalog=".$_POST['katalog']."&dirname=".$_POST['dirname']);
|
||||
else
|
||||
{
|
||||
|
||||
|
||||
$z="select id from ecmdocuments_shortcuts where userid='".$current_user->id."' and iddir='".$_GET['record']."'";
|
||||
$w=mysql_query($z);
|
||||
$ile=mysql_num_rows($w);
|
||||
if($_POST['shortcut'])
|
||||
{
|
||||
if($ile==0)mysql_query("insert into ecmdocuments_shortcuts(id,userid,iddir) values('".create_guid()."','".$current_user->id."','".$_GET['record']."')");
|
||||
}
|
||||
else
|
||||
{
|
||||
if($ile>0)
|
||||
{
|
||||
mysql_query("delete from ecmdocuments_shortcuts where userid='".$current_user->id."' and iddir='".$_GET['record']."'");
|
||||
}
|
||||
}
|
||||
if($_POST['name'])
|
||||
{
|
||||
$z="update ecmdocuments set
|
||||
shortcut='".$_POST['shortcut']."',
|
||||
date_modified='".date("Y-m-d H:m:s")."',
|
||||
cloning='".$_POST['cloning']."',
|
||||
name='".$_POST['name']."',
|
||||
description='".$_POST['description']."',
|
||||
assigned_user_id='".$_POST['selectuser']."'
|
||||
where id='".$_GET['record']."'";
|
||||
mysql_query($z);
|
||||
assign_user_to_dir($_POST['selectuser'],$_GET['record']);
|
||||
}
|
||||
|
||||
handleRedirect($_GET['record'],'EcmDocuments');
|
||||
}
|
||||
?>
|
||||
167
modules/EcmDocuments/SearchDir.php
Executable file
167
modules/EcmDocuments/SearchDir.php
Executable file
@@ -0,0 +1,167 @@
|
||||
<?
|
||||
$_SESSION['searchdir']=$_POST['searchdir'];
|
||||
require_once("include/formbase.php");
|
||||
$tabsr=array('accounts','contacts','contracts','calls','correspondences','emails','meetings','notes','quotes','tasks','ecminvoices');
|
||||
foreach($tabsr as $tabsre)updateno("ecmdocuments_".$tabsre,$_REQUEST['record']);
|
||||
function formatstring($string)
|
||||
{
|
||||
$pom="";
|
||||
$j=0;
|
||||
for($i=0;$i<=count($string)-1;$i++)
|
||||
{
|
||||
if(is_numeric($string[$i]))
|
||||
{
|
||||
$pom.=$string[$i];
|
||||
$j++;
|
||||
}
|
||||
}
|
||||
return $pom;
|
||||
}
|
||||
function searchElement($iddir,$i)
|
||||
{
|
||||
$z="select ecmfile_id as id from ecmdocuments_ecmfiles where ecmdocument_id='".$iddir."' and no='".$i."' and deleted='0'";
|
||||
$w=mysql_query($z);
|
||||
if(mysql_num_rows($w)==1)
|
||||
{
|
||||
$module="EcmFiles";
|
||||
$r=mysql_fetch_array($w);
|
||||
$id=$r['id'];
|
||||
}
|
||||
$z="select account_id as id from ecmdocuments_accounts where ecmdocument_id='".$iddir."' and no='".$i."'";
|
||||
$w=mysql_query($z);
|
||||
if(mysql_num_rows($w)==1)
|
||||
{
|
||||
$module="Accounts";
|
||||
$r=mysql_fetch_array($w);
|
||||
$id=$r['id'];
|
||||
}
|
||||
$z="select ecminvoice_id as id from ecmdocuments_ecminvoices where ecmdocument_id='".$iddir."' and no='".$i."'";
|
||||
$w=mysql_query($z);
|
||||
if(mysql_num_rows($w)==1)
|
||||
{
|
||||
$module="EcmInvoices";
|
||||
$r=mysql_fetch_array($w);
|
||||
$id=$r['id'];
|
||||
}
|
||||
$z="select call_id as id from ecmdocuments_calls where ecmdocument_id='".$iddir."' and no='".$i."'";
|
||||
$w=mysql_query($z);
|
||||
if(mysql_num_rows($w)==1)
|
||||
{
|
||||
$module="Calls";
|
||||
$r=mysql_fetch_array($w);
|
||||
$id=$r['id'];
|
||||
}
|
||||
$z="select contract_id as id from ecmdocuments_contracts where ecmdocument_id='".$iddir."' and no='".$i."'";
|
||||
$w=mysql_query($z);
|
||||
if(mysql_num_rows($w)==1)
|
||||
{
|
||||
$module="Contracts";
|
||||
$r=mysql_fetch_array($w);
|
||||
$id=$r['id'];
|
||||
}
|
||||
$z="select contact_id as id from ecmdocuments_contacts where ecmdocument_id='".$iddir."' and no='".$i."'";
|
||||
$w=mysql_query($z);
|
||||
if(mysql_num_rows($w)==1)
|
||||
{
|
||||
$module="Contacts";
|
||||
$r=mysql_fetch_array($w);
|
||||
$id=$r['id'];
|
||||
}
|
||||
$z="select correspondence_id as id from ecmdocuments_correspondences where ecmdocument_id='".$iddir."' and no='".$i."'";
|
||||
$w=mysql_query($z);
|
||||
if(mysql_num_rows($w)==1)
|
||||
{
|
||||
$module="Correspondences";
|
||||
$r=mysql_fetch_array($w);
|
||||
$id=$r['id'];
|
||||
}
|
||||
$z="select email_id as id from ecmdocuments_emails where ecmdocument_id='".$iddir."' and no='".$i."'";
|
||||
$w=mysql_query($z);
|
||||
if(mysql_num_rows($w)==1)
|
||||
{
|
||||
$module="Emails";
|
||||
$r=mysql_fetch_array($w);
|
||||
$id=$r['id'];
|
||||
}
|
||||
$z="select meeting_id as id from ecmdocuments_meetings where ecmdocument_id='".$iddir."' and no='".$i."'";
|
||||
$w=mysql_query($z);
|
||||
if(mysql_num_rows($w)==1)
|
||||
{
|
||||
$module="Meetings";
|
||||
$r=mysql_fetch_array($w);
|
||||
$id=$r['id'];
|
||||
}
|
||||
$z="select note_id as id from ecmdocuments_notes where ecmdocument_id='".$iddir."' and no='".$i."'";
|
||||
$w=mysql_query($z);
|
||||
if(mysql_num_rows($w)==1)
|
||||
{
|
||||
$module="Notes";
|
||||
$r=mysql_fetch_array($w);
|
||||
$id=$r['id'];
|
||||
}
|
||||
$z="select quote_id as id from ecmdocuments_quotes where ecmdocument_id='".$iddir."' and no='".$i."'";
|
||||
$w=mysql_query($z);
|
||||
if(mysql_num_rows($w)==1)
|
||||
{
|
||||
$module="Quotes";
|
||||
$r=mysql_fetch_array($w);
|
||||
$id=$r['id'];
|
||||
}
|
||||
$z="select task_id as id from ecmdocuments_tasks where ecmdocument_id='".$iddir."' and no='".$i."'";
|
||||
$w=mysql_query($z);
|
||||
if(mysql_num_rows($w)==1)
|
||||
{
|
||||
$module="Tasks";
|
||||
$r=mysql_fetch_array($w);
|
||||
$id=$r['id'];
|
||||
}
|
||||
$t[0]=$id;
|
||||
$t[1]=$module;
|
||||
return $t;
|
||||
}
|
||||
if($_POST['searchdir'])
|
||||
{
|
||||
$iddir=0;
|
||||
$numbers=explode(".",$_POST['searchdir']);
|
||||
for($i=0;$i<=count($numbers)-1;$i++)
|
||||
{
|
||||
if($numbers[$i])
|
||||
{
|
||||
$pom=$numbers[$i];
|
||||
$z="select id from ecmdocuments where iddir='".$iddir."' and no='".$pom."'";
|
||||
$w=mysql_query($z);
|
||||
if(mysql_num_rows($w)>0)
|
||||
{
|
||||
$r=mysql_fetch_array($w);
|
||||
$iddir=$r['id'];
|
||||
$module="EcmDocuments";
|
||||
}
|
||||
else
|
||||
{
|
||||
$num=searchElement($iddir,$numbers[$i]);
|
||||
$iddir=$num[0];
|
||||
$module=$num[1];
|
||||
if(!$iddir)
|
||||
{
|
||||
$iddir=$_REQUEST['record'];
|
||||
$module="EcmDocuments";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if($module=="EcmDocuments")
|
||||
{
|
||||
$z="select * from ecmdocuments_permissions where iddir='".$iddir."' and userid='".$current_user->id."'";
|
||||
$w=mysql_query($z);
|
||||
if(mysql_num_rows($w)>0 || $current_user->id==1)
|
||||
{
|
||||
$r=mysql_fetch_array($w);
|
||||
if($r['read']==1 || $current_user->id==1)$id=$iddir;
|
||||
else $id=$_REQUEST['record'];
|
||||
}
|
||||
else $id=$_REQUEST['record'];
|
||||
$iddir=$id;
|
||||
}
|
||||
handleRedirect($iddir,$module);
|
||||
?>
|
||||
1254
modules/EcmDocuments/SearchProjects.php
Executable file
1254
modules/EcmDocuments/SearchProjects.php
Executable file
File diff suppressed because it is too large
Load Diff
1454
modules/EcmDocuments/SelectFile.php
Executable file
1454
modules/EcmDocuments/SelectFile.php
Executable file
File diff suppressed because it is too large
Load Diff
1240
modules/EcmDocuments/SelectFile1.php
Executable file
1240
modules/EcmDocuments/SelectFile1.php
Executable file
File diff suppressed because it is too large
Load Diff
214
modules/EcmDocuments/SelectFile2.php
Executable file
214
modules/EcmDocuments/SelectFile2.php
Executable file
@@ -0,0 +1,214 @@
|
||||
<?
|
||||
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']);
|
||||
mysql_query("set names utf8");
|
||||
mysql_query("set charaecterset utf8");
|
||||
|
||||
if($_POST['search'])
|
||||
{
|
||||
if($_POST['name'])$clause[0]="name like '%".$_POST['name']."%'";
|
||||
if($_POST['version'])$clause[1]="version like '%".$_POST['version']."%'";
|
||||
if($_POST['name'] && $_POST['version'])$where="where ".$clause[0]." and ".$clause[1];
|
||||
if($_POST['name'] && !$_POST['version'])$where="where ".$clause[0];
|
||||
if(!$_POST['name'] && $_POST['version'])$where="where ".$clause[1];
|
||||
if(!$_POST['name'] && !$_POST['version'])$where="";
|
||||
$z="select * from ecmfiles_versions ".$where." order by name asc,version desc";
|
||||
$w=mysql_query($z);
|
||||
//print $z;
|
||||
$tabs=array("ecmcontracts","ecmdocs","ecmcorrespondenceins","ecmcorrespondenceouts","ecminvoiceins","ecminvoiceouts");
|
||||
while($r=mysql_fetch_array($w))
|
||||
{
|
||||
foreach($tabs as $tab)
|
||||
{
|
||||
$ww=mysql_query("select id,name from ".$tab." where file_id='".$r['file_id']."'");
|
||||
$rr=mysql_fetch_array($ww);
|
||||
$idn=$rr['id'];
|
||||
$namen=$rr['name'];
|
||||
$n[]=array(
|
||||
'i' => mysql_num_rows($ww),
|
||||
'module' => $tab,
|
||||
'id' => $idn,
|
||||
'name' => $namen,
|
||||
);
|
||||
}
|
||||
rsort($n);
|
||||
$list[$i]=array(
|
||||
'id' => $r['id'],
|
||||
'name' => $r['name'],
|
||||
'version' => $r['version'],
|
||||
'module' => $n[0]['module'],
|
||||
'file_id' => $r['file_id'],
|
||||
'module_id' => $n[0]['id'],
|
||||
'module_name' => $n[0]['name'],
|
||||
);
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$z="select * from ecmfiles_versions order by name asc,version desc";
|
||||
$w=mysql_query($z);
|
||||
//print $z;
|
||||
$tabs=array("ecmcontracts","ecmdocs","ecmcorrespondenceins","ecmcorrespondenceouts","ecminvoiceins","ecminvoiceouts");
|
||||
while($r=mysql_fetch_array($w))
|
||||
{
|
||||
foreach($tabs as $tab)
|
||||
{
|
||||
$ww=mysql_query("select id,name from ".$tab." where file_id='".$r['file_id']."'");
|
||||
$rr=mysql_fetch_array($ww);
|
||||
$idn=$rr['id'];
|
||||
$namen=$rr['name'];
|
||||
$n[]=array(
|
||||
'i' => mysql_num_rows($ww),
|
||||
'module' => $tab,
|
||||
'id' => $idn,
|
||||
'name' => $namen,
|
||||
);
|
||||
}
|
||||
rsort($n);
|
||||
$list[$i]=array(
|
||||
'id' => $r['id'],
|
||||
'name' => $r['name'],
|
||||
'version' => $r['version'],
|
||||
'module' => $n[0]['module'],
|
||||
'file_id' => $r['file_id'],
|
||||
'module_id' => $n[0]['id'],
|
||||
'module_name' => $n[0]['name'],
|
||||
);
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2" />
|
||||
<title>Select File</title>
|
||||
<style type="text/css">@import url("../../themes/Sugar/style.css?s=4.5.0g&c="); </style><link href="../../themes/Sugar/colors.sugar.css?s=4.5.0g&c=" rel="stylesheet" type="text/css" title="sugar" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<table width="100%" cellpadding="0" cellspacing="0" border="0" class="h3Row"><tr><td nowrap><h3>File Search</h3></td><td width='100%'><IMG height='1' width='1' src='../../include/images/blank.gif' alt=''></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="tabForm">
|
||||
|
||||
<tr>
|
||||
<td>
|
||||
<form action="SelectFile.php?target=<?print $_GET['target'];?>" method="post" name="popup_query_form" id="popup_query_form">
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td class="dataLabel" nowrap="nowrap">Name:</td>
|
||||
<td class="dataField" nowrap="nowrap"><input type="text" size="20" name="name" class="dataField" value="" /></td>
|
||||
<td class="dataLabel" nowrap="nowrap">Version:</td>
|
||||
<td class="dataField" nowrap="nowrap"><input name="version" type="text" class="dataField" id="version" value="" size="20" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top" nowrap="nowrap" class="dataLabel">Module:</td>
|
||||
<td class="dataField" nowrap="nowrap">
|
||||
<select name="module[]" size="6" multiple="multiple">
|
||||
<option value='ecmdocs'>Files</option>
|
||||
<option value='ecmcontracts'>Contracts</option>
|
||||
<option value='ecmcorrespondenceins'>Correspondence In</option>
|
||||
<option value='ecmcorrespondenceouts'>Correspondence Out</option>
|
||||
<option value='ecminvoiceins'>Invoice In</option>
|
||||
<option value='ecminvoiceouts'>Invoice Out</option>
|
||||
</select></td>
|
||||
<td>
|
||||
|
||||
</td>
|
||||
<td width="20%" align="right">
|
||||
<input type="submit" name="search" class="button"
|
||||
title="Search [Alt+Q]"
|
||||
accessKey="Q"
|
||||
value="Search" />
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<table width="100%" cellpadding="0" cellspacing="0" border="0" class="h3Row"><tr><td nowrap><h3>Files List</h3></td><td colspan='10' width='100%'><IMG height='1' width='1' src='../../include/images/blank.gif' alt=''></td>
|
||||
|
||||
</tr><tr>
|
||||
<td align='left' valign='middle' nowrap style='padding-bottom: 2px;'> </td>
|
||||
<td width='100%'><IMG height='1' width='1' src='../../include/images/blank.gif' alt=''></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="listView">
|
||||
<tr>
|
||||
<td COLSPAN="20" align="right"> </td>
|
||||
</tr>
|
||||
<tr height="20">
|
||||
<td scope="col" class="listViewThS1" NOWRAP><img src='../../include/images/blank.gif' width="1" height="1" alt="" /></td>
|
||||
<td scope="col" width="45%" class="listViewThS1"><a href="/sugar45/index.php?module=Accounts&action=Popup&mode=single&create=true&metadata=undefined&Accounts_ACCOUNT_offset=&Accounts_ACCOUNT_ORDER_BY=name" class="listViewThLinkS1">Name <img border='0' src='../../themes/Sugar/images/arrow_down.gif' width='8' height='10' align='absmiddle' alt='Sort'></a></td>
|
||||
<td scope="col" width="35%" class="listViewThS1"><a href="/sugar45/index.php?module=Accounts&action=Popup&mode=single&create=true&metadata=undefined&Accounts_ACCOUNT_offset=&Accounts_ACCOUNT_ORDER_BY=BILLING_ADDRESS_CITY" class="listViewThLinkS1">Version <img border='0' src='../../themes/Sugar/images/arrow.gif' width='8' height='10' align='absmiddle' alt='Sort'></a></td>
|
||||
<td scope="col" width="30%" class="listViewThS1"><a href="/sugar45/index.php?module=Accounts&action=Popup&mode=single&create=true&metadata=undefined&Accounts_ACCOUNT_offset=&Accounts_ACCOUNT_ORDER_BY=PHONE_OFFICE" class="listViewThLinkS1">Module: <img border='0' src='../../themes/Sugar/images/arrow.gif' width='8' height='10' align='absmiddle' alt='Sort'></a></td>
|
||||
<td scope="col" width="30%" class="listViewThS1"><a href="/sugar45/index.php?module=Accounts&action=Popup&mode=single&create=true&metadata=undefined&Accounts_ACCOUNT_offset=&Accounts_ACCOUNT_ORDER_BY=PHONE_OFFICE" class="listViewThLinkS1">Document: <img border='0' src='../../themes/Sugar/images/arrow.gif' width='8' height='10' align='absmiddle' alt='Sort'></a></td>
|
||||
</tr>
|
||||
<?
|
||||
if(count($list)>0)
|
||||
{
|
||||
foreach($list as $l)
|
||||
{
|
||||
if(count($_REQUEST['module'])>0)
|
||||
{
|
||||
foreach($_REQUEST['module'] as $mod)
|
||||
{
|
||||
if(mysql_num_rows(mysql_query("select id from ".$mod." where file_id='".$l['file_id']."'"))>0)
|
||||
{
|
||||
$numi=1;
|
||||
break;
|
||||
}
|
||||
else $numi=0;
|
||||
}
|
||||
}
|
||||
else $numi=1;
|
||||
if($numi==1)
|
||||
{
|
||||
print '
|
||||
<tr valign="top" height="20">
|
||||
<td class="oddListRowS1" bgcolor="#ffffff" valign="top"></td>
|
||||
<td scope="row" valign="top" class="oddListRowS1" bgcolor="#ffffff"><A href="#" onclick="parent.opener.document.getElementById(\'documentName'.$_GET['target'].'\').value=\''.$l['name'].'\';parent.opener.document.getElementById(\'documentId'.$_GET['target'].'\').value=\''.$l['id'].'\';window.close();" class="listViewTdLinkS1">'.$l['name'].'</A></td>
|
||||
|
||||
<td valign="top" class="oddListRowS1" bgcolor="#ffffff">'.$l['version'].'</td>
|
||||
<td valign="top" class="oddListRowS1" bgcolor="#ffffff">';
|
||||
if($l['module']=="ecmcontracts")print "Contracts";
|
||||
if($l['module']=="ecmcorrespondenceins")print "Correspondence In";
|
||||
if($l['module']=="ecmcorrespondenceouts")print "Correspondence Out";
|
||||
if($l['module']=="ecminvoiceins")print "Invoice In";
|
||||
if($l['module']=="ecminvoiceouts")print "Invoice Out";
|
||||
if($l['module']=="ecmdocs")print "Files";
|
||||
|
||||
print '</td>
|
||||
<td valign="top" class="oddListRowS1" bgcolor="#ffffff"><a href="index.php?module=';
|
||||
|
||||
if($l['module']=="ecmcontracts")print "EcmContracts";
|
||||
if($l['module']=="ecmcorrespondenceins")print "EcmCorrespondenceIns";
|
||||
if($l['module']=="ecmcorrespondenceouts")print "EcmCorrespondenceOuts";
|
||||
if($l['module']=="ecminvoiceins")print "EcmInvoiceIns";
|
||||
if($l['module']=="ecminvoiceouts")print "EcmInvoiceOuts";
|
||||
if($l['module']=="ecmdocs")print "EcmDocs";
|
||||
print '&action=DetailView&record='.$l['module_id'].'">'.$l['module_name'].'</a></td>
|
||||
</tr>';
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
<?
|
||||
mysql_close($sql);
|
||||
?>
|
||||
224
modules/EcmDocuments/SendAttachment.php
Executable file
224
modules/EcmDocuments/SendAttachment.php
Executable file
@@ -0,0 +1,224 @@
|
||||
<?
|
||||
require_once("../../config.php");
|
||||
require_once("dirstree.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']);
|
||||
mysql_query("set names utf8");
|
||||
mysql_query("set charaecterset utf8");
|
||||
|
||||
if($_POST['send'])
|
||||
{
|
||||
$name=explode("/",$_GET['file']);
|
||||
$nn=$name[count($name)-1];
|
||||
function send_mail($emailaddress, $fromaddress, $emailsubject, $body, $attachments=false)
|
||||
{
|
||||
$eol="\r\n";
|
||||
$mime_boundary=md5(time());
|
||||
|
||||
# Common Headers
|
||||
$headers .= 'From: E5<'.$fromaddress.'>'.$eol;
|
||||
$headers .= 'Reply-To: E5<'.$fromaddress.'>'.$eol;
|
||||
$headers .= 'Return-Path: E5<'.$fromaddress.'>'.$eol; // these two to set reply address
|
||||
$headers .= "Message-ID: <".$now." TheSystem@".$_SERVER['SERVER_NAME'].">".$eol;
|
||||
$headers .= "X-Mailer: PHP v".phpversion().$eol; // These two to help avoid spam-filters
|
||||
|
||||
# Boundry for marking the split & Multitype Headers
|
||||
$headers .= 'MIME-Version: 1.0'.$eol;
|
||||
$headers .= "Content-Type: multipart/related; boundary=\"".$mime_boundary."\"".$eol;
|
||||
|
||||
$msg = "";
|
||||
|
||||
if ($attachments !== false)
|
||||
{
|
||||
|
||||
for($i=0; $i < count($attachments); $i++)
|
||||
{
|
||||
if (is_file($attachments[$i]["file"]))
|
||||
{
|
||||
# File for Attachment
|
||||
$file_name = substr($attachments[$i]["file"], (strrpos($attachments[$i]["file"], "/")+1));
|
||||
|
||||
$handle=fopen($attachments[$i]["file"], 'rb');
|
||||
$f_contents=fread($handle, filesize($attachments[$i]["file"]));
|
||||
$f_contents=chunk_split(base64_encode($f_contents)); //Encode The Data For Transition using base64_encode();
|
||||
fclose($handle);
|
||||
|
||||
# Attachment
|
||||
$msg .= "--".$mime_boundary.$eol;
|
||||
$msg .= "Content-Type: ".$attachments[$i]["content_type"]."; name=\"".$file_name."\"".$eol;
|
||||
$msg .= "Content-Transfer-Encoding: base64".$eol;
|
||||
$msg .= "Content-Disposition: attachment; filename=\"".$file_name."\"".$eol.$eol; // !! This line needs TWO end of lines !! IMPORTANT !!
|
||||
$msg .= $f_contents.$eol.$eol;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Setup for text OR html
|
||||
$msg .= "Content-Type: multipart/alternative".$eol;
|
||||
|
||||
# Text Version
|
||||
$msg .= "--".$mime_boundary.$eol;
|
||||
$msg .= "Content-Type: text/plain; charset=iso-8859-2".$eol;
|
||||
$msg .= "Content-Transfer-Encoding: 8bit".$eol;
|
||||
$msg .= strip_tags(str_replace("<br>", "\n", $body)).$eol.$eol;
|
||||
|
||||
# HTML Version
|
||||
$msg .= "--".$mime_boundary.$eol;
|
||||
$msg .= "Content-Type: text/html; charset=iso-8859-2".$eol;
|
||||
$msg .= "Content-Transfer-Encoding: 8bit".$eol;
|
||||
$msg .= $body.$eol.$eol;
|
||||
|
||||
# Finished
|
||||
$msg .= "--".$mime_boundary."--".$eol.$eol; // finish with two eol's for better security. see Injection.
|
||||
|
||||
# SEND THE EMAIL
|
||||
ini_set(sendmail_from,$fromaddress); // the INI lines are to force the From Address to be used !
|
||||
mail($emailaddress, $emailsubject, $msg, $headers);
|
||||
ini_restore(sendmail_from);
|
||||
}
|
||||
|
||||
|
||||
# To Email Address
|
||||
$emailaddress=$_POST['email'];
|
||||
|
||||
# From Email Address
|
||||
$fromaddress = "kl@e5.pl";
|
||||
|
||||
# Message Subject
|
||||
$emailsubject=iconv("UTF-8","ISO-8859-2",$_POST['subject']);
|
||||
|
||||
# Use relative paths to the attachments
|
||||
$attachments = array(
|
||||
Array("file"=>$_GET['file'], "content_type"=>"application/pdf")
|
||||
);
|
||||
|
||||
# Message Body
|
||||
$body=iconv("UTF-8","ISO-8859-2",$_POST['body']);
|
||||
|
||||
send_mail($emailaddress, $fromaddress, $emailsubject, $body, $attachments);
|
||||
|
||||
print "<script language='javascript'>location.href='index.php?module=Quotes&action=DetailView&record=".$_REQUEST['record']."';</script>";
|
||||
}
|
||||
?>
|
||||
<!--
|
||||
/*********************************************************************************
|
||||
* The contents of this file are subject to the SugarCRM Public License Version
|
||||
* 1.1.3 ("License"); You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at http://www.sugarcrm.com/SPL
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* All copies of the Covered Code must include on each user interface screen:
|
||||
* (i) the "Powered by SugarCRM" logo and
|
||||
* (ii) the SugarCRM copyright notice
|
||||
* in the same form as they appear in the distribution. See full license for
|
||||
* requirements.
|
||||
*
|
||||
* The Original Code is: SugarCRM Open Source
|
||||
* The Initial Developer of the Original Code is SugarCRM, Inc.
|
||||
* Portions created by SugarCRM are Copyright (C) 2004-2006 SugarCRM, Inc.;
|
||||
* All Rights Reserved.
|
||||
* Contributor(s): ______________________________________.
|
||||
********************************************************************************/
|
||||
-->
|
||||
<script type="text/javascript" src="include/javascript/cookie.js?s=4.5.0g&c="></script><link rel="stylesheet" type="text/css" media="all" href="../../themes/Sugar/calendar-win2k-cold-1.css?s=4.5.0g&c="><script>jscal_today = 1.195210724E+012; if(typeof app_strings == "undefined") app_strings = new Array();</script><script type="text/javascript" src="jscalendar/calendar.js?s=4.5.0g&c="></script><script type="text/javascript" src="jscalendar/lang/calendar-en.js?s=4.5.0g&c="></script><script type="text/javascript" src="jscalendar/calendar-setup_3.js?s=4.5.0g&c="></script><script src="include/javascript/yui/YAHOO.js?s=4.5.0g&c="></script><script src="include/javascript/yui/log.js?s=4.5.0g&c="></script><script src="include/javascript/yui/dom.js?s=4.5.0g&c="></script><script src="include/javascript/yui/event.js?s=4.5.0g&c="></script><script src="include/javascript/yui/animation.js?s=4.5.0g&c="></script><script src="include/javascript/yui/connection.js?s=4.5.0g&c="></script><script src="include/javascript/yui/dragdrop.js?s=4.5.0g&c="></script><script src="include/javascript/yui/ygDDList.js?s=4.5.0g&c="></script><script type="text/javascript" src="include/javascript/sugar_3.js?s=4.5.0g&c="></script><script type="text/javascript">
|
||||
var time_reg_format = '([0-9]{1,2}):([0-9]{1,2})';
|
||||
var date_reg_format = '([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})';
|
||||
var date_reg_positions = {'Y': 1,'m': 2,'d': 3};
|
||||
var time_separator = ':';
|
||||
var cal_date_format = '%Y-%m-%d';
|
||||
var time_offset = 0;
|
||||
</script><script type="text/javascript" src="cache/jsLanguage/en_us.js?s=4.5.0g&c=&j=3"></script><script type="text/javascript" src="cache/jsLanguage/Contracts/en_us.js?s=4.5.0g&c=&j=3"></script>
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD html 4.01 Transitional//EN">
|
||||
<html >
|
||||
<style type="text/css">
|
||||
<!--
|
||||
body {
|
||||
margin-left: 20px;
|
||||
margin-top: 20px;
|
||||
margin-right: 20px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
-->
|
||||
</style><head >
|
||||
|
||||
<link REL="SHORTCUT ICON" HREF="include/images/sugar_icon.ico">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<title>SugarCRM - Commercial Open Source CRM</title>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="../../themes/Sugar/navigation.css?s=4.5.0g&c=" />
|
||||
<link rel="stylesheet" type="text/css" href="../../themes/Sugar/style.css?s=4.5.0g&c=" />
|
||||
<link rel="stylesheet" type="text/css" href="../../themes/Sugar/colors.sugar.css?s=4.5.0g&c=" />
|
||||
<link rel="stylesheet" type="text/css" href="../../themes/Sugar/fonts.normal.css?s=4.5.0g&c=" />
|
||||
<link href="../../themes/Sugar/colors.sugar.css?s=4.5.0g&c=" rel="stylesheet" type="text/css" title="color:sugar" />
|
||||
<link href="../../themes/Sugar/colors.blue.css?s=4.5.0g&c=" rel="alternate stylesheet" type="text/css" title="color:blue" />
|
||||
<link href="../../themes/Sugar/colors.green.css?s=4.5.0g&c=" rel="alternate stylesheet" type="text/css" title="color:green" />
|
||||
<link href="../../themes/Sugar/colors.purple.css?s=4.5.0g&c=" rel="alternate stylesheet" type="text/css" title="color:purple" />
|
||||
|
||||
<link href="../../themes/Sugar/colors.ocher.css?s=4.5.0g&c=" rel="alternate stylesheet" type="text/css" title="color:ocher" />
|
||||
<link href="../../themes/Sugar/fonts.normal.css?s=4.5.0g&c=" rel="stylesheet" type="text/css" title="font:normal" />
|
||||
<link href="../../themes/Sugar/fonts.larger.css?s=4.5.0g&c=" rel="alternate stylesheet" type="text/css" title="font:larger" />
|
||||
<link href="../../themes/Sugar/fonts.largest.css?s=4.5.0g&c=" rel="alternate stylesheet" type="text/css" title="font:largest" />
|
||||
|
||||
<script language="javascript" src="../../themes/Sugar/menu.js?s=4.5.0g&c="></script>
|
||||
<script language="javascript" src="../../themes/Sugar/cookie.js?s=4.5.0g&c="></script>
|
||||
<script language="javascript" src="../../themes/Sugar/style.js?s=4.5.0g&c="></script>
|
||||
</head>
|
||||
<body onLoad="<?if($ok=="ok")print "window.close();";?>">
|
||||
|
||||
|
||||
<script type="text/javascript" src="include/javascript/popup_parent_helper.js?s=4.5.0g&c="></script>
|
||||
<form name="EditView" method="POST" enctype="multipart/form-data" action="SendEmail.php?mod=<?print $_REQUEST['mod'];?>&record=<?print $_REQUEST['record'];?>">
|
||||
<table width='100%' cellpadding='0' cellspacing='0' border='0' class='moduleTitle'><tr><td valign='top'>
|
||||
<h2>EcmDocuments: Send Information</h2></td>
|
||||
</tr></table>
|
||||
<div style="padding-top: 2px">
|
||||
<input name="send" type="submit" class="button" id="send" title="save" value="Send">
|
||||
<input name="cancel" type="button" class="button" id="cancel" title="cancel" value="Cancel" onClick="window.close();">
|
||||
</div>
|
||||
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="tabForm">
|
||||
<tr>
|
||||
<td rowspan="2" valign="top" class="dataLabel"><strong>E-mail</strong></td>
|
||||
<td rowspan="2" valign="top" class="dataField"><input type="hidden" name="email"><select name="user[]" size="6" multiple="multiple">
|
||||
<?
|
||||
$z="select email1,first_name,last_name,user_name from users where deleted='0' and email1 IS NOT NULL order by user_name asc";
|
||||
$w=mysql_query($z);
|
||||
while($r=mysql_fetch_array($w))
|
||||
{
|
||||
print "<option value='".$r['email1']."'>".$r['first_name']." ".$r['last_name']."</option>";
|
||||
}
|
||||
?>
|
||||
</select></td>
|
||||
<td valign="top" class="dataLabel"><strong>Subject</strong></td>
|
||||
<td valign="top" class="dataField"><textarea name="subject" cols="80" rows="2" id="subject">New Document</textarea></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top" class="dataLabel"><strong>Text</strong></td>
|
||||
<td valign="top" class="dataField"><textarea name="text" cols="80" rows="20" id="text">Please notice a new document in CRM: <a href='http://192.168.1.200<?
|
||||
$ps=str_replace("modules/EcmDocuments/SendEmail.php","index.php",$_SERVER['PHP_SELF']);
|
||||
print $ps;?>?module=<?print $_REQUEST['mod'];?>&action=DetailView&record=<?print $_REQUEST['record'];?>'>http://192.168.1.200<?
|
||||
$ps=str_replace("modules/EcmDocuments/SendEmail.php","index.php",$_SERVER['PHP_SELF']);
|
||||
print $ps;?>?module=<?print $_REQUEST['mod'];?>&action=DetailView&record=<?print $_REQUEST['record'];?></a></textarea></td>
|
||||
<!-- BEGIN: pro -->
|
||||
<!-- END: pro -->
|
||||
<!-- BEGIN: open_source -->
|
||||
<!-- END: open_source -->
|
||||
</tr>
|
||||
</table>
|
||||
<input type="hidden" name="numusers" value="<?print $i;?>" />
|
||||
<br>
|
||||
<input name="addfromcrm" type="button" onClick='window.open("modules/EcmDocuments/SelectFile.php","Account","resizable=yes,scrollbars=yes,status=no,height=450,width=600").focus();return false;' class="button" id="addfromcrm" value="Add from CRM" />
|
||||
<div style="padding-top: 2px">
|
||||
<input name="send" type="submit" class="button" id="send" title="save" value="Send" >
|
||||
<input name="cancel" type="button" class="button" id="cancel" title="cancel" value="Cancel" onClick="window.close();">
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
<!-- END: main -->
|
||||
<? mysql_close($sql);?>
|
||||
227
modules/EcmDocuments/SendEmail.php
Executable file
227
modules/EcmDocuments/SendEmail.php
Executable file
@@ -0,0 +1,227 @@
|
||||
<?
|
||||
header('Content-type: text/html; charset=utf-8');
|
||||
session_start();
|
||||
error_reporting(E_ALL);
|
||||
require_once("../../config.php");
|
||||
require_once("dirstree.php");
|
||||
require_once("guid.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']);
|
||||
mysql_query("set names utf8");
|
||||
mysql_query("set charaecterset utf8");
|
||||
|
||||
if($_POST['send'] && $_POST['subject'] && $_POST['text'])
|
||||
{
|
||||
$user=$_POST['user'];
|
||||
if($_POST['signature'])
|
||||
{
|
||||
mysql_query("update users_signatures set signature_html='".$_POST['signature']."' where id='".$_POST['signature_id']."' and user_id='".$_SESSION['authenticated_user_id']."'");
|
||||
}
|
||||
$doKogo="";
|
||||
foreach($user as $u)
|
||||
{
|
||||
$r=mysql_fetch_array(mysql_query("select email1 from users where id='".$u."'"));
|
||||
if($r['email1'])$mail=$r['email1'];
|
||||
else $mail="";
|
||||
if($mail)$doKogo.=$mail.";";
|
||||
}
|
||||
$w=mysql_query("SELECT contents FROM user_preferences WHERE assigned_user_id='".$_SESSION['authenticated_user_id']."' AND category='global' AND deleted = 0");
|
||||
$r=mysql_fetch_array($w);
|
||||
if(!isset($user)) $user = $GLOBALS['current_user'];
|
||||
|
||||
$mailg=unserialize(base64_decode($r['contents']));
|
||||
if($mailg['mail_fromaddress'])$mail_fromaddress=$mailg['mail_fromaddress'];
|
||||
|
||||
$r=mysql_fetch_array(mysql_query("select first_name,last_name from users where id='".$_SESSION['authenticated_user_id']."'"));
|
||||
$mail_fromname=$r['first_name']." ".$r['last_name'];
|
||||
|
||||
if($mail_fromname==" ")$mail_fromname="Celtic CRM";
|
||||
if(!$mail_fromaddress)$mail_fromaddress="crm@celtic.pl";
|
||||
$odKogo=$mail_fromname." <".$mail_fromaddress.">"; // e-mail nadawcy
|
||||
|
||||
$r=mysql_fetch_array(mysql_query("select signature_html,id from users_signatures where user_id='".$_SESSION['authenticated_user_id']."'"));
|
||||
if($r['signature_html']=="")$sig="--------<br>".$odKogo."<br><a href='mailto:".$mail_fromaddress."'>".$mail_fromaddress."</a>";
|
||||
else $sig=nl2br($r['signature_html']);
|
||||
|
||||
$imie="Celtic"; //imie nadawcy
|
||||
$tresc=nl2br($_POST['text'])."<br>".$_POST['link']."<br><br>".$sig;
|
||||
$temat=$_POST['subject'];
|
||||
|
||||
//$tresc.="<br><br>--------<br>".$odKogo."<br><a href='mailto:support@more7.com'>support@more7.com</a>";
|
||||
//konwertowanie z utf-8 na iso 8859-2
|
||||
$tresc = stripslashes($tresc);
|
||||
$tresc = strtr($tresc, "\xA5\x8C\x8F\xB9\x9C\x9F", "\xA1\xA6\xAC\xB1\xB6\xBC");
|
||||
$temat = stripslashes($temat);
|
||||
$temat = strtr($temat, "\xA5\x8C\x8F\xB9\x9C\x9F", "\xA1\xA6\xAC\xB1\xB6\xBC");
|
||||
//wysylanie maila
|
||||
if(mailashtml($doKogo,$temat,$tresc,$odKogo))
|
||||
{
|
||||
$to_name="";
|
||||
foreach($user as $u)
|
||||
{
|
||||
$r=mysql_fetch_array(mysql_query("select user_name from users where id='".$u."'"));
|
||||
if($r['user_name'])
|
||||
{
|
||||
$to_name.=$r['user_name']."||";
|
||||
}
|
||||
}
|
||||
$zz="insert into ecminform_history values('".create_guid()."','EcmCorrespondenceIns','".$_REQUEST['record']."','".$_SESSION['authenticated_user_id']."','".$to_name."','".date("Y-m-d H:i:s")."')";
|
||||
mysql_query($zz);
|
||||
$ok="ok";
|
||||
}
|
||||
else $ok="false";
|
||||
}
|
||||
|
||||
?>
|
||||
<!--
|
||||
/*********************************************************************************
|
||||
* The contents of this file are subject to the SugarCRM Public License Version
|
||||
* 1.1.3 ("License"); You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at http://www.sugarcrm.com/SPL
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* All copies of the Covered Code must include on each user interface screen:
|
||||
* (i) the "Powered by SugarCRM" logo and
|
||||
* (ii) the SugarCRM copyright notice
|
||||
* in the same form as they appear in the distribution. See full license for
|
||||
* requirements.
|
||||
*
|
||||
* The Original Code is: SugarCRM Open Source
|
||||
* The Initial Developer of the Original Code is SugarCRM, Inc.
|
||||
* Portions created by SugarCRM are Copyright (C) 2004-2006 SugarCRM, Inc.;
|
||||
* All Rights Reserved.
|
||||
* Contributor(s): ______________________________________.
|
||||
********************************************************************************/
|
||||
-->
|
||||
<script type="text/javascript" src="../../include/javascript/cookie.js?s=4.5.0g&c="></script><link rel="stylesheet" type="text/css" media="all" href="../../themes/Sugar/calendar-win2k-cold-1.css?s=4.5.0g&c="><script>jscal_today = 1.195210724E+012; if(typeof app_strings == "undefined") app_strings = new Array();</script><script type="text/javascript" src="../../jscalendar/calendar.js?s=4.5.0g&c="></script><script type="text/javascript" src="../../jscalendar/lang/calendar-en.js?s=4.5.0g&c="></script><script type="text/javascript" src="../../jscalendar/calendar-setup_3.js?s=4.5.0g&c="></script><script src="../../include/javascript/yui/YAHOO.js?s=4.5.0g&c="></script><script src="../../include/javascript/yui/log.js?s=4.5.0g&c="></script><script src="../../include/javascript/yui/dom.js?s=4.5.0g&c="></script><script src="../../include/javascript/yui/event.js?s=4.5.0g&c="></script><script src="../../include/javascript/yui/animation.js?s=4.5.0g&c="></script><script src="../../include/javascript/yui/connection.js?s=4.5.0g&c="></script><script src="../../include/javascript/yui/dragdrop.js?s=4.5.0g&c="></script><script src="../../include/javascript/yui/ygDDList.js?s=4.5.0g&c="></script><script type="text/javascript" src="../../include/javascript/sugar_3.js?s=4.5.0g&c="></script><script type="text/javascript">
|
||||
var time_reg_format = '([0-9]{1,2}):([0-9]{1,2})';
|
||||
var date_reg_format = '([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})';
|
||||
var date_reg_positions = {'Y': 1,'m': 2,'d': 3};
|
||||
var time_separator = ':';
|
||||
var cal_date_format = '%Y-%m-%d';
|
||||
var time_offset = 0;
|
||||
</script><script type="text/javascript" src="../../cache/jsLanguage/en_us.js?s=4.5.0g&c=&j=3"></script><script type="text/javascript" src="../../cache/jsLanguage/Contracts/en_us.js?s=4.5.0g&c=&j=3"></script>
|
||||
<?
|
||||
if(file_exists('include/FCKeditor/fckeditor.php')) {
|
||||
include('include/FCKeditor/FCKeditor_Sugar.php') ;
|
||||
ob_start();
|
||||
$instancename = 'signature';
|
||||
$oFCKeditor = new FCKeditor_Sugar($instancename) ;
|
||||
$oFCKeditor->Width = 590;
|
||||
$oFCKeditor->Height = 800;
|
||||
if(!empty($focus->body)) {
|
||||
$oFCKeditor->Value = $focus->body;
|
||||
}
|
||||
else $oFCKeditor->Value="";
|
||||
$oFCKeditor->Create() ;
|
||||
$htmlarea_src = ob_get_contents();
|
||||
ob_end_clean();
|
||||
}
|
||||
?>
|
||||
</body>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD html 4.01 Transitional//EN">
|
||||
<html >
|
||||
<style type="text/css">
|
||||
<!--
|
||||
body {
|
||||
margin-left: 20px;
|
||||
margin-top: 20px;
|
||||
margin-right: 20px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
-->
|
||||
</style><head >
|
||||
|
||||
<link REL="SHORTCUT ICON" HREF="include/images/sugar_icon.ico">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<title>Celtic CRM</title>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="../../themes/Sugar/navigation.css?s=4.5.0g&c=" />
|
||||
<link rel="stylesheet" type="text/css" href="../../themes/Sugar/style.css?s=4.5.0g&c=" />
|
||||
<link rel="stylesheet" type="text/css" href="../../themes/Sugar/colors.sugar.css?s=4.5.0g&c=" />
|
||||
<link rel="stylesheet" type="text/css" href="../../themes/Sugar/fonts.normal.css?s=4.5.0g&c=" />
|
||||
<link href="../../themes/Sugar/colors.sugar.css?s=4.5.0g&c=" rel="stylesheet" type="text/css" title="color:sugar" />
|
||||
<link href="../../themes/Sugar/colors.blue.css?s=4.5.0g&c=" rel="alternate stylesheet" type="text/css" title="color:blue" />
|
||||
<link href="../../themes/Sugar/colors.green.css?s=4.5.0g&c=" rel="alternate stylesheet" type="text/css" title="color:green" />
|
||||
<link href="../../themes/Sugar/colors.purple.css?s=4.5.0g&c=" rel="alternate stylesheet" type="text/css" title="color:purple" />
|
||||
|
||||
<link href="../../themes/Sugar/colors.ocher.css?s=4.5.0g&c=" rel="alternate stylesheet" type="text/css" title="color:ocher" />
|
||||
<link href="../../themes/Sugar/fonts.normal.css?s=4.5.0g&c=" rel="stylesheet" type="text/css" title="font:normal" />
|
||||
<link href="../../themes/Sugar/fonts.larger.css?s=4.5.0g&c=" rel="alternate stylesheet" type="text/css" title="font:larger" />
|
||||
<link href="../../themes/Sugar/fonts.largest.css?s=4.5.0g&c=" rel="alternate stylesheet" type="text/css" title="font:largest" />
|
||||
|
||||
<script language="javascript" src="../../themes/Sugar/menu.js?s=4.5.0g&c="></script>
|
||||
<script language="javascript" src="../../themes/Sugar/cookie.js?s=4.5.0g&c="></script>
|
||||
<script language="javascript" src="../../themes/Sugar/style.js?s=4.5.0g&c="></script>
|
||||
</head>
|
||||
<body onLoad="<?if($ok=="ok")print "window.close();"?>">
|
||||
|
||||
|
||||
<script type="text/javascript" src="../../include/javascript/popup_parent_helper.js?s=4.5.0g&c="></script>
|
||||
<form name="EditView" method="POST" enctype="multipart/form-data" action="SendEmail.php?mod=<?print $_REQUEST['mod'];?>&record=<?print $_REQUEST['record'];?>">
|
||||
<table width='100%' cellpadding='0' cellspacing='0' border='0' class='moduleTitle'><tr><td valign='top'>
|
||||
<h2>EcmDocuments: Send Information</h2></td>
|
||||
</tr></table>
|
||||
<div style="padding-top: 2px">
|
||||
<input name="send" type="submit" class="button" id="send" title="save" value="Send">
|
||||
<input name="cancel" type="button" class="button" id="cancel" title="cancel" value="Cancel" onClick="window.close();">
|
||||
</div>
|
||||
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="tabForm">
|
||||
<tr>
|
||||
<td rowspan="2" valign="top" class="dataLabel"><strong>E-mail</strong></td>
|
||||
<td rowspan="2" valign="top" class="dataField"><input type="hidden" name="email"><select name="user[]" size="6" multiple="multiple">
|
||||
<?
|
||||
$z="select id,email1,first_name,last_name,user_name from users where deleted='0' and email1 IS NOT NULL order by user_name asc";
|
||||
$w=mysql_query($z);
|
||||
while($r=mysql_fetch_array($w))
|
||||
{
|
||||
print "<option value='".$r['id']."'>".$r['first_name']." ".$r['last_name']."</option>";
|
||||
}
|
||||
?>
|
||||
</select></td>
|
||||
<td valign="top" class="dataLabel"><strong>Subject</strong></td>
|
||||
<td valign="top" class="dataField"><textarea name="subject" cols="80" rows="2" id="subject">New Document in CRM (for your information)</textarea></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top" class="dataLabel"><strong>Text</strong></td>
|
||||
<td valign="top" class="dataField"><p>
|
||||
<textarea name="text" cols="80" rows="10" id="text"><?
|
||||
$ro=mysql_fetch_array(mysql_query("select first_name,last_name from users where id='".$_SESSION['authenticated_user_id']."'"));
|
||||
print $ro['first_name']." ".$ro['last_name'];
|
||||
?> would like to inform you about a new document in CRM.
|
||||
This document was assigned to <?
|
||||
$row=mysql_fetch_array(mysql_query("select assigned_user_id from ecmcorrespondenceins where id='".$_REQUEST['record']."'"));
|
||||
$assigned_user=$row['assigned_user_id'];
|
||||
$ro=mysql_fetch_array(mysql_query("select first_name,last_name from users where id='".$assigned_user."'"));
|
||||
print $ro['first_name']." ".$ro['last_name'];
|
||||
?>.</textarea>
|
||||
<textarea name="link" readonly cols="80" rows="2" id="link"><a href='http://192.168.1.200/test/index.php?module=<?print $_REQUEST['mod'];?>&action=DetailView&record=<?print $_REQUEST['record'];?>'>http://192.168.1.200/test/index.php?module=<?print $_REQUEST['mod'];?>&action=DetailView&record=<?print $_REQUEST['record'];?></a></textarea>
|
||||
<br>
|
||||
<div style="display:block;" name="signature" cols="80" rows="6" id="signature"><?
|
||||
$r=mysql_fetch_array(mysql_query("select signature_html,id from users_signatures where user_id='".$_SESSION['authenticated_user_id']."'"));
|
||||
print $htmlarea_src;
|
||||
$sig_id=$r['id'];
|
||||
?></div>
|
||||
|
||||
<input type="hidden" id="signature_id" name="signature_id" value="<?print $sig_id;?>">
|
||||
<!--<input type="button" value="Footer" onClick="window.open('../../index.php?module=Users&action=PopupEditView&the_user_id=<?print $_SESSION['authenticated_user_id'];?>&record=<?print $sig_id;?>','Podglad','resizable=yes,scrollbars=yes,status=no,height=500,width=800');">--></p>
|
||||
</td>
|
||||
<!-- BEGIN: pro -->
|
||||
<!-- END: pro -->
|
||||
<!-- BEGIN: open_source -->
|
||||
<!-- END: open_source -->
|
||||
</tr>
|
||||
</table>
|
||||
<input type="hidden" name="numusers" value="<?print $i;?>" />
|
||||
<div style="padding-top: 2px">
|
||||
<input name="send" type="submit" class="button" id="send" title="save" value="Send" >
|
||||
<input name="cancel" type="button" class="button" id="cancel" title="cancel" value="Cancel" onClick="window.close();">
|
||||
</div>
|
||||
</form>
|
||||
</html>
|
||||
<!-- END: main -->
|
||||
<? mysql_close($sql);?>
|
||||
249
modules/EcmDocuments/SendEmailFile.php
Executable file
249
modules/EcmDocuments/SendEmailFile.php
Executable file
@@ -0,0 +1,249 @@
|
||||
<?
|
||||
require_once("../../config.php");
|
||||
require_once("../../modules/EcmDocs/uploadfile.php");
|
||||
//require_once("dirstree.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']);
|
||||
mysql_query("set names utf8");
|
||||
mysql_query("set charaecterset utf8");
|
||||
|
||||
if($_POST['send'])
|
||||
{
|
||||
/*
|
||||
function send_mail($emailaddress, $fromaddress, $emailsubject, $body, $attachments=false)
|
||||
{
|
||||
$eol="\r\n";
|
||||
$mime_boundary=md5(time());
|
||||
|
||||
# Common Headers
|
||||
$headers .= 'From: Celtic CRM<'.$fromaddress.'>'.$eol;
|
||||
$headers .= 'Reply-To: Celtic CRM<'.$fromaddress.'>'.$eol;
|
||||
$headers .= 'Return-Path: Celtic CRM<'.$fromaddress.'>'.$eol; // these two to set reply address
|
||||
$headers .= "Message-ID: <".$now." TheSystem@".$_SERVER['SERVER_NAME'].">".$eol;
|
||||
$headers .= "X-Mailer: PHP v".phpversion().$eol; // These two to help avoid spam-filters
|
||||
|
||||
# Boundry for marking the split & Multitype Headers
|
||||
$headers .= 'MIME-Version: 1.0'.$eol;
|
||||
$headers .= "Content-Type: multipart/related; boundary=\"".$mime_boundary."\"".$eol;
|
||||
|
||||
$msg = "";
|
||||
|
||||
if ($attachments !== false)
|
||||
{
|
||||
|
||||
for($i=0; $i < count($attachments); $i++)
|
||||
{
|
||||
if (is_file($attachments[$i]["file"]))
|
||||
{
|
||||
# File for Attachment
|
||||
$file_name = substr($attachments[$i]["file"], (strrpos($attachments[$i]["file"], "/")+1));
|
||||
|
||||
$handle=fopen($attachments[$i]["file"], 'rb');
|
||||
$f_contents=fread($handle, filesize($attachments[$i]["file"]));
|
||||
$f_contents=chunk_split(base64_encode($f_contents)); //Encode The Data For Transition using base64_encode();
|
||||
fclose($handle);
|
||||
|
||||
# Attachment
|
||||
$msg .= "--".$mime_boundary.$eol;
|
||||
$msg .= "Content-Type: ".$attachments[$i]["content_type"]."; name=\"".$attachments[$i]["name"]."\"".$eol;
|
||||
$msg .= "Content-Transfer-Encoding: base64".$eol;
|
||||
$msg .= "Content-Disposition: attachment; filename=\"".$attachments[$i]["name"]."\"".$eol.$eol; // !! This line needs TWO end of lines !! IMPORTANT !!
|
||||
$msg .= $f_contents.$eol.$eol;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Setup for text OR html
|
||||
$msg .= "Content-Type: multipart/alternative".$eol;
|
||||
|
||||
# Text Version
|
||||
$msg .= "--".$mime_boundary.$eol;
|
||||
$msg .= "Content-Type: text/plain; charset=iso-8859-2".$eol;
|
||||
$msg .= "Content-Transfer-Encoding: 8bit".$eol;
|
||||
$msg .= strip_tags(str_replace("<br>", "\n", $body)).$eol.$eol;
|
||||
|
||||
# HTML Version
|
||||
$msg .= "--".$mime_boundary.$eol;
|
||||
$msg .= "Content-Type: text/html; charset=iso-8859-2".$eol;
|
||||
$msg .= "Content-Transfer-Encoding: 8bit".$eol;
|
||||
$msg .= $body.$eol.$eol;
|
||||
|
||||
# Finished
|
||||
$msg .= "--".$mime_boundary."--".$eol.$eol; // finish with two eol's for better security. see Injection.
|
||||
|
||||
# SEND THE EMAIL
|
||||
ini_set(sendmail_from,$fromaddress); // the INI lines are to force the From Address to be used !
|
||||
mail($emailaddress, $emailsubject, $msg, $headers);
|
||||
ini_restore(sendmail_from);
|
||||
}
|
||||
|
||||
*/
|
||||
if($_POST['id_file'])
|
||||
{
|
||||
$row=mysql_fetch_array(mysql_query("select name,filename from ecmfiles_versions where id='".$_POST['id_file']."'"));
|
||||
$attachments = array("file" => "../../".$row['filename'], "content_type" =>"application/pdf", "name"=>$row['name']);
|
||||
}
|
||||
require("phpmailer/class.phpmailer.php");
|
||||
$mail = new PHPMailer();
|
||||
|
||||
$mail->PluginDir = "phpmailer/";
|
||||
$mail->From = "crm@celtic.pl"; //adres naszego konta
|
||||
$mail->FromName = "CRM";//nagłówek From
|
||||
//$mail->Host = "NASZ.SERWER.SMTP";//adres serwera SMTP
|
||||
//$mail->Mailer = "smtp";
|
||||
//$mail->Username = "tester@KONTO";//nazwa użytkownika
|
||||
//$mail->Password = "HASLO";//nasze hasło do konta SMTP
|
||||
//$mail->SMTPAuth = true;
|
||||
//$mail->SetLanguage("en", "phpmailer/language/");
|
||||
|
||||
$mail->Subject = $_POST['subject'];//temat maila
|
||||
|
||||
// w zmienną $text_body wpisujemy treść maila
|
||||
$text_body = $_POST['body'];
|
||||
|
||||
$mail->Body = $text_body;
|
||||
$mail->AddAttachment($attachments['file'],$attachments['name'],"8bit","application/pdf");
|
||||
// adresatów dodajemy poprzez metode 'AddAddress'
|
||||
foreach($_POST['user'] as $emails)$mail->AddAddress($emails,$emails);
|
||||
|
||||
if(!$mail->Send())
|
||||
echo "There has been a mail error <br>";
|
||||
echo $mail->ErrorInfo."<br>";
|
||||
|
||||
// Clear all addresses and attachments
|
||||
$mail->ClearAddresses();
|
||||
$mail->ClearAttachments();
|
||||
|
||||
# Use relative paths to the attachments
|
||||
|
||||
/*
|
||||
if($_POST['filename']['name'])
|
||||
{
|
||||
$handle=upload_file('filename','cache/upload');
|
||||
$attachments = array(array("file" => $handle, "content_type" => "application/pdf", "name"=>$_FILES['filename']['name']));
|
||||
}*/
|
||||
# Message Body
|
||||
$body=;
|
||||
ob_start();
|
||||
send_mail($emailaddress, $fromaddress, $emailsubject, $body, $attachments);
|
||||
|
||||
}
|
||||
?>
|
||||
<!--
|
||||
/*********************************************************************************
|
||||
* The contents of this file are subject to the SugarCRM Public License Version
|
||||
* 1.1.3 ("License"); You may not use this file except in compliance with the
|
||||
* License. You may obtain a copy of the License at http://www.sugarcrm.com/SPL
|
||||
* Software distributed under the License is distributed on an "AS IS" basis,
|
||||
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing rights and limitations under the
|
||||
* License.
|
||||
*
|
||||
* All copies of the Covered Code must include on each user interface screen:
|
||||
* (i) the "Powered by SugarCRM" logo and
|
||||
* (ii) the SugarCRM copyright notice
|
||||
* in the same form as they appear in the distribution. See full license for
|
||||
* requirements.
|
||||
*
|
||||
* The Original Code is: SugarCRM Open Source
|
||||
* The Initial Developer of the Original Code is SugarCRM, Inc.
|
||||
* Portions created by SugarCRM are Copyright (C) 2004-2006 SugarCRM, Inc.;
|
||||
* All Rights Reserved.
|
||||
* Contributor(s): ______________________________________.
|
||||
********************************************************************************/
|
||||
-->
|
||||
<script type="text/javascript" src="include/javascript/cookie.js?s=4.5.0g&c="></script><link rel="stylesheet" type="text/css" media="all" href="../../themes/Sugar/calendar-win2k-cold-1.css?s=4.5.0g&c="><script>jscal_today = 1.195210724E+012; if(typeof app_strings == "undefined") app_strings = new Array();</script><script type="text/javascript" src="jscalendar/calendar.js?s=4.5.0g&c="></script><script type="text/javascript" src="jscalendar/lang/calendar-en.js?s=4.5.0g&c="></script><script type="text/javascript" src="jscalendar/calendar-setup_3.js?s=4.5.0g&c="></script><script src="include/javascript/yui/YAHOO.js?s=4.5.0g&c="></script><script src="include/javascript/yui/log.js?s=4.5.0g&c="></script><script src="include/javascript/yui/dom.js?s=4.5.0g&c="></script><script src="include/javascript/yui/event.js?s=4.5.0g&c="></script><script src="include/javascript/yui/animation.js?s=4.5.0g&c="></script><script src="include/javascript/yui/connection.js?s=4.5.0g&c="></script><script src="include/javascript/yui/dragdrop.js?s=4.5.0g&c="></script><script src="include/javascript/yui/ygDDList.js?s=4.5.0g&c="></script><script type="text/javascript" src="include/javascript/sugar_3.js?s=4.5.0g&c="></script><script type="text/javascript">
|
||||
var time_reg_format = '([0-9]{1,2}):([0-9]{1,2})';
|
||||
var date_reg_format = '([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})';
|
||||
var date_reg_positions = {'Y': 1,'m': 2,'d': 3};
|
||||
var time_separator = ':';
|
||||
var cal_date_format = '%Y-%m-%d';
|
||||
var time_offset = 0;
|
||||
</script><script type="text/javascript" src="cache/jsLanguage/en_us.js?s=4.5.0g&c=&j=3"></script><script type="text/javascript" src="cache/jsLanguage/Contracts/en_us.js?s=4.5.0g&c=&j=3"></script>
|
||||
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD html 4.01 Transitional//EN">
|
||||
<html >
|
||||
<style type="text/css">
|
||||
<!--
|
||||
body {
|
||||
margin-left: 20px;
|
||||
margin-top: 20px;
|
||||
margin-right: 20px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
-->
|
||||
</style><head >
|
||||
|
||||
<link REL="SHORTCUT ICON" HREF="include/images/sugar_icon.ico">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<title>SugarCRM - Commercial Open Source CRM</title>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="../../themes/Sugar/navigation.css?s=4.5.0g&c=" />
|
||||
<link rel="stylesheet" type="text/css" href="../../themes/Sugar/style.css?s=4.5.0g&c=" />
|
||||
<link rel="stylesheet" type="text/css" href="../../themes/Sugar/colors.sugar.css?s=4.5.0g&c=" />
|
||||
<link rel="stylesheet" type="text/css" href="../../themes/Sugar/fonts.normal.css?s=4.5.0g&c=" />
|
||||
<link href="../../themes/Sugar/colors.sugar.css?s=4.5.0g&c=" rel="stylesheet" type="text/css" title="color:sugar" />
|
||||
<link href="../../themes/Sugar/colors.blue.css?s=4.5.0g&c=" rel="alternate stylesheet" type="text/css" title="color:blue" />
|
||||
<link href="../../themes/Sugar/colors.green.css?s=4.5.0g&c=" rel="alternate stylesheet" type="text/css" title="color:green" />
|
||||
<link href="../../themes/Sugar/colors.purple.css?s=4.5.0g&c=" rel="alternate stylesheet" type="text/css" title="color:purple" />
|
||||
|
||||
<link href="../../themes/Sugar/colors.ocher.css?s=4.5.0g&c=" rel="alternate stylesheet" type="text/css" title="color:ocher" />
|
||||
<link href="../../themes/Sugar/fonts.normal.css?s=4.5.0g&c=" rel="stylesheet" type="text/css" title="font:normal" />
|
||||
<link href="../../themes/Sugar/fonts.larger.css?s=4.5.0g&c=" rel="alternate stylesheet" type="text/css" title="font:larger" />
|
||||
<link href="../../themes/Sugar/fonts.largest.css?s=4.5.0g&c=" rel="alternate stylesheet" type="text/css" title="font:largest" />
|
||||
|
||||
<script language="javascript" src="../../themes/Sugar/menu.js?s=4.5.0g&c="></script>
|
||||
<script language="javascript" src="../../themes/Sugar/cookie.js?s=4.5.0g&c="></script>
|
||||
<script language="javascript" src="../../themes/Sugar/style.js?s=4.5.0g&c="></script>
|
||||
</head>
|
||||
<body onLoad="<?if($ok=="ok")print "window.close();";?>">
|
||||
|
||||
|
||||
<script type="text/javascript" src="include/javascript/popup_parent_helper.js?s=4.5.0g&c="></script>
|
||||
<form name="EditView" method="POST" enctype="multipart/form-data" action="SendEmailFile.php">
|
||||
<table width='100%' cellpadding='0' cellspacing='0' border='0' class='moduleTitle'><tr><td valign='top'>
|
||||
<h2>EcmDocuments: Send Information</h2></td>
|
||||
</tr></table>
|
||||
<div style="padding-top: 2px">
|
||||
<input name="send" type="submit" class="button" id="send" title="save" value="Send">
|
||||
<input name="cancel" type="button" class="button" id="cancel" title="cancel" value="Cancel" onClick="window.close();">
|
||||
</div>
|
||||
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="tabForm">
|
||||
<tr>
|
||||
<td rowspan="2" valign="top" class="dataLabel"><strong>E-mail</strong></td>
|
||||
<td rowspan="2" valign="top" class="dataField"><input type="hidden" name="email"><select name="user[]" size="6" multiple="multiple">
|
||||
<?
|
||||
$z="select email1,first_name,last_name,user_name from users where deleted='0' and email1 IS NOT NULL order by user_name asc";
|
||||
$w=mysql_query($z);
|
||||
while($r=mysql_fetch_array($w))
|
||||
{
|
||||
print "<option value='".$r['email1']."'>".$r['first_name']." ".$r['last_name']."</option>";
|
||||
}
|
||||
?>
|
||||
</select></td>
|
||||
<td valign="top" class="dataLabel"><strong>Subject</strong></td>
|
||||
<td valign="top" class="dataField"><textarea name="subject" cols="80" rows="2" id="subject"></textarea></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top" class="dataLabel"><strong>Text</strong></td>
|
||||
<td valign="top" class="dataField"><textarea name="body" cols="80" rows="20" id="text"></textarea></td>
|
||||
<!-- BEGIN: pro -->
|
||||
<!-- END: pro -->
|
||||
<!-- BEGIN: open_source -->
|
||||
<!-- END: open_source -->
|
||||
</tr>
|
||||
</table>
|
||||
<input type="hidden" name="numusers" value="<?print $i;?>" />
|
||||
<br>
|
||||
<input name="addfromcrm" type="button" onClick='window.open("SelectFile.php","SelectFromCrm","resizable=yes,scrollbars=yes,status=no,height=450,width=600").focus();return false;' class="button" id="addfromcrm" value="Add from CRM" /> <div style="display:inline;" id="attachedcrm"></div><input type="hidden" id="id_file" name="id_file" value="">
|
||||
<div style="padding-top: 2px">
|
||||
<input name="send" type="submit" class="button" id="send" title="save" value="Send" >
|
||||
<input name="cancel" type="button" class="button" id="cancel" title="cancel" value="Cancel" onClick="window.close();">
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
<!-- END: main -->
|
||||
<? mysql_close($sql);?>
|
||||
313
modules/EcmDocuments/SetPermissions.php
Executable file
313
modules/EcmDocuments/SetPermissions.php
Executable file
@@ -0,0 +1,313 @@
|
||||
<!--
|
||||
/*****************************************************************************
|
||||
* 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.
|
||||
********************************************************************************/
|
||||
-->
|
||||
<script language="javascript">
|
||||
function check_checkbox(i,what)
|
||||
{
|
||||
if(document.getElementById("pom"+what+""+i).value==" checked")document.getElementById("pom"+what+""+i).value="";
|
||||
else document.getElementById("pom"+what+""+i).value=" checked";
|
||||
}
|
||||
function check_all(num,check,start)
|
||||
{
|
||||
if(start=="subfolders")
|
||||
{
|
||||
for(i=0;i<=num-1;i++)
|
||||
{
|
||||
document.getElementById("read"+i).checked=check;
|
||||
document.getElementById("write"+i).checked=check;
|
||||
document.getElementById("add"+i).checked=check;
|
||||
document.getElementById("delete"+i).checked=check;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
for(i=0;i<=num-1;i++)
|
||||
{
|
||||
if(document.getElementById("pomread"+i).value==" checked")document.getElementById("read"+i).checked=true;
|
||||
else document.getElementById("read"+i).checked=false;
|
||||
|
||||
if(document.getElementById("pomwrite"+i).value==" checked")document.getElementById("write"+i).checked=true;
|
||||
else document.getElementById("write"+i).checked=false;
|
||||
|
||||
if(document.getElementById("pomadd"+i).value==" checked")document.getElementById("add"+i).checked=true;
|
||||
else document.getElementById("add"+i).checked=false;
|
||||
|
||||
if(document.getElementById("pomdelete"+i).value==" checked")document.getElementById("delete"+i).checked=true;
|
||||
else document.getElementById("delete"+i).checked=false;
|
||||
}
|
||||
}
|
||||
}
|
||||
function check_row(i)
|
||||
{
|
||||
if(document.getElementById("all"+i).checked==false)
|
||||
{
|
||||
document.getElementById("read"+i).checked=true;
|
||||
document.getElementById("write"+i).checked=true;
|
||||
document.getElementById("add"+i).checked=true;
|
||||
document.getElementById("delete"+i).checked=true;
|
||||
|
||||
document.getElementById("pomread"+i).value=" checked";
|
||||
document.getElementById("pomwrite"+i).value=" checked";
|
||||
document.getElementById("pomadd"+i).value=" checked";
|
||||
document.getElementById("pomdelete"+i).value=" checked";
|
||||
}
|
||||
else
|
||||
{
|
||||
document.getElementById("read"+i).checked=false;
|
||||
document.getElementById("write"+i).checked=false;
|
||||
document.getElementById("add"+i).checked=false;
|
||||
document.getElementById("delete"+i).checked=false;
|
||||
|
||||
document.getElementById("pomread"+i).value="";
|
||||
document.getElementById("pomwrite"+i).value="";
|
||||
document.getElementById("pomadd"+i).value="";
|
||||
document.getElementById("pomdelete"+i).value="";
|
||||
}
|
||||
}
|
||||
function check_column(what,num,check)
|
||||
{
|
||||
var c;
|
||||
for(i=0;i<=num-1;i++)
|
||||
{
|
||||
if(document.getElementById(what+""+i))
|
||||
{
|
||||
document.getElementById(what+""+i).checked=check;
|
||||
if(check==true)c=" checked";
|
||||
else c="";
|
||||
document.getElementById("pom"+what+""+i).value=c;
|
||||
}
|
||||
}
|
||||
//document.getElementById(what+"c").checked=check;
|
||||
}
|
||||
</script>
|
||||
<?
|
||||
require_once('include/formbase.php');
|
||||
function list_dirs($dir,$dirs)
|
||||
{
|
||||
$dirs.=$dir."||";
|
||||
$z="select id from ecmdocuments where iddir='".$dir."'";
|
||||
$w=mysql_query($z);
|
||||
while($r=mysql_fetch_array($w))$dirs=list_dirs($r['id'],$dirs);
|
||||
return $dirs;
|
||||
}
|
||||
function set_permissions_down($i,$dir,$dirs)
|
||||
{
|
||||
$d=explode("||",$dirs);
|
||||
for($j=0;$j<=count($d)-2;$j++)
|
||||
{
|
||||
set_permissions($i,$d[$j],0);
|
||||
}
|
||||
}
|
||||
function set_permissions($i,$dir,$rest)
|
||||
{
|
||||
$z="select id from ecmdocuments_permissions where userid='".$_POST['userid'][$i]."' and iddir='".$dir."'";
|
||||
$w=mysql_query($z);
|
||||
$ile=mysql_num_rows($w);
|
||||
$r=mysql_fetch_array(mysql_query("select iddir from ecmdocuments where id='".$dir."'"));
|
||||
$idkat=$r['iddir'];
|
||||
if($ile==0)
|
||||
{
|
||||
if($rest)
|
||||
{
|
||||
$re=$_POST['read'][$i];
|
||||
$wr=0;
|
||||
$ad=0;
|
||||
$de=0;
|
||||
}
|
||||
else
|
||||
{
|
||||
$re=$_POST['read'][$i];
|
||||
$wr=$_POST['write'][$i];
|
||||
$ad=$_POST['add'][$i];
|
||||
$de=$_POST['delete'][$i];
|
||||
}
|
||||
$za="insert into ecmdocuments_permissions values('".create_guid()."','".$_POST['userid'][$i]."','".$dir."','".$re."','".$wr."','".$ad."','".$de."')";
|
||||
$wy=mysql_query($za);
|
||||
}
|
||||
else
|
||||
{
|
||||
if($rest)
|
||||
{
|
||||
$re=$_POST['read'][$i];
|
||||
$wr=0;
|
||||
$ad=0;
|
||||
$de=0;
|
||||
}
|
||||
else
|
||||
{
|
||||
$re=$_POST['read'][$i];
|
||||
$wr=$_POST['write'][$i];
|
||||
$ad=$_POST['add'][$i];
|
||||
$de=$_POST['delete'][$i];
|
||||
}
|
||||
if(!$re)$re=0;
|
||||
if(!$wr)$wr=0;
|
||||
$za="UPDATE ecmdocuments_permissions SET ecmdocuments_permissions.read='".$re."',ecmdocuments_permissions.write='".$wr."',ecmdocuments_permissions.add='".$ad."',ecmdocuments_permissions.delete='".$de."' WHERE ecmdocuments_permissions.userid='".$_POST['userid'][$i]."' AND ecmdocuments_permissions.iddir='".$dir."'";
|
||||
$wy=mysql_query($za) or die(mysql_error());
|
||||
}
|
||||
if($idkat && $rest)set_permissions($i,$idkat,$rest);
|
||||
}
|
||||
if($_POST['save'] || $_POST['save1'])
|
||||
{
|
||||
for($i=0;$i<=$_POST['numusers']-1;$i++)
|
||||
{
|
||||
if($_POST['selecttype']=="thisfolder")
|
||||
{
|
||||
set_permissions($i,$_GET['record'],1);
|
||||
set_permissions($i,$_GET['record'],0);
|
||||
}
|
||||
if($_POST['selecttype']=="subfolders")
|
||||
{
|
||||
$dirs=list_dirs($_GET['record'],"");
|
||||
//set_permissions($i,$_GET['record'],1);
|
||||
set_permissions_down($i,$_GET['record'],$dirs);
|
||||
}
|
||||
}
|
||||
ob_start();
|
||||
handleRedirect($_GET['record'],'EcmDocuments');
|
||||
}
|
||||
?>
|
||||
|
||||
<table width='100%' cellpadding='0' cellspacing='0' border='0' class='moduleTitle'><tr><td valign='top'>
|
||||
</td><td width='100%'><h2>Set Permissions:
|
||||
<?
|
||||
$z="select name from ecmdocuments where id='".$_GET['record']."'";
|
||||
$w=mysql_query($z);
|
||||
$r=mysql_fetch_array($w);
|
||||
print " ".$r['name'];
|
||||
?>
|
||||
</h2></td>
|
||||
</tr></table>
|
||||
<form name="EditView" method="POST" enctype="multipart/form-data" action="index.php?module=EcmDocuments&action=SetPermissions&record=<?print $_GET['record'];?>">
|
||||
<table cellpadding="0" cellspacing="0" border="0" width="100%">
|
||||
<tr>
|
||||
|
||||
|
||||
<td style="padding-bottom: 2px;">
|
||||
<input title="Save" class="button" type="submit" name="save" value="Save" >
|
||||
<select name="selecttype" onchange="check_all(<?print mysql_num_rows(mysql_query("select id from users where deleted='0' order by user_name asc"));?>,false,this.value);">
|
||||
<option value="thisfolder">This folder</option>
|
||||
<option value="subfolders">Subfolders</option>
|
||||
</select></td>
|
||||
</tr>
|
||||
</table>
|
||||
<p>
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="tabForm">
|
||||
<tr>
|
||||
<td class="dataLabel" ><strong>User name</strong></td>
|
||||
<td class="dataLabel" ><strong>read</strong></td>
|
||||
<td class="dataLabel" ><strong>write</strong></td>
|
||||
<td class="dataLabel" ><strong>add</strong></td>
|
||||
<td class="dataLabel" ><strong>delete</strong></td>
|
||||
<?
|
||||
$z="select user_name,id from users where deleted='0' order by user_name asc";
|
||||
$w=mysql_query($z);
|
||||
$i=0;
|
||||
while($r=mysql_fetch_array($w))
|
||||
{
|
||||
$z1="select * from ecmdocuments_permissions where iddir='".$_GET['record']."' and userid='".$r['id']."'";
|
||||
$w1=mysql_query($z1);
|
||||
$ile=mysql_num_rows($w1);
|
||||
if($ile==0)
|
||||
{
|
||||
$read=0;
|
||||
$write=0;
|
||||
$add=0;
|
||||
$delete=0;
|
||||
$readchecked="";
|
||||
$writechecked="";
|
||||
$addchecked="";
|
||||
$deletechecked="";
|
||||
}
|
||||
else
|
||||
{
|
||||
$r1=mysql_fetch_array($w1);
|
||||
$read=$r1['read'];
|
||||
$write=$r1['write'];
|
||||
$add=$r1['add'];
|
||||
$delete=$r1['delete'];
|
||||
if($read)$readchecked=" checked";
|
||||
else $readchecked="";
|
||||
if($write)$writechecked=" checked";
|
||||
else $writechecked="";
|
||||
if($add)$addchecked=" checked";
|
||||
else $addchecked="";
|
||||
if($delete)$deletechecked=" checked";
|
||||
else $deletechecked="";
|
||||
}
|
||||
print '
|
||||
<tr>
|
||||
<td class="dataLabel" >'.$r['user_name'].'</td>
|
||||
<td class="dataLabel" ><input type="hidden" name="pomread['.$i.']" id="pomread'.$i.'" value="'.$readchecked.'"><input type="checkbox" onclick="check_checkbox('.$i.',\'read\');" name="read['.$i.']" id="read'.$i.'" value="1"'.$readchecked.'></td>
|
||||
<td class="dataLabel" ><input type="hidden" name="pomwrite['.$i.']" id="pomwrite'.$i.'" value="'.$writechecked.'"><input type="checkbox" onclick="check_checkbox('.$i.',\'write\');" name="write['.$i.']" id="write'.$i.'" value="1"'.$writechecked.'></td>
|
||||
<td class="dataLabel" ><input type="hidden" name="pomadd['.$i.']" id="pomadd'.$i.'" value="'.$addchecked.'"><input type="checkbox" onclick="check_checkbox('.$i.',\'add\');" name="add['.$i.']" id="add'.$i.'" value="1"'.$addchecked.'></td>
|
||||
<td class="dataLabel" ><input type="hidden" name="pomdelete['.$i.']" id="pomdelete'.$i.'" value="'.$deletechecked.'"><input type="checkbox" onclick="check_checkbox('.$i.',\'delete\');" name="delete['.$i.']" id="delete'.$i.'" value="1"'.$deletechecked.'></td>
|
||||
<td class="dataLabel" ><input type="checkbox" name="all['.$i.']" id="all'.$i.'" value="1" onclick=\'check_row('.$i.');\' checked></td>
|
||||
<input type="hidden" name="userid['.$i.']" value="'.$r['id'].'"></tr>
|
||||
';
|
||||
$i++;
|
||||
}
|
||||
?>
|
||||
|
||||
<tr>
|
||||
<td class="dataLabel" ></td>
|
||||
<td class="dataLabel" ><input type="checkbox" name="readc" id="readc" value="1" onclick="if(this.checked==true)check_column('read','<?print $i;?>',false);else check_column('read','<?print $i;?>',true);" checked></td>
|
||||
<td class="dataLabel" ><input type="checkbox" name="writec" id="writec" value="1" onclick="if(this.checked==true)check_column('write','<?print $i;?>',false);else check_column('write','<?print $i;?>',true);" checked></td>
|
||||
<td class="dataLabel" ><input type="checkbox" name="addc" id="addc" value="1" onclick="if(this.checked==true)check_column('add','<?print $i;?>',false);else check_column('add','<?print $i;?>',true);" checked></td>
|
||||
<td class="dataLabel" ><input type="checkbox" name="deletec" id="deletec" value="1" onclick="if(this.checked==true)check_column('delete','<?print $i;?>',false);else check_column('delete','<?print $i;?>',true);" checked></td>
|
||||
</tr>
|
||||
</tr>
|
||||
</table>
|
||||
<input type="hidden" name="numusers" value="<?print $i;?>" />
|
||||
</p>
|
||||
<div style="padding-top: 2px">
|
||||
<input title="save" class="button" type="submit" name="save1" value="Save" >
|
||||
</div>
|
||||
</form>
|
||||
<!-- END: main -->
|
||||
130
modules/EcmDocuments/SubPanelView.php
Executable file
130
modules/EcmDocuments/SubPanelView.php
Executable 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, 'EcmDocuments');
|
||||
$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' => 'ecmdocument_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='EcmDocuments'>\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(\"EcmDocuments\", 600, 400, \"\", false, true, {$encoded_popup_request_data});'>\n";
|
||||
$button .= "</form>\n";
|
||||
|
||||
$ListView = new ListView();
|
||||
$ListView->initNewXTemplate( 'modules/EcmDocuments/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 = " <a href='index.php?action=index&module=DynamicLayout&from_action=SubPanelView&from_module=EcmDocuments&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", "ECMDOCUMENT");
|
||||
?>
|
||||
23
modules/EcmDocuments/autosearchajax.php
Executable file
23
modules/EcmDocuments/autosearchajax.php
Executable file
@@ -0,0 +1,23 @@
|
||||
<table width="200" border="0" cellpadding="1" cellspacing="1" bordercolor="#999999" bgcolor="#999999">
|
||||
<tr>
|
||||
<td style="padding:3px" width="98" bgcolor="#EEEEEE"><?
|
||||
include("../../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']);
|
||||
mysql_query("set names latin2");
|
||||
mysql_query("set charaecterset latin2");
|
||||
|
||||
$z="select ".$_GET['field'].",".$_GET['id']." from ".$_GET['what']." where ".$_GET['field']." like '".$_GET['fieldname']."%' and deleted='0'";
|
||||
$w=mysql_query($z);
|
||||
while($r=mysql_fetch_array($w))
|
||||
{
|
||||
$field=$_GET['field'];
|
||||
$fieldid=$_GET['id'];
|
||||
print "<strong><a href=\"javascript:inserttoinput('".iconv("ISO-8859-2","UTF-8",$r[$field])."','".$_GET['to_field']."','".$r[$fieldid]."','".$_GET['to_id']."','".$_GET['div']."');\">".iconv("ISO-8859-2","UTF-8",$r[$field])."</a></strong><br>";
|
||||
}
|
||||
mysql_close($sql);
|
||||
|
||||
?></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
102
modules/EcmDocuments/build.php
Executable file
102
modules/EcmDocuments/build.php
Executable file
@@ -0,0 +1,102 @@
|
||||
<?
|
||||
error_reporting(E_ALL);
|
||||
$sql=mysql_connect("localhost","root","");
|
||||
mysql_select_db("sugar45");
|
||||
function create_guid()
|
||||
{
|
||||
$microTime = microtime();
|
||||
list($a_dec, $a_sec) = explode(" ", $microTime);
|
||||
|
||||
$dec_hex = sprintf("%x", $a_dec* 1000000);
|
||||
$sec_hex = sprintf("%x", $a_sec);
|
||||
|
||||
ensure_length($dec_hex, 5);
|
||||
ensure_length($sec_hex, 6);
|
||||
|
||||
$guid = "";
|
||||
$guid .= $dec_hex;
|
||||
$guid .= create_guid_section(3);
|
||||
$guid .= '-';
|
||||
$guid .= create_guid_section(4);
|
||||
$guid .= '-';
|
||||
$guid .= create_guid_section(4);
|
||||
$guid .= '-';
|
||||
$guid .= create_guid_section(4);
|
||||
$guid .= '-';
|
||||
$guid .= $sec_hex;
|
||||
$guid .= create_guid_section(6);
|
||||
|
||||
return $guid;
|
||||
|
||||
}
|
||||
|
||||
function create_guid_section($characters)
|
||||
{
|
||||
$return = "";
|
||||
for($i=0; $i<$characters; $i++)
|
||||
{
|
||||
$return .= sprintf("%x", mt_rand(0,15));
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
||||
function ensure_length(&$string, $length)
|
||||
{
|
||||
$strlen = strlen($string);
|
||||
if($strlen < $length)
|
||||
{
|
||||
$string = str_pad($string,$length,"0");
|
||||
}
|
||||
else if($strlen > $length)
|
||||
{
|
||||
$string = substr($string, 0, $length);
|
||||
}
|
||||
}
|
||||
|
||||
function build_tree($katalog,$id)
|
||||
{
|
||||
if($dir=opendir($katalog))
|
||||
{
|
||||
while($file=readdir($dir))
|
||||
{
|
||||
|
||||
if($file!="." && $file!="..")
|
||||
{
|
||||
$name=explode(".",$file);
|
||||
$no=$name[0];
|
||||
$nn="";
|
||||
for($i=1;$i<=count($name)-1;$i++)
|
||||
{
|
||||
if($i>1)$nn.=".";
|
||||
$nn.=$name[$i];
|
||||
}
|
||||
$guid=create_guid();
|
||||
print "id: ".$guid.", iddir: ".$id." = ";
|
||||
$z="insert into ecmdocuments(id,date_entered,date_modified,assigned_user_id,modified_user_id,iddir,name,isdir,no,deleted) values('".$guid."','".date("Y-m-d H:m:s")."','".date("Y-m-d H:m:s")."',1,1,'".$id."','".$nn."','1','".$no."','0')";
|
||||
if(is_dir($katalog."/".$file))
|
||||
if(mysql_query($z))print "ok<br>";
|
||||
else print "no<br>";
|
||||
$katalogtemp=$katalog;
|
||||
$katalog.="/".$file;
|
||||
if(is_dir($katalog))build_tree($katalog,$guid);
|
||||
$katalog=$katalogtemp;
|
||||
}
|
||||
}
|
||||
closedir($dir);
|
||||
}
|
||||
}
|
||||
function build_dirs_strukture($katalog,$id)
|
||||
{
|
||||
$z="select * from ecmdocuments where iddir='".$id."'";
|
||||
$w=mysql_query($z);
|
||||
while($r=mysql_fetch_array($w))
|
||||
{
|
||||
mkdir($katalog."/".$r['no'].".".$r['name'],7777);
|
||||
build_dirs_strukture($katalog."/".$r['no'].".".$r['name'],$r['id']);
|
||||
}
|
||||
}
|
||||
mysql_query("truncate table ecmdocuments");
|
||||
if($_GET['mode']=="build_dirs")build_dirs_strukture("d:/users/sugar45/modules/EcmDocuments/root",0);
|
||||
if($_GET['mode']=="build_data")build_tree("d:/users/sugar45/modules/EcmDocuments/root/",0);
|
||||
mysql_close($sql);
|
||||
?>
|
||||
12
modules/EcmDocuments/date_test.php
Executable file
12
modules/EcmDocuments/date_test.php
Executable file
@@ -0,0 +1,12 @@
|
||||
<?
|
||||
|
||||
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']);
|
||||
|
||||
$r=mysql_fetch_array(mysql_query("select time_start from calls where id='37051dbb-ce9b-06b8-37cc-4858c063cedf'"));
|
||||
|
||||
print $r['time_start'];
|
||||
|
||||
mysql_close($sql);
|
||||
?>
|
||||
914
modules/EcmDocuments/dirstree.php
Executable file
914
modules/EcmDocuments/dirstree.php
Executable file
@@ -0,0 +1,914 @@
|
||||
<style type="text/css">
|
||||
<!--
|
||||
.w { display: block; }
|
||||
.n { display: none; }
|
||||
|
||||
<!--
|
||||
a.unassigned:link {
|
||||
font-family: Geneva, Arial, Helvetica, sans-serif;
|
||||
font-size: 12px;
|
||||
color: #FF0000;
|
||||
}
|
||||
a.unassigned:visited {
|
||||
font-family: Geneva, Arial, Helvetica, sans-serif;
|
||||
font-size: 12px;
|
||||
color: #FF0000;
|
||||
}
|
||||
a.unassigned:active {
|
||||
font-family: Geneva, Arial, Helvetica, sans-serif;
|
||||
font-size: 12px;
|
||||
color: #FF0000;
|
||||
}
|
||||
a.unassigned:hover {
|
||||
font-family: Geneva, Arial, Helvetica, sans-serif;
|
||||
font-size: 12px;
|
||||
color: #FF0000;
|
||||
}
|
||||
|
||||
a.tree:link {
|
||||
font-family: Geneva, Arial, Helvetica, sans-serif;
|
||||
font-size: 11px;
|
||||
color: #000000;
|
||||
text-decoration: none;
|
||||
}
|
||||
a.tree:visited {
|
||||
font-family: Geneva, Arial, Helvetica, sans-serif;
|
||||
font-size: 11px;
|
||||
color: #000000;
|
||||
text-decoration: none;
|
||||
}
|
||||
a.tree:active {
|
||||
font-family: Geneva, Arial, Helvetica, sans-serif;
|
||||
font-size: 11px;
|
||||
color: #000000;
|
||||
text-decoration: none;
|
||||
}
|
||||
a.tree:hover {
|
||||
font-family: Geneva, Arial, Helvetica, sans-serif;
|
||||
font-size: 11px;
|
||||
color: #990000;
|
||||
text-decoration: underline;
|
||||
}
|
||||
a.tree_active:link {
|
||||
font-family: Geneva, Arial, Helvetica, sans-serif;
|
||||
font-size: 11px;
|
||||
color: #FFFFFF;
|
||||
text-decoration: none;
|
||||
background-color: #000099;
|
||||
}
|
||||
a.tree_active:visited {
|
||||
font-family: Geneva, Arial, Helvetica, sans-serif;
|
||||
font-size: 11px;
|
||||
color: #FFFFFF;
|
||||
text-decoration: none;
|
||||
background-color: #000099;
|
||||
}
|
||||
a.tree_active:active {
|
||||
font-family: Geneva, Arial, Helvetica, sans-serif;
|
||||
font-size: 11px;
|
||||
color: #FFFFFF;
|
||||
text-decoration: none;
|
||||
background-color: #000099;
|
||||
}
|
||||
a.tree_active:hover {
|
||||
font-family: Geneva, Arial, Helvetica, sans-serif;
|
||||
font-size: 11px;
|
||||
color: #FFFFFF;
|
||||
text-decoration: none;
|
||||
background-color: #000099;
|
||||
}
|
||||
.fade {
|
||||
filter: alpha(opacity=83);
|
||||
-moz-opacity: 0.83;
|
||||
opacity:0.83;
|
||||
}
|
||||
-->
|
||||
</style>
|
||||
<script type="text/javascript" language="javascript" src="modules/EcmDocuments/mintajax.js"></script>
|
||||
<script type="text/javascript" language="javascript">
|
||||
|
||||
function inserttoinput(field,to_field,id,to_id,div)
|
||||
{
|
||||
document.getElementById(to_field).value=field;
|
||||
document.getElementById(to_id).value=id;
|
||||
document.getElementById(div).style.display="none";
|
||||
}
|
||||
|
||||
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";
|
||||
}
|
||||
function showdiv(desc,id)
|
||||
{
|
||||
document.getElementById(id).style.display="inline";
|
||||
posy=findPosY(document.getElementById("link"+id))+15;
|
||||
posx=findPosX(document.getElementById("link"+id));
|
||||
moveDiv(document.getElementById(id),posy,posx);
|
||||
}
|
||||
function hidediv(desc,id)
|
||||
{
|
||||
document.getElementById(id).style.display="none";
|
||||
}
|
||||
|
||||
function mintajaxget(url,tag)
|
||||
{
|
||||
var req=mint.Request();
|
||||
req.OnLoading=function(){$(tag).innerHTML='<div style="text-align: center;"><img src="modules/EcmDocuments/loading.gif" border="0"></div>';}
|
||||
req.OnSuccess = function(){if($(tag).type=='text'){$(tag).value=this.responseText;}else{$(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='<div style="text-align: center;"><img src="modules/EcmDocuments/loading.gif" border="0"></div>';}
|
||||
req.SendForm(form);
|
||||
}
|
||||
function displayshowblock(id)
|
||||
{
|
||||
if(document.getElementById(id+"_input").value==1)
|
||||
{
|
||||
document.getElementById(id+"_image").src="themes/Sugar/images/advanced_search.gif";
|
||||
advAJAX.get
|
||||
(
|
||||
{
|
||||
url: "modules/EcmDocuments/showhide_panel.php?value=0&what="+id+"&record=<?print $_GET['record'];?>",
|
||||
onSuccess : function(obj){pom=0;}
|
||||
}
|
||||
);
|
||||
document.getElementById(id).className="n";
|
||||
pom=0;
|
||||
}
|
||||
if(document.getElementById(id+"_input").value==0)
|
||||
{
|
||||
document.getElementById(id+"_image").src="themes/Sugar/images/basic_search.gif";
|
||||
advAJAX.get
|
||||
(
|
||||
{
|
||||
url: "modules/EcmDocuments/showhide_panel.php?value=1&what="+id+"&record=<?print $_GET['record'];?>",
|
||||
onSuccess : function(obj){pom=1;}
|
||||
}
|
||||
);
|
||||
document.getElementById(id).className="w";
|
||||
pom=1;
|
||||
}
|
||||
document.getElementById(id+"_input").value=pom;
|
||||
}
|
||||
function show_block(id,op)
|
||||
{
|
||||
if(document.getElementById('inputpom'+id).value==0)
|
||||
{
|
||||
document.getElementById('blocktree'+id).className="w";
|
||||
document.getElementById('plusminus'+id).src="modules/EcmDocuments/images/minus.gif";
|
||||
document.getElementById('image'+id).src="modules/EcmDocuments/images/Folder-open.gif";
|
||||
pom=1;
|
||||
}
|
||||
if(document.getElementById('inputpom'+id).value==1)
|
||||
{
|
||||
document.getElementById('blocktree'+id).className="n";
|
||||
document.getElementById('plusminus'+id).src="modules/EcmDocuments/images/plus.gif";
|
||||
document.getElementById('image'+id).src="modules/EcmDocuments/images/Folder.gif";
|
||||
pom=0;
|
||||
}
|
||||
document.getElementById('inputpom'+id).value=pom;
|
||||
}
|
||||
function click_block(id,r)
|
||||
{
|
||||
document.getElementById('fade').style.display="block";
|
||||
document.getElementById('tree').className="fade";
|
||||
if(document.getElementById('inputpom'+id).value==0)
|
||||
{
|
||||
document.getElementById('blocktree'+id).className="w";
|
||||
document.getElementById('plusminus'+id).src="modules/EcmDocuments/images/minus.gif";
|
||||
document.getElementById('image'+id).src="modules/EcmDocuments/images/Folder-open.gif";
|
||||
document.getElementById('linktree'+id).className="tree_active";
|
||||
pom=1;
|
||||
}
|
||||
if(document.getElementById('inputpom'+id).value==1)
|
||||
{
|
||||
document.getElementById('blocktree'+id).className="n";
|
||||
document.getElementById('plusminus'+id).src="modules/EcmDocuments/images/plus.gif";
|
||||
document.getElementById('image'+id).src="modules/EcmDocuments/images/Folder.gif";
|
||||
document.getElementById('linktree'+id).className="tree";
|
||||
pom=0;
|
||||
}
|
||||
if(document.getElementById('blocktree'+r))document.getElementById('blocktree'+r).className="n";
|
||||
if(document.getElementById('plusminus'+r))document.getElementById('plusminus'+r).src="modules/EcmDocuments/images/plus.gif";
|
||||
if(document.getElementById('image'+r))document.getElementById('image'+r).src="modules/EcmDocuments/images/Folder.gif";
|
||||
if(document.getElementById('linktree'+r))document.getElementById('linktree'+r).className="tree";
|
||||
|
||||
document.getElementById('inputpom'+id).value=pom;
|
||||
}
|
||||
function cut_name(t,ile)
|
||||
{
|
||||
if(!ile)
|
||||
{
|
||||
ile=20;
|
||||
}
|
||||
var text="";
|
||||
var i;
|
||||
if(t.length>ile)
|
||||
{
|
||||
for(i=0;i<=ile-1;i++)
|
||||
{
|
||||
text+=t.charAt(i);
|
||||
}
|
||||
text=text+"...";
|
||||
}
|
||||
else
|
||||
{
|
||||
text=t;
|
||||
}
|
||||
document.write(text);
|
||||
}
|
||||
</script>
|
||||
|
||||
<div style="height:10px;width:300px;background:#ffffff;display:none;position:absolute; top:0; right:0;" id="opis"><table bgcolor="#cccccc" class="olBgClass" border="0" cellpadding="1" cellspacing="1" width="300"><tbody><tr><td><table class="olCgClass" border="0" cellpadding="2" cellspacing="0" width="100%"><tbody><tr><td class="olCgClass" width="100%"><div id="opis-title" class="olCapFontClass"></div></td><td align="right"><a href="javascript:hidedescription();" title="Click to Close" onClick="javascript:hidedescription();" class="olCloseFontClass"><img src="themes/Sugar/images/close_inline.gif" border="0"></a></td></tr></tbody></table><table class="olFgClass" border="0" cellpadding="2" cellspacing="0" width="100%"><tbody><tr><td class="olFgClass" valign="top" background="#ffffff"><div id="opis-desc" class="olFontClass"><br></div></td></tr></tbody></table></td></tr></tbody></table></div>
|
||||
</div>
|
||||
<?
|
||||
error_reporting(E_PARSE);
|
||||
function shortlinkdescription($name,$ile,$record,$description,$no,$module,$show=1,$name_to_ecm_related="")
|
||||
{
|
||||
$_SESSION['ecmdocuments_stamp']++;
|
||||
$description=str_replace("\n","",$description);
|
||||
$description=str_replace("\l","",$description);
|
||||
$description=str_replace("\r","",$description);
|
||||
$description=str_replace("'","·",$description);
|
||||
$description=str_replace('"',""",$description);
|
||||
$description=str_replace('
|
||||
',"",$description);
|
||||
$name_temp=$name;
|
||||
$name=str_replace('"','"',$name);
|
||||
$total=strlen($name);
|
||||
if($total>$ile)
|
||||
{
|
||||
for($i=0;$i<=$ile-1;$i++)$nn.=$name[$i];
|
||||
$nn.="...";
|
||||
}
|
||||
else $nn=$name;
|
||||
if($no)$nn=$no.".".$nn;
|
||||
if($no[0]=="[" &&
|
||||
$no[1]=="n" &&
|
||||
$no[2]=="u" &&
|
||||
$no[3]=="m" &&
|
||||
$no[4]=="]")
|
||||
{
|
||||
$nn="";
|
||||
for($i=5;$i<=strlen($no)-1;$i++)$nn.=$no[$i];
|
||||
|
||||
}
|
||||
if($name_to_ecm_related)
|
||||
{
|
||||
$minus=5;
|
||||
$name=$name_to_ecm_related;
|
||||
$nn="<img src='modules/EcmDocuments/images/Folder.gif' border=0 width=14 height=11> ";
|
||||
//$description=str_replace('"','',$description);
|
||||
//$description=str_replace("'","",$description);
|
||||
}
|
||||
$on="";
|
||||
if($show)
|
||||
{
|
||||
$on=' onmouseover="showdescription(\''.$module.$record.'\',\''.$name.'\',\''.$description.'\',\''.$minus.'\');"';
|
||||
$on.=' onmouseout="hidedescription();"';
|
||||
}
|
||||
else
|
||||
{
|
||||
if($total>=$ile)
|
||||
{
|
||||
$on=' onmouseover="showdescription(\''.$module.$record.'\',\''.$name.'\',\''.$description.'\',\''.$minus.'\');"';
|
||||
$on.=' onmouseout="hidedescription();"';
|
||||
}
|
||||
else $on='';
|
||||
}
|
||||
if($module=="EcmDocuments")$nn=$name_temp;
|
||||
return '<a'.$on.' id="link-'.$module.$record.'" href="index.php?module='.$module.'&action=DetailView&record='.$record.'&return_module=EcmDocuments&return_action=DetailView&return_id='.$record.'" class=\'listViewTdLinkS1\' >'.$nn.'</a>';
|
||||
}
|
||||
function print_title($tab)
|
||||
{
|
||||
$podz=explode("||",$tab);
|
||||
$i=0;
|
||||
foreach($podz as $p)
|
||||
{
|
||||
$z="select name,no from ecmdocuments where id='".$p."' and isdir='1'";
|
||||
$w=mysql_query($z);
|
||||
$r=mysql_fetch_array($w);
|
||||
$name=$r['name'];
|
||||
$nm[$i]=$r['no'].".".$name;
|
||||
$i++;
|
||||
}
|
||||
for($j=$i-3;$j>=0;$j--)$html.=$nm[$j]."/";
|
||||
$html=str_replace("//","/",$html);
|
||||
$html=str_replace("/"," / ",$html);
|
||||
return $html;
|
||||
}
|
||||
function check_block($id,$html)
|
||||
{
|
||||
$z="select iddir from ecmdocuments where id='".$id."'";
|
||||
$w=mysql_query($z);
|
||||
if(mysql_num_rows($w)>0)
|
||||
{
|
||||
$r=mysql_fetch_array($w);
|
||||
$iddir=$r['iddir'];
|
||||
$html.=$iddir."||";
|
||||
$html=check_block($iddir,$html);
|
||||
}
|
||||
return $html;
|
||||
}
|
||||
function check_open($id)
|
||||
{
|
||||
$podz=explode("||",check_block($_GET['record'],"").$_GET['record']);
|
||||
for($i=0;$i<=count($podz)-1;$i++)
|
||||
{
|
||||
if($id==$podz[$i])
|
||||
{
|
||||
return true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
function check_open_change($id)
|
||||
{
|
||||
$podz=explode("||",check_block($_GET['iddirs'],"").$_GET['iddirs']);
|
||||
for($i=0;$i<=count($podz)-1;$i++)
|
||||
{
|
||||
if($id==$podz[$i])
|
||||
{
|
||||
return true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
function check_is_admin($id)
|
||||
{
|
||||
$z="select is_admin from users where id='".$id."'";
|
||||
$r=mysql_fetch_array(mysql_query($z));
|
||||
$is=$r['is_admin'];
|
||||
return $is;
|
||||
}
|
||||
|
||||
function check_admin_permission($id)
|
||||
{
|
||||
$z="select treeread from users where id='".$id."'";
|
||||
$r=mysql_fetch_array(mysql_query($z));
|
||||
$read=$r['treeread'];
|
||||
if($read)return true;
|
||||
else return false;
|
||||
}
|
||||
function permission($user)
|
||||
{
|
||||
$w=mysql_query("select id from ecmdocuments");
|
||||
while($r=mysql_fetch_array($w))
|
||||
{
|
||||
$rr=mysql_fetch_array(mysql_query("select * from ecmdocuments_permissions where iddir='".$r['id']."' and userid='".$user."'"));
|
||||
$read=$rr['read'];
|
||||
if(check_is_admin($user) || $read || check_admin_permission($user))$html.='document.getElementById("all'.$r['id'].'").style.display="block";
|
||||
';
|
||||
}
|
||||
return $html;
|
||||
}
|
||||
function diropen($id)
|
||||
{
|
||||
$h=check_block($id,"");
|
||||
$p=explode("||",$h);
|
||||
foreach($p as $pp)
|
||||
{
|
||||
if($pp)
|
||||
{
|
||||
$html.='document.getElementById("all'.$pp.'").style.display="block";
|
||||
document.getElementById("blocktree'.$pp.'").style.display="block";
|
||||
';
|
||||
}
|
||||
}
|
||||
return $html;
|
||||
}
|
||||
function display_dir_data($id,$conn,$userid)
|
||||
{
|
||||
global $current_user;
|
||||
$_SESSION['ecm_iddir']=$id;
|
||||
$z="select id,iddir,name,no from ecmdocuments where iddir='".$id."' and isdir='1' order by no";
|
||||
if($conn)$w=mysql_query($z,$conn);
|
||||
else $w=mysql_query($z);
|
||||
$i=0;
|
||||
$r=mysql_fetch_array(mysql_query("select treeread from users where id='".$_SESSION['authenticated_user_id']."'"));
|
||||
$treeread=$r['treeread'];
|
||||
while($r=mysql_fetch_array($w))
|
||||
{
|
||||
$z1="select * from ecmdocuments_permissions where iddir='".$r['id']."' and userid='".$userid."'";
|
||||
$w1=mysql_query($z1);
|
||||
$r1=mysql_fetch_array($w1);
|
||||
$read=$r1['read'];
|
||||
if($read==1 || check_is_admin($_SESSION['authenticated_user_id']) || check_admin_permission($_SESSION['authenticated_user_id']) || $treeread)
|
||||
{
|
||||
$name=$r['name'];
|
||||
$id1=$r['id'];
|
||||
$podz=explode(".",$name);
|
||||
if(strlen($podz[0])==1)$name="00".$name;
|
||||
if(strlen($podz[0])==2)$name="0".$name;
|
||||
$dane[$i]['name']=$name;
|
||||
$dane[$i]['id']=$id1;
|
||||
$dane[$i]['orgname']=$r['name'];
|
||||
$dane[$i]['no']=$r['no'];
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
$ile=$i;
|
||||
|
||||
for($i=0;$i<=count($dane)-1;$i++)
|
||||
{
|
||||
if($_GET['record']==$dane[$i]['id'])$class="tree_active";
|
||||
else $class="tree";
|
||||
if(check_open($dane[$i]['id']))
|
||||
{
|
||||
$display="w";
|
||||
if(mysql_num_rows(mysql_query("select id from ecmdocuments where iddir='".$dane[$i]['id']."'"))>0)
|
||||
{
|
||||
$plusminus="modules/EcmDocuments/images/minus.gif";
|
||||
$plusminus="<img id='plusminus".$dane[$i]['id']."' src='".$plusminus."' border='0'>";
|
||||
}
|
||||
else $plusminus="<div id='plusminus".$dane[$i]['id']."'> </div>";
|
||||
$image="modules/EcmDocuments/images/Folder-open.gif";
|
||||
$op=1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$display="n";
|
||||
if(mysql_num_rows(mysql_query("select id from ecmdocuments where iddir='".$dane[$i]['id']."'"))>0)
|
||||
{
|
||||
$plusminus="modules/EcmDocuments/images/plus.gif";
|
||||
$plusminus="<img id='plusminus".$dane[$i]['id']."' src='".$plusminus."' border='0'>";
|
||||
}
|
||||
else $plusminus="<div id='plusminus".$dane[$i]['id']."'> </div>";
|
||||
$image="modules/EcmDocuments/images/Folder.gif";
|
||||
$op=0;
|
||||
}
|
||||
$margin=17;
|
||||
if($dane[$i]['no']<10)$nod=0;
|
||||
else $nod="";
|
||||
$html.="<table cellspacing='0' cellpadding='0' border='0'>
|
||||
<tr valign='top'>
|
||||
<td width='10' style='width:10px;'>
|
||||
<input type='hidden' id='inputpom".$dane[$i]['id']."' value='".$op."'>
|
||||
<a style='cursor:pointer;' onclick='mintajaxget(\"showtree.php?iddir=".$dane[$i]['id']."\",\"blocktree".$dane[$i]['id']."\");show_block(\"".$dane[$i]['id']."\",\"blocktree".$dane[$i]['id']."\");'>
|
||||
".$plusminus."
|
||||
</a>
|
||||
</td>
|
||||
<td width='10' style='width:10px;'>
|
||||
<a style='cursor:pointer;' href='index.php?module=EcmDocuments&action=DetailView&record=".$dane[$i]['id']."'>
|
||||
<img id='image".$dane[$i]['id']."' src='".$image."' border='0'>
|
||||
</a>
|
||||
</td>
|
||||
<td width='999'>
|
||||
<a name='linktree".$dane[$i]['id']."' onclick='click_block(\"".$dane[$i]['id']."\",\"".$_REQUEST['record']."\");' id='linktree".$dane[$i]['id']."' class='".$class."' href='index.php?module=EcmDocuments&action=DetailView&record=".$dane[$i]['id']."'>".$nod.$dane[$i]['no'].".".$dane[$i]['orgname']."</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan='3'><div class='w' id='blocktree".$dane[$i]['id']."' style='margin-left:".$margin."px;'>";
|
||||
if(check_open($dane[$i]['id']))$html.=display_dir_data($dane[$i]['id'],"",$userid);
|
||||
$html.="</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
";
|
||||
}
|
||||
return $html;
|
||||
}
|
||||
function assign_user_to_dir($idu,$iddir)
|
||||
{
|
||||
$z="select assigned_user_id,id,iddir from ecmdocuments where iddir='".$iddir."'";
|
||||
$w=mysql_query($z);
|
||||
while($r=mysql_fetch_array($w))
|
||||
{
|
||||
$za="update ecmdocuments set assigned_user_id='".$idu."' where id='".$r['id']."'";
|
||||
mysql_query($za);
|
||||
assign_user_to_dir($idu,$r['id']);
|
||||
}
|
||||
}
|
||||
function copyrelationschips($from,$to,$what,$id)
|
||||
{
|
||||
$z="select * from ".$what." where ecmdocument_id='".$from."'";
|
||||
$w=mysql_query($z);
|
||||
print $z;
|
||||
while($r=mysql_fetch_array($w))
|
||||
{
|
||||
$z1="insert into ".$what." values('".create_guid()."','".$to."','".$r[$id]."','".$r['date_modified']."','0')";
|
||||
print $z1;
|
||||
mysql_query($z1);
|
||||
}
|
||||
}
|
||||
function clonepermissions($source,$destination)
|
||||
{
|
||||
$z="select * from ecmdocuments_permissions where iddir='".$source."'";
|
||||
$w=mysql_query($z);
|
||||
while($r=mysql_fetch_array($w))mysql_query("insert into ecmdocuments_permissions values('','".$r['userid']."','".$destination."','".$r['read']."','".$r['write']."','".$r['add']."','".$r['delete']."')");
|
||||
}
|
||||
function clone_dir($katalog,$gdzie)
|
||||
{
|
||||
$z="select * from ecmdocuments where iddir='".$katalog."' order by name";
|
||||
$w=mysql_query($z);
|
||||
while($r=mysql_fetch_array($w))
|
||||
{
|
||||
$name=$r['name'];
|
||||
|
||||
$idx=create_guid();
|
||||
$z1="insert into ecmdocuments(
|
||||
id,
|
||||
name,
|
||||
isdir,
|
||||
assigned_user_id,
|
||||
modified_user_id,
|
||||
date_entered,
|
||||
date_modified,
|
||||
created_by,
|
||||
description,
|
||||
iddir,
|
||||
cloning,
|
||||
shortcut,
|
||||
show_details,
|
||||
show_upload,
|
||||
no
|
||||
)
|
||||
values(
|
||||
'".$idx."',
|
||||
'".$name."',
|
||||
'1',
|
||||
'".$r['assigned_user_id']."',
|
||||
'".$r['modified_user_id']."',
|
||||
'".date("Y-m-d H:m:s")."',
|
||||
'".date("Y-m-d H:m:s")."',
|
||||
'".$r['created_by']."',
|
||||
'".$r['description']."',
|
||||
'".$gdzie."',
|
||||
'".$r['cloning']."',
|
||||
'".$r['shortcut']."',
|
||||
'".$r['show_details']."',
|
||||
'".$r['show_upload']."',
|
||||
'".$r['no']."'
|
||||
)";
|
||||
mysql_query($z1);
|
||||
clonepermissions($r['id'],$idx);
|
||||
copyrelationschips($r['id'],$idx,"ecmdocuments_accounts","account_id");
|
||||
copyrelationschips($r['id'],$idx,"ecmdocuments_contacts","contact_id");
|
||||
copyrelationschips($r['id'],$idx,"ecmdocuments_quotes","quote_id");
|
||||
copyrelationschips($r['id'],$idx,"ecmdocuments_notes","note_id");
|
||||
copyrelationschips($r['id'],$idx,"ecmdocuments_calls","call_id");
|
||||
copyrelationschips($r['id'],$idx,"ecmdocuments_meetings","meeting_id");
|
||||
copyrelationschips($r['id'],$idx,"ecmdocuments_tasks","task_id");
|
||||
copyrelationschips($r['id'],$idx,"ecmdocuments_contracts","contract_id");
|
||||
copyrelationschips($r['id'],$idx,"ecmdocuments_correspondences","correspondence_id");
|
||||
clone_dir($r['id'],$idx);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
function getnextdirnumber($id)
|
||||
{
|
||||
$z="select no from ecmdocuments where iddir='".$id."' order by no desc limit 1";
|
||||
$w=mysql_query($z);
|
||||
$r=mysql_fetch_array($w);
|
||||
$no=$r['no'];
|
||||
(int)$no;
|
||||
$no++;
|
||||
return $no;
|
||||
}
|
||||
function reorganizedir($id)
|
||||
{
|
||||
$z="select no,id from ecmdocuments where iddir='".$id."' order by no asc";
|
||||
$w=mysql_query($z);
|
||||
$i=1;
|
||||
while($r=mysql_fetch_array($w))
|
||||
{
|
||||
if(mysql_query("update ecmdocuments set no='".$i."' where id='".$r['id']."'"))$i++;
|
||||
}
|
||||
}
|
||||
function delete_recursive($id)
|
||||
{
|
||||
mysql_query("delete from ecmdocuments where id='".$id."'");
|
||||
if($id!=0)
|
||||
{
|
||||
$z="select id from ecmdocuments where iddir='".$id."'";
|
||||
$w=mysql_query($z);
|
||||
while($r=mysql_fetch_array($w))delete_recursive($r['id']);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
function createdir($iddir,$name,$no)
|
||||
{
|
||||
$ids=ceate_guid();
|
||||
$z="insert into ecmdocuments(id,name,date_entered,date_modified,modified_user_id,assigned_user_id,created_by,iddir,isdir,no)
|
||||
values('".$ids."','".$name."','".date("Y-m-d H:m:s")."','".date("Y-m-d H:m:s")."','".$current_user->id."','".$current_user->id."','".$current_user->id."','".$iddir."','1','".$no."')";
|
||||
$w=mysql_query($z);
|
||||
return $ids;
|
||||
}
|
||||
function movedir($id,$newiddir,$name,$no)
|
||||
{
|
||||
if($name)$n=",name='".$name."'";
|
||||
else $n="";
|
||||
if($no)$nn=",no='".$no."'";
|
||||
else $nn="";
|
||||
$z="update ecmdocuments set iddir='".$newiddir."'".$n.$nn." where id='".$id."'";
|
||||
if(mysql_query($z))return true;
|
||||
else return false;
|
||||
}
|
||||
function getmaxdirel($iddir)
|
||||
{
|
||||
$tabsr=array('ecmdocs','ecmcontracts','ecmcorrespondenceins','ecmcorrespondenceouts','ecminvoiceins','ecminvoiceouts');
|
||||
$last=0;
|
||||
foreach($tabsr as $tabsre)
|
||||
{
|
||||
$z="select no from ecmdocuments_".$tabsre." where ecmdocument_id='".$iddir."' and deleted='0' order by no asc";
|
||||
$w=mysql_query($z);
|
||||
while($r=mysql_fetch_array($w))
|
||||
{
|
||||
$num[(int)$r['no']]=(int)$r['no'];
|
||||
if((int)$r['no']>$last)$last=(int)$r['no'];
|
||||
}
|
||||
}
|
||||
$ok=0;
|
||||
for($i=0;$i<=$last;$i++)
|
||||
{
|
||||
if(!isset($num[$i]))
|
||||
{
|
||||
$n=$i;
|
||||
$ok=1;
|
||||
}
|
||||
}
|
||||
if($ok==0)$n=$last+1;
|
||||
return $n;
|
||||
}
|
||||
function updateno($what,$iddir)
|
||||
{
|
||||
$z="select id,ecmdocument_id from ".$what." where no='0' and ecmdocument_id='".$iddir."' and deleted='0'";
|
||||
$w=mysql_query($z);
|
||||
while($r=mysql_fetch_array($w))
|
||||
{
|
||||
$id=$r['id'];
|
||||
$z="update ".$what." set no='".getmaxdirel($iddir)."' where id='".$id."'";
|
||||
mysql_query($z);
|
||||
}
|
||||
}
|
||||
/*
|
||||
function updaterelation($what,$whatid,$iddir,$table)
|
||||
{
|
||||
$zz="update ".$table." set relation='0'";
|
||||
mysql_query($zz);
|
||||
$z="select ".$whatid." as id from ".$what." where ecmdocument_id='".$iddir."' and deleted='0'";
|
||||
$w=mysql_query($z);
|
||||
while($r=mysql_fetch_array($w))
|
||||
{
|
||||
$zz="update ".$table." set relation='1' where id='".$r['id']."'";
|
||||
mysql_query($zz);
|
||||
}
|
||||
|
||||
}
|
||||
*/
|
||||
function deleterelations($id,$relation,$relation_id)
|
||||
{
|
||||
if(mysql_query("update ".$relation." set deleted=1 where ".$relation_id."='".$id."'"))print "ok<br>";
|
||||
else print "no<br>";
|
||||
}
|
||||
function display_dir_data_change_ecm($id,$conn,$userid)
|
||||
{
|
||||
global $current_user;
|
||||
$_SESSION['change_ecm_iddir']=$id;
|
||||
$_SESSION['change_ecm_k']="#linktree".$id;
|
||||
$z="select id,iddir,name,no from ecmdocuments where iddir='".$id."' and isdir='1' order by no";
|
||||
if($conn)$w=mysql_query($z,$conn);
|
||||
else $w=mysql_query($z);
|
||||
$i=0;
|
||||
while($r=mysql_fetch_array($w))
|
||||
{
|
||||
$z1="select * from ecmdocuments_permissions where iddir='".$r['id']."' and userid='".$_SESSION['authenticated_user_id']."'";
|
||||
$w1=mysql_query($z1);
|
||||
$r1=mysql_fetch_array($w1);
|
||||
$read=$r1['read'];
|
||||
if($read==1 || check_is_admin($_SESSION['authenticated_user_id']) || check_admin_permission($_SESSION['authenticated_user_id']))
|
||||
{
|
||||
$name=$r['name'];
|
||||
$id1=$r['id'];
|
||||
$podz=explode(".",$name);
|
||||
if(strlen($podz[0])==1)$name="00".$name;
|
||||
if(strlen($podz[0])==2)$name="0".$name;
|
||||
$dane[$i]['name']=$name;
|
||||
$dane[$i]['id']=$id1;
|
||||
$dane[$i]['orgname']=$r['name'];
|
||||
$dane[$i]['no']=$r['no'];
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
$ile=$i;
|
||||
|
||||
for($i=0;$i<=count($dane)-1;$i++)
|
||||
{
|
||||
if($_GET['iddirs']==$dane[$i]['id'])$class="tree_active";
|
||||
else $class="tree";
|
||||
if(check_open_change($dane[$i]['id']))
|
||||
{
|
||||
$display="w";
|
||||
if(mysql_num_rows(mysql_query("select id from ecmdocuments where iddir='".$dane[$i]['id']."'"))>0)
|
||||
{
|
||||
$plusminus="modules/EcmDocuments/images/minus.gif";
|
||||
$plusminus="<img id='plusminus".$dane[$i]['id']."' src='".$plusminus."' border='0'>";
|
||||
}
|
||||
else $plusminus="</a><div id='plusminus".$dane[$i]['id']."' style='width:15px;'></div><a>";
|
||||
$image="modules/EcmDocuments/images/Folder-open.gif";
|
||||
$op=1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$display="n";
|
||||
if(mysql_num_rows(mysql_query("select id from ecmdocuments where iddir='".$dane[$i]['id']."'"))>0)
|
||||
{
|
||||
$plusminus="modules/EcmDocuments/images/plus.gif";
|
||||
$plusminus="<img id='plusminus".$dane[$i]['id']."' src='".$plusminus."' border='0'>";
|
||||
}
|
||||
else $plusminus="</a><div id='plusminus".$dane[$i]['id']."' style='width:15px;'></div><a>";
|
||||
$image="modules/EcmDocuments/images/Folder.gif";
|
||||
$op=0;
|
||||
}
|
||||
$margin=17;
|
||||
if($dane[$i]['no']<10)$nod=0;
|
||||
else $nod="";
|
||||
$html.="<table cellspacing='0' cellpadding='0' border='0'>
|
||||
<tr valign='top'>
|
||||
<td width='10'>
|
||||
<input type='hidden' id='inputpom".$dane[$i]['id']."' value='".$op."'>
|
||||
<a style='cursor:pointer;' href='javascript:mintajaxget(\"showtree_change_ecm.php?iddir=".$dane[$i]['id']."&record=".$_REQUEST['record']."&ecmdocument_id=".$_REQUEST['ecmdocument_id']."&relation=".$_REQUEST['relation']."&idrelation=".$_REQUEST['idrelation']."\",\"blocktree".$dane[$i]['id']."\");show_block(\"".$dane[$i]['id']."\",\"blocktree".$dane[$i]['id']."\");'>
|
||||
".$plusminus."
|
||||
</a>
|
||||
</td>
|
||||
<td width='10'>
|
||||
<a style='cursor:pointer;' href='javascript:mintajaxget(\"showtree_change_ecm.php?iddir=".$dane[$i]['id']."&record=".$_REQUEST['record']."&ecmdocument_id=".$_REQUEST['ecmdocument_id']."&relation=".$_REQUEST['relation']."&idrelation=".$_REQUEST['idrelation']."\",\"blocktree".$dane[$i]['id']."\");show_block(\"".$dane[$i]['id']."\",\"blocktree".$dane[$i]['id']."\");'>
|
||||
<img id='image".$dane[$i]['id']."' src='".$image."' border='0'>
|
||||
</a>
|
||||
</td>
|
||||
<td width='363'><a name='linktree".$dane[$i]['id']."' class='".$class."' href='change_ecm.php?iddir=".$dane[$i]['id']."&record=".$_REQUEST['record']."&ecmdocument_id=".$_REQUEST['ecmdocument_id']."&relation=".$_REQUEST['relation']."&idrelation=".$_REQUEST['idrelation']."'>".$nod.$dane[$i]['no'].".".$dane[$i]['orgname']."</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan='3'><div class='w' id='blocktree".$dane[$i]['id']."' style='margin-left:".$margin."px;'>";
|
||||
if(check_open_change($dane[$i]['id']))$html.=display_dir_data_change_ecm($dane[$i]['id'],"",$userid);
|
||||
$html.="</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
";
|
||||
}
|
||||
return $html;
|
||||
}
|
||||
function move_relations($relation,$relation_to,$relation_id,$relation_to_id,$id,$to_id,$no=0)
|
||||
{
|
||||
$z="select * from ".$relation." where ".$relation_id."='".$id."'";
|
||||
$w=mysql_query($z);
|
||||
while($r=mysql_fetch_array($w))
|
||||
{
|
||||
$no_field="";
|
||||
$no_value="";
|
||||
if($no)
|
||||
{
|
||||
$no_field=",no";
|
||||
$no_value=",'".$r['no']."'";
|
||||
}
|
||||
mysql_query("insert into ".$relation_to."(id,ecmdocument_id,".$relation_to_id.",deleted".$no_field.") values('".create_guid()."','".$r['ecmdocument_id']."','".$to_id."','".$r['deleted']."'".$no_value.")");
|
||||
}
|
||||
}
|
||||
function duplicate_relations($relation,$relation_id,$old_id,$new_id)
|
||||
{
|
||||
$z="select * from ".$relation." where ".$relation_id."='".$old_id."'";
|
||||
$w=mysql_query($z);
|
||||
while($r=mysql_fetch_array($w))
|
||||
{
|
||||
mysql_query("insert into ".$relation."(id,ecmdocument_id,".$relation_id.",deleted) values('".create_guid()."','".$r['ecmdocument_id']."','".$new_id."','".$r['deleted']."')");
|
||||
}
|
||||
}
|
||||
function set_permissions_for_subfolders($id,$user,$read,$write,$add,$delete)
|
||||
{
|
||||
}
|
||||
function mailashtml($email,$skrot,$message,$odKogo)
|
||||
{
|
||||
$naglowki=
|
||||
"From: ".$odKogo."\n"
|
||||
. "Reply-To: ".$odKogo."\n"
|
||||
. "Content-Type: text/html; charset=utf-8; format=flowed\n"
|
||||
. "MIME-Version: 1.0\n"
|
||||
. "Content-Transfer-Encoding: 8bit\n"
|
||||
. "X-Mailer: PHP\n";
|
||||
|
||||
$ret=mail($email,$skrot,$message,$naglowki);
|
||||
|
||||
return $ret;
|
||||
}
|
||||
|
||||
|
||||
function display_dir_data_email($id,$conn,$userid,$target,$tab)
|
||||
{
|
||||
global $current_user;
|
||||
$_SESSION['email_iddir']=$id;
|
||||
$z="select id,iddir,name,no from ecmdocuments where iddir='".$id."' and isdir='1' order by no";
|
||||
if($conn)$w=mysql_query($z,$conn);
|
||||
else $w=mysql_query($z);
|
||||
$i=0;
|
||||
$r=mysql_fetch_array(mysql_query("select treeread from users where id='".$_SESSION['authenticated_user_id']."'"));
|
||||
$treeread=$r['treeread'];
|
||||
while($r=mysql_fetch_array($w))
|
||||
{
|
||||
$z1="select * from ecmdocuments_permissions where iddir='".$r['id']."' and userid='".$userid."'";
|
||||
$w1=mysql_query($z1);
|
||||
$r1=mysql_fetch_array($w1);
|
||||
$read=$r1['read'];
|
||||
if($read==1 || check_is_admin($_SESSION['authenticated_user_id']) || check_admin_permission($_SESSION['authenticated_user_id']) || $treeread)
|
||||
{
|
||||
$name=$r['name'];
|
||||
$id1=$r['id'];
|
||||
$podz=explode(".",$name);
|
||||
if(strlen($podz[0])==1)$name="00".$name;
|
||||
if(strlen($podz[0])==2)$name="0".$name;
|
||||
$dane[$i]['name']=$name;
|
||||
$dane[$i]['id']=$id1;
|
||||
$dane[$i]['orgname']=$r['name'];
|
||||
$dane[$i]['no']=$r['no'];
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
$ile=$i;
|
||||
|
||||
for($i=0;$i<=count($dane)-1;$i++)
|
||||
{
|
||||
if($_GET['iddirs']==$dane[$i]['id'])$class="tree_active";
|
||||
else $class="tree";
|
||||
if(check_open_change($dane[$i]['id']))
|
||||
{
|
||||
$display="w";
|
||||
if(mysql_num_rows(mysql_query("select id from ecmdocuments where iddir='".$dane[$i]['id']."'"))>0)
|
||||
{
|
||||
$plusminus="modules/EcmDocuments/images/minus.gif";
|
||||
$plusminus="<img id='plusminus".$dane[$i]['id']."' src='".$plusminus."' border='0'>";
|
||||
}
|
||||
else $plusminus="<div id='plusminus".$dane[$i]['id']."'> </div>";
|
||||
$image="images/Folder-open.gif";
|
||||
$op=1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$display="n";
|
||||
if(mysql_num_rows(mysql_query("select id from ecmdocuments where iddir='".$dane[$i]['id']."'"))>0)
|
||||
{
|
||||
$plusminus="modules/EcmDocuments/images/plus.gif";
|
||||
$plusminus="<img id='plusminus".$dane[$i]['id']."' src='".$plusminus."' border='0'>";
|
||||
}
|
||||
else $plusminus="<div id='plusminus".$dane[$i]['id']."'> </div>";
|
||||
$image="images/Folder.gif";
|
||||
$op=0;
|
||||
}
|
||||
$margin=17;
|
||||
if($dane[$i]['no']<10)$nod=0;
|
||||
else $nod="";
|
||||
$html.="<table cellspacing='0' cellpadding='0' border='0' width='100%'>
|
||||
<tr valign='top'>
|
||||
<td width='10'>
|
||||
<input type='hidden' id='inputpom".$dane[$i]['id']."' value='".$op."'>
|
||||
<a style='cursor:pointer;' onclick='mintajaxget(\"showtree_email.php?iddir=".$dane[$i]['id']."\",\"blocktree".$dane[$i]['id']."\");show_block(\"".$dane[$i]['id']."\",\"blocktree".$dane[$i]['id']."\");'>
|
||||
".$plusminus."
|
||||
</a>
|
||||
</td>
|
||||
<td width='10'>
|
||||
<a style='cursor:pointer;' onclick='mintajaxget(\"showtree_email.php?iddir=".$dane[$i]['id']."\",\"blocktree".$dane[$i]['id']."\");show_block(\"".$dane[$i]['id']."\",\"blocktree".$dane[$i]['id']."\");'>
|
||||
<img id='image".$dane[$i]['id']."' src='".$image."' border='0'>
|
||||
</a>
|
||||
</td>
|
||||
<td width='163'>
|
||||
<a name='linktree".$dane[$i]['id']."' onclick='click_block(\"".$dane[$i]['id']."\");' id='linktree".$dane[$i]['id']."' class='".$class."' href='SelectFile.php?target=".$target."&tab=".$tab."&record=".$dane[$i]['id']."#linktree".$dane[$i]['id']."'>".$nod.$dane[$i]['no'].".".$dane[$i]['orgname']."</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan='3'><div class='w' id='blocktree".$dane[$i]['id']."' style='margin-left:".$margin."px;'>";
|
||||
if(check_open_change($dane[$i]['id']))$html.=display_dir_data_email($dane[$i]['id'],"",$userid,$target,$tab);
|
||||
$html.="</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
";
|
||||
}
|
||||
return $html;
|
||||
}
|
||||
|
||||
$aktualdir="/var/www/html/e5crm/html/test/modules/EcmDocuments/root".str_replace(" / ","/",print_title($_GET['record']."||".check_block($_GET['record'],"")));
|
||||
$z1="select id from ecmdocuments";
|
||||
$w1=mysql_query($z1);
|
||||
$il=mysql_num_rows($w1);
|
||||
$projinprogressdir=mysql_fetch_array(mysql_query("select id from ecmdocuments where projects_in_progress_dir='1'"));
|
||||
$projectsinprogressdir=$projinprogressdir['id'];
|
||||
$projdir=mysql_fetch_array(mysql_query("select id from ecmdocuments where projects_dir='1'"));
|
||||
$projectsdir=$projdir['id'];
|
||||
?>
|
||||
|
||||
|
||||
82
modules/EcmDocuments/ecmhistory.php
Executable file
82
modules/EcmDocuments/ecmhistory.php
Executable file
@@ -0,0 +1,82 @@
|
||||
<?
|
||||
|
||||
function create_guid1()
|
||||
{
|
||||
$microTime = microtime();
|
||||
list($a_dec, $a_sec) = explode(" ", $microTime);
|
||||
|
||||
$dec_hex = sprintf("%x", $a_dec* 1000000);
|
||||
$sec_hex = sprintf("%x", $a_sec);
|
||||
|
||||
ensure_length1($dec_hex, 5);
|
||||
ensure_length1($sec_hex, 6);
|
||||
|
||||
$guid = "";
|
||||
$guid .= $dec_hex;
|
||||
$guid .= create_guid_section1(3);
|
||||
$guid .= '-';
|
||||
$guid .= create_guid_section1(4);
|
||||
$guid .= '-';
|
||||
$guid .= create_guid_section1(4);
|
||||
$guid .= '-';
|
||||
$guid .= create_guid_section1(4);
|
||||
$guid .= '-';
|
||||
$guid .= $sec_hex;
|
||||
$guid .= create_guid_section1(6);
|
||||
|
||||
return $guid;
|
||||
|
||||
}
|
||||
|
||||
function create_guid_section1($characters)
|
||||
{
|
||||
$return = "";
|
||||
for($i=0; $i<$characters; $i++)
|
||||
{
|
||||
$return .= sprintf("%x", mt_rand(0,15));
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
||||
function ensure_length1(&$string, $length)
|
||||
{
|
||||
$strlen = strlen($string);
|
||||
if($strlen < $length)
|
||||
{
|
||||
$string = str_pad($string,$length,"0");
|
||||
}
|
||||
else if($strlen > $length)
|
||||
{
|
||||
$string = substr($string, 0, $length);
|
||||
}
|
||||
}
|
||||
function add_to_history($table,$id,$field,$value)
|
||||
{
|
||||
error_reporting(0);
|
||||
$z="select id from ecmhistory where field_name='".$field."' and field_value='".$value."' and table_id='".$id."' and table_name='".$table."' order by date_modified desc limit 1";
|
||||
$w=mysql_query($z);
|
||||
$r=mysql_fetch_array($w);
|
||||
$fn=$r['field_value'];
|
||||
if($fn!=$field)
|
||||
{
|
||||
if($value)mysql_query("insert into ecmhistory(id,table_name,table_id,field_name,field_value,date_modified) values('".create_guid1()."','".$table."','".$id."','".$field."','".$value."','".date("Y-m-d H:i:s")."')");
|
||||
}
|
||||
}
|
||||
function display_history($table,$id,$field)
|
||||
{
|
||||
$html="";
|
||||
$z="select field_value,date_modified from ecmhistory where table_name='".$table."' and table_id='".$id."' and field_name='".$field."' order by date_modified asc";
|
||||
$w=mysql_query($z);
|
||||
while($r=mysql_fetch_array($w))
|
||||
{
|
||||
if($field=="assigned_user_id")
|
||||
{
|
||||
$rr=mysql_fetch_array(mysql_query("select user_name from users where id='".$r['field_value']."' and status='Active'"));
|
||||
$f=$rr['user_name'];
|
||||
}
|
||||
else $f=$r['field_value'];
|
||||
if($f)$html.="<div style='height:15px;'>".$r['date_modified']." - ".$f."<br></div>";
|
||||
}
|
||||
return $html;
|
||||
}
|
||||
?>
|
||||
75
modules/EcmDocuments/field_arrays.php
Executable file
75
modules/EcmDocuments/field_arrays.php
Executable file
@@ -0,0 +1,75 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/*****************************************************************************
|
||||
* The contents of this file are subject to the RECIPROCAL PUBLIC LICENSE
|
||||
* Version 1.1 ("License"); You may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
* http://opensource.org/licenses/rpl.php. Software distributed under the
|
||||
* License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
|
||||
* either express or implied.
|
||||
*
|
||||
* You may:
|
||||
* a) Use and distribute this code exactly as you received without payment or
|
||||
* a royalty or other fee.
|
||||
* b) Create extensions for this code, provided that you make the extensions
|
||||
* publicly available and document your modifications clearly.
|
||||
* c) Charge for a fee for warranty or support or for accepting liability
|
||||
* obligations for your customers.
|
||||
*
|
||||
* You may NOT:
|
||||
* a) Charge for the use of the original code or extensions, including in
|
||||
* electronic distribution models, such as ASP (Application Service
|
||||
* Provider).
|
||||
* b) Charge for the original source code or your extensions other than a
|
||||
* nominal fee to cover distribution costs where such distribution
|
||||
* involves PHYSICAL media.
|
||||
* c) Modify or delete any pre-existing copyright notices, change notices,
|
||||
* or License text in the Licensed Software
|
||||
* d) Assert any patent claims against the Licensor or Contributors, or
|
||||
* which would in any way restrict the ability of any third party to use the
|
||||
* Licensed Software.
|
||||
*
|
||||
* You must:
|
||||
* a) Document any modifications you make to this code including the nature of
|
||||
* the change, the authors of the change, and the date of the change.
|
||||
* b) Make the source code for any extensions you deploy available via an
|
||||
* Electronic Distribution Mechanism such as FTP or HTTP download.
|
||||
* c) Notify the licensor of the availability of source code to your extensions
|
||||
* and include instructions on how to acquire the source code and updates.
|
||||
* d) Grant Licensor a world-wide, non-exclusive, royalty-free license to use,
|
||||
* reproduce, perform, modify, sublicense, and distribute your extensions.
|
||||
*
|
||||
* The Original Code is: CommuniCore
|
||||
* Olavo Farias
|
||||
* 2006-04-7 olavo.farias@gmail.com
|
||||
*
|
||||
* The Initial Developer of the Original Code is CommuniCore.
|
||||
* Portions created by CommuniCore are Copyright (C) 2005 CommuniCore Ltda
|
||||
* All Rights Reserved.
|
||||
********************************************************************************/
|
||||
$fields_array['EcmDocument'] = array (
|
||||
'column_fields' => Array(
|
||||
"id",
|
||||
"name",
|
||||
"date_entered",
|
||||
"date_modified",
|
||||
"modified_user_id",
|
||||
"assigned_user_id",
|
||||
"created_by",
|
||||
//NEW COLUMN FIELDS
|
||||
"description",
|
||||
),
|
||||
|
||||
'list_fields' => Array(
|
||||
'id',
|
||||
'name',
|
||||
'assigned_user_name',
|
||||
'assigned_user_id',
|
||||
//NEW LIST_FIELDS
|
||||
'description',
|
||||
),
|
||||
'required_fields' => array(
|
||||
'name'=>1
|
||||
),
|
||||
);
|
||||
?>
|
||||
68
modules/EcmDocuments/generateTree.php
Executable file
68
modules/EcmDocuments/generateTree.php
Executable file
@@ -0,0 +1,68 @@
|
||||
<?
|
||||
set_time_limit(300);
|
||||
ob_start();
|
||||
session_start();
|
||||
include("../../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']);
|
||||
|
||||
function generateTree($iddir,$html)
|
||||
{
|
||||
$z="select id,name,no from ecmdocuments where iddir='".$iddir."'";
|
||||
$w=mysql_query($z);
|
||||
//print $z;
|
||||
while($r=mysql_fetch_array($w))
|
||||
{
|
||||
if($r['no']<10)$nod=0;
|
||||
else $nod="";
|
||||
|
||||
$html.="<div style='display:none;' id='all".$r['id']."'><table cellspacing='0' cellpadding='0' border='0'>
|
||||
<tr valign='top'>
|
||||
<td width='10' style='width:10px;'>
|
||||
<a style='cursor:pointer;' onclick='toggle_block(\"blocktree".$r['id']."\");'>
|
||||
<img id='plusminus".$r['id']."' src='modules/EcmDocuments/images/plus.gif' border='0'>
|
||||
</a>
|
||||
</td>
|
||||
<td width='10' style='width:10px;'>
|
||||
<img id='image".$r['id']."' src='modules/EcmDocuments/images/Folder.gif' border='0'>
|
||||
</td>
|
||||
<td width='999'>
|
||||
<a name='linktree".$r['id']."' onclick='' id='linktree".$r['id']."' href='index.php?module=EcmDocuments&action=DetailView&record=".$r['id']."'>".$nod.$r['no'].".".$r['name']."</a>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan='3'>
|
||||
<div style='display:none;margin-left:17px;' id='blocktree".$r['id']."'>";
|
||||
$html=generateTree($r['id'],$html);
|
||||
$html.="</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table></div>
|
||||
";
|
||||
}
|
||||
return $html;
|
||||
}
|
||||
|
||||
$html='<?
|
||||
$offset = 3600 * 24;
|
||||
header("Cache-Control: max-age=".$offset.", must-revalidate");
|
||||
$expire = "Expires: " . gmdate("D, d M Y H:i:s", time() + $offset) . " GMT";
|
||||
header($expire);
|
||||
$gmt_mtime = gmdate("D, d M Y H:i:s", time() ) . " GMT";
|
||||
header("Last-Modified: " . $gmt_mtime );
|
||||
?>';
|
||||
|
||||
$html.=generateTree("0","");
|
||||
|
||||
|
||||
print $html;
|
||||
|
||||
$filename = "../../tree.php";
|
||||
$plik = file($filename);
|
||||
$fp = fopen($filename,"w");
|
||||
flock($fp,2);
|
||||
fputs($fp,$html);
|
||||
flock($fp,3);
|
||||
fclose($fp);
|
||||
mysql_close($sql);
|
||||
?>
|
||||
29
modules/EcmDocuments/getlinkedpath.php
Executable file
29
modules/EcmDocuments/getlinkedpath.php
Executable file
@@ -0,0 +1,29 @@
|
||||
<?
|
||||
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']);
|
||||
mysql_query("set names utf8");
|
||||
function getidsforlinkedpath($id,$ids)
|
||||
{
|
||||
$z="select iddir from ecmdocuments where id='".$id."'";
|
||||
$r=mysql_fetch_array(mysql_query($z));
|
||||
$iddir=$r['iddir'];
|
||||
$ids.="||".$iddir;
|
||||
if($iddir)$ids=getidsforlinkedpath($iddir,$ids);
|
||||
return $ids;
|
||||
}
|
||||
$idsy=getidsforlinkedpath($_REQUEST['record'],$_REQUEST['record']);
|
||||
$ids=explode("||",$idsy);
|
||||
for($i=count($ids)-1;$i>=0;$i--)
|
||||
{
|
||||
$z="select name,no,id from ecmdocuments where id='".$ids[$i]."'";
|
||||
$w=mysql_query($z);
|
||||
$r=mysql_fetch_array($w);
|
||||
if($_REQUEST['names'])$what="name";
|
||||
else $what="no";
|
||||
if($r[$what])$linked_path.="<a class='utilsLink' href='index.php?module=EcmDocuments&action=DetailView&record=".$r['id']."'>".$r[$what]."</a> / ";
|
||||
}
|
||||
print $linked_path;
|
||||
mysql_close($sql);
|
||||
?>
|
||||
52
modules/EcmDocuments/guid.php
Executable file
52
modules/EcmDocuments/guid.php
Executable file
@@ -0,0 +1,52 @@
|
||||
<?
|
||||
function create_guid()
|
||||
{
|
||||
$microTime = microtime();
|
||||
list($a_dec, $a_sec) = explode(" ", $microTime);
|
||||
|
||||
$dec_hex = sprintf("%x", $a_dec* 1000000);
|
||||
$sec_hex = sprintf("%x", $a_sec);
|
||||
|
||||
ensure_length($dec_hex, 5);
|
||||
ensure_length($sec_hex, 6);
|
||||
|
||||
$guid = "";
|
||||
$guid .= $dec_hex;
|
||||
$guid .= create_guid_section(3);
|
||||
$guid .= '-';
|
||||
$guid .= create_guid_section(4);
|
||||
$guid .= '-';
|
||||
$guid .= create_guid_section(4);
|
||||
$guid .= '-';
|
||||
$guid .= create_guid_section(4);
|
||||
$guid .= '-';
|
||||
$guid .= $sec_hex;
|
||||
$guid .= create_guid_section(6);
|
||||
|
||||
return $guid;
|
||||
|
||||
}
|
||||
|
||||
function create_guid_section($characters)
|
||||
{
|
||||
$return = "";
|
||||
for($i=0; $i<$characters; $i++)
|
||||
{
|
||||
$return .= sprintf("%x", mt_rand(0,15));
|
||||
}
|
||||
return $return;
|
||||
}
|
||||
|
||||
function ensure_length(&$string, $length)
|
||||
{
|
||||
$strlen = strlen($string);
|
||||
if($strlen < $length)
|
||||
{
|
||||
$string = str_pad($string,$length,"0");
|
||||
}
|
||||
else if($strlen > $length)
|
||||
{
|
||||
$string = substr($string, 0, $length);
|
||||
}
|
||||
}
|
||||
?>
|
||||
61
modules/EcmDocuments/index.php
Executable file
61
modules/EcmDocuments/index.php
Executable 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/EcmDocuments/ListView.php');
|
||||
|
||||
?>
|
||||
19
modules/EcmDocuments/informhistory.php
Executable file
19
modules/EcmDocuments/informhistory.php
Executable file
@@ -0,0 +1,19 @@
|
||||
<?
|
||||
function add_to_inform_history($module,$to_name,$id)
|
||||
{
|
||||
mysql_query("insert into ecminform_history(id,module,parent_id,from,to,date) values('".create_guid()."','".$module."','".$id."','".$_SESSION['authenticated_user_id']."','".$to_name."','".date("Y-m-d H:m:s")."')");
|
||||
}
|
||||
function display_inform_history($module,$id)
|
||||
{
|
||||
$html="";
|
||||
$z="select * from ecminform_history where ecminform_history.module='".$module."' and ecminform_history.parent_id='".$id."' order by ecminform_history.date asc";
|
||||
$w=mysql_query($z);
|
||||
while($r=mysql_fetch_array($w))
|
||||
{
|
||||
$rr=mysql_fetch_array(mysql_query("select user_name from users where id='".$r['from']."'"));
|
||||
if($rr['user_name'])$from=$rr['user_name'];
|
||||
$html.="<div style='height:15px;'>".$r['date'].": ".$from." to ".str_replace("||",", ",$r['to'])."<br></div>";
|
||||
}
|
||||
return $html;
|
||||
}
|
||||
?>
|
||||
140
modules/EcmDocuments/language/en_us.lang.php
Executable file
140
modules/EcmDocuments/language/en_us.lang.php
Executable file
@@ -0,0 +1,140 @@
|
||||
<?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_ECMSTOCKINS_SUBPANEL_TITLE' => 'Stock In',
|
||||
'LBL_ECMSTOCKOUTS_SUBPANEL_TITLE' => 'Stock Out',
|
||||
'LBL_ECMDOCUMENTS_DASHLET_FILES_TITLE' => 'Attached Documents',
|
||||
'LBL_ECMDOCUMENTS_DASHLET_TITLE' => 'Subfolders',
|
||||
'LBL_CONTRACTS_SUBPANEL_TITLE' => 'Contracts',
|
||||
'LBL_CORRESPONDENCES_SUBPANEL_TITLE' => 'Correspondence In',
|
||||
'LBL_CORRESPONDENCESOUT_SUBPANEL_TITLE' => 'Correspondence Out',
|
||||
'LBL_CONTACTS_SUBPANEL_TITLE' => 'Contacts',
|
||||
'LBL_ACCOUNTS_SUBPANEL_TITLE' => 'Accounts',
|
||||
'LBL_TASKS_SUBPANEL_TITLE' => 'Tasks',
|
||||
'LBL_ECMINVOICES_SUBPANEL_TITLE' => 'Invoices In',
|
||||
'LBL_ECMINVOICESOUT_SUBPANEL_TITLE' => 'Invoices Out',
|
||||
'LBL_MEETINGS_SUBPANEL_TITLE' => 'Meetings',
|
||||
'LBL_CALLS_SUBPANEL_TITLE' => 'Calls',
|
||||
'LBL_NOTES_SUBPANEL_TITLE' => 'Notes',
|
||||
'LBL_QUOTES_SUBPANEL_TITLE' => 'Invoices',
|
||||
'LBL_QUOTESOUT_SUBPANEL_TITLE' => 'Invoices Out',
|
||||
'LBL_EMAILINS_SUBPANEL_TITLE' => 'Inbox',
|
||||
'LBL_EMAILOUTS_SUBPANEL_TITLE' => 'Outbox',
|
||||
'LBL_NO' => 'No',
|
||||
|
||||
|
||||
// FOR SYSTEM USE
|
||||
'LBL_MODULE_NAME' => 'EcmDocuments',
|
||||
'LBL_MODULE_TITLE' => 'EcmDocuments: Home',
|
||||
'LBL_MODULE_ID' => 'EcmDocuments',
|
||||
'LBL_SEARCH_FORM_TITLE' => 'EcmDocuments Search',
|
||||
'LBL_LIST_FORM_TITLE' => 'EcmDocuments List',
|
||||
'LBL_NEW_FORM_TITLE' => 'New EcmDocuments',
|
||||
'LBL_ECMDOCUMENTS' => 'EcmDocuments:',
|
||||
'LBL_ECMDOCUMENTS_SUBJECT' => 'EcmDocuments Subject:',
|
||||
'LBL_SYSTEM_ID' => 'System ID',
|
||||
|
||||
// FOR LIST VIEW
|
||||
'LBL_LIST_NAME' => 'Name',
|
||||
'LBL_LIST_PATH' => 'Path',
|
||||
'LBL_LIST_SUBJECT' => 'Subject',
|
||||
'LBL_LIST_LAST_MODIFIED' => 'Last Modified',
|
||||
'LBL_LIST_MY_ECMDOCUMENTS' => 'My Dirs',
|
||||
'LBL_LIST_ASSIGNED_TO_NAME' => 'Assigned User',
|
||||
'LBL_LIST_EKMT_DESCRIPTION' => 'Description',
|
||||
|
||||
// FOR NOTIFICATION POPUPS
|
||||
'NTC_DELETE_CONFIRMATION' => 'Are you sure you want to remove this ecmdocument from this EcmDocument?',
|
||||
'NTC_REMOVE_INVITEE' => 'Are you sure you want to remove this contact from the EcmDocument?',
|
||||
'NTC_REMOVE_ACCOUNT_CONFIRMATION' => 'Are you sure you want to remove this ecmdocument from this account?',
|
||||
'ERR_DELETE_RECORD' => 'A record number must be specified to delete the ecmdocument.',
|
||||
|
||||
// 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',
|
||||
|
||||
// FOR GROUPS
|
||||
'LBL_GROUP_MASTER' => 'ECMDOCUMENT INFORMATION',
|
||||
'LBL_GROUP_EKMT_DESCRIPTION' => '',
|
||||
// FOR SUBPANELS
|
||||
'LBL_ECMDOCUMENTS_SUBPANEL_TITLE' => 'EcmDocuments',
|
||||
'LBL_ACTIVITIES_SUBPANEL_TITLE' => 'Activities',
|
||||
'LBL_HISTORY_SUBPANEL_TITLE' => 'History',
|
||||
'LBL_ECMDOCUMENTS' => 'EcmDocuments',
|
||||
|
||||
// FOR MENU LABELS
|
||||
'LNK_NEW_ECMDOCUMENTS' => 'Create EcmDocument',
|
||||
'LNK_LIST_ECMDOCUMENT' => 'EcmDocuments List',
|
||||
|
||||
// FOR MENU LINKS
|
||||
'LNK_NEW_ECMDOCUMENT' => 'Create EcmDocuments',
|
||||
'LNK_ECMDOCUMENTS_LIST' => 'EcmDocuments',
|
||||
'LNK_ECMDOCUMENTS_REPORTS' => 'EcmDocuments Reports',
|
||||
// FOR ADDITIONAL MENUS
|
||||
|
||||
// FOR DASHLETS
|
||||
'LBL_LIST_ECMDOCUMENTS' => 'EcmDocuments',
|
||||
);
|
||||
?>
|
||||
140
modules/EcmDocuments/language/ge_ge.lang.php
Executable file
140
modules/EcmDocuments/language/ge_ge.lang.php
Executable file
@@ -0,0 +1,140 @@
|
||||
<?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_ECMSTOCKINS_SUBPANEL_TITLE' => 'Stock In',
|
||||
'LBL_ECMSTOCKOUTS_SUBPANEL_TITLE' => 'Stock Out',
|
||||
'LBL_ECMDOCUMENTS_DASHLET_FILES_TITLE' => 'Attached Documents',
|
||||
'LBL_ECMDOCUMENTS_DASHLET_TITLE' => 'Subfolders',
|
||||
'LBL_CONTRACTS_SUBPANEL_TITLE' => 'Contracts',
|
||||
'LBL_CORRESPONDENCES_SUBPANEL_TITLE' => 'Correspondence In',
|
||||
'LBL_CORRESPONDENCESOUT_SUBPANEL_TITLE' => 'Correspondence Out',
|
||||
'LBL_CONTACTS_SUBPANEL_TITLE' => 'Contacts',
|
||||
'LBL_ACCOUNTS_SUBPANEL_TITLE' => 'Accounts',
|
||||
'LBL_TASKS_SUBPANEL_TITLE' => 'Tasks',
|
||||
'LBL_ECMINVOICES_SUBPANEL_TITLE' => 'Invoices In',
|
||||
'LBL_ECMINVOICESOUT_SUBPANEL_TITLE' => 'Invoices Out',
|
||||
'LBL_MEETINGS_SUBPANEL_TITLE' => 'Meetings',
|
||||
'LBL_CALLS_SUBPANEL_TITLE' => 'Calls',
|
||||
'LBL_NOTES_SUBPANEL_TITLE' => 'Notes',
|
||||
'LBL_QUOTES_SUBPANEL_TITLE' => 'Invoices',
|
||||
'LBL_QUOTESOUT_SUBPANEL_TITLE' => 'Invoices Out',
|
||||
'LBL_EMAILINS_SUBPANEL_TITLE' => 'Inbox',
|
||||
'LBL_EMAILOUTS_SUBPANEL_TITLE' => 'Outbox',
|
||||
'LBL_NO' => 'No',
|
||||
|
||||
|
||||
// FOR SYSTEM USE
|
||||
'LBL_MODULE_NAME' => 'EcmDocuments',
|
||||
'LBL_MODULE_TITLE' => 'EcmDocuments: Home',
|
||||
'LBL_MODULE_ID' => 'EcmDocuments',
|
||||
'LBL_SEARCH_FORM_TITLE' => 'EcmDocuments Search',
|
||||
'LBL_LIST_FORM_TITLE' => 'EcmDocuments List',
|
||||
'LBL_NEW_FORM_TITLE' => 'New EcmDocuments',
|
||||
'LBL_ECMDOCUMENTS' => 'EcmDocuments:',
|
||||
'LBL_ECMDOCUMENTS_SUBJECT' => 'EcmDocuments Subject:',
|
||||
'LBL_SYSTEM_ID' => 'System ID',
|
||||
|
||||
// FOR LIST VIEW
|
||||
'LBL_LIST_NAME' => 'Name',
|
||||
'LBL_LIST_PATH' => 'Path',
|
||||
'LBL_LIST_SUBJECT' => 'Subject',
|
||||
'LBL_LIST_LAST_MODIFIED' => 'Last Modified',
|
||||
'LBL_LIST_MY_ECMDOCUMENTS' => 'My Dirs',
|
||||
'LBL_LIST_ASSIGNED_TO_NAME' => 'Assigned User',
|
||||
'LBL_LIST_EKMT_DESCRIPTION' => 'Description',
|
||||
|
||||
// FOR NOTIFICATION POPUPS
|
||||
'NTC_DELETE_CONFIRMATION' => 'Are you sure you want to remove this ecmdocument from this EcmDocument?',
|
||||
'NTC_REMOVE_INVITEE' => 'Are you sure you want to remove this contact from the EcmDocument?',
|
||||
'NTC_REMOVE_ACCOUNT_CONFIRMATION' => 'Are you sure you want to remove this ecmdocument from this account?',
|
||||
'ERR_DELETE_RECORD' => 'A record number must be specified to delete the ecmdocument.',
|
||||
|
||||
// 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',
|
||||
|
||||
// FOR GROUPS
|
||||
'LBL_GROUP_MASTER' => 'ECMDOCUMENT INFORMATION',
|
||||
'LBL_GROUP_EKMT_DESCRIPTION' => '',
|
||||
// FOR SUBPANELS
|
||||
'LBL_ECMDOCUMENTS_SUBPANEL_TITLE' => 'EcmDocuments',
|
||||
'LBL_ACTIVITIES_SUBPANEL_TITLE' => 'Activities',
|
||||
'LBL_HISTORY_SUBPANEL_TITLE' => 'History',
|
||||
'LBL_ECMDOCUMENTS' => 'EcmDocuments',
|
||||
|
||||
// FOR MENU LABELS
|
||||
'LNK_NEW_ECMDOCUMENTS' => 'Create EcmDocument',
|
||||
'LNK_LIST_ECMDOCUMENT' => 'EcmDocuments List',
|
||||
|
||||
// FOR MENU LINKS
|
||||
'LNK_NEW_ECMDOCUMENT' => 'Create EcmDocuments',
|
||||
'LNK_ECMDOCUMENTS_LIST' => 'EcmDocuments',
|
||||
'LNK_ECMDOCUMENTS_REPORTS' => 'EcmDocuments Reports',
|
||||
// FOR ADDITIONAL MENUS
|
||||
|
||||
// FOR DASHLETS
|
||||
'LBL_LIST_ECMDOCUMENTS' => 'EcmDocuments',
|
||||
);
|
||||
?>
|
||||
140
modules/EcmDocuments/language/pl_pl.lang.php
Executable file
140
modules/EcmDocuments/language/pl_pl.lang.php
Executable file
@@ -0,0 +1,140 @@
|
||||
<?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_ECMSTOCKINS_SUBPANEL_TITLE' => 'Stock In',
|
||||
'LBL_ECMSTOCKOUTS_SUBPANEL_TITLE' => 'Stock Out',
|
||||
'LBL_ECMDOCUMENTS_DASHLET_FILES_TITLE' => 'Attached Documents',
|
||||
'LBL_ECMDOCUMENTS_DASHLET_TITLE' => 'Subfolders',
|
||||
'LBL_CONTRACTS_SUBPANEL_TITLE' => 'Contracts',
|
||||
'LBL_CORRESPONDENCES_SUBPANEL_TITLE' => 'Correspondence In',
|
||||
'LBL_CORRESPONDENCESOUT_SUBPANEL_TITLE' => 'Correspondence Out',
|
||||
'LBL_CONTACTS_SUBPANEL_TITLE' => 'Contacts',
|
||||
'LBL_ACCOUNTS_SUBPANEL_TITLE' => 'Accounts',
|
||||
'LBL_TASKS_SUBPANEL_TITLE' => 'Tasks',
|
||||
'LBL_ECMINVOICES_SUBPANEL_TITLE' => 'Invoices In',
|
||||
'LBL_ECMINVOICESOUT_SUBPANEL_TITLE' => 'Invoices Out',
|
||||
'LBL_MEETINGS_SUBPANEL_TITLE' => 'Meetings',
|
||||
'LBL_CALLS_SUBPANEL_TITLE' => 'Calls',
|
||||
'LBL_NOTES_SUBPANEL_TITLE' => 'Notes',
|
||||
'LBL_QUOTES_SUBPANEL_TITLE' => 'Invoices',
|
||||
'LBL_QUOTESOUT_SUBPANEL_TITLE' => 'Invoices Out',
|
||||
'LBL_EMAILINS_SUBPANEL_TITLE' => 'Inbox',
|
||||
'LBL_EMAILOUTS_SUBPANEL_TITLE' => 'Outbox',
|
||||
'LBL_NO' => 'No',
|
||||
|
||||
|
||||
// FOR SYSTEM USE
|
||||
'LBL_MODULE_NAME' => 'EcmDocuments',
|
||||
'LBL_MODULE_TITLE' => 'EcmDocuments: Home',
|
||||
'LBL_MODULE_ID' => 'EcmDocuments',
|
||||
'LBL_SEARCH_FORM_TITLE' => 'EcmDocuments Search',
|
||||
'LBL_LIST_FORM_TITLE' => 'EcmDocuments List',
|
||||
'LBL_NEW_FORM_TITLE' => 'New EcmDocuments',
|
||||
'LBL_ECMDOCUMENTS' => 'EcmDocuments:',
|
||||
'LBL_ECMDOCUMENTS_SUBJECT' => 'EcmDocuments Subject:',
|
||||
'LBL_SYSTEM_ID' => 'System ID',
|
||||
|
||||
// FOR LIST VIEW
|
||||
'LBL_LIST_NAME' => 'Name',
|
||||
'LBL_LIST_PATH' => 'Path',
|
||||
'LBL_LIST_SUBJECT' => 'Subject',
|
||||
'LBL_LIST_LAST_MODIFIED' => 'Last Modified',
|
||||
'LBL_LIST_MY_ECMDOCUMENTS' => 'My Dirs',
|
||||
'LBL_LIST_ASSIGNED_TO_NAME' => 'Assigned User',
|
||||
'LBL_LIST_EKMT_DESCRIPTION' => 'Description',
|
||||
|
||||
// FOR NOTIFICATION POPUPS
|
||||
'NTC_DELETE_CONFIRMATION' => 'Are you sure you want to remove this ecmdocument from this EcmDocument?',
|
||||
'NTC_REMOVE_INVITEE' => 'Are you sure you want to remove this contact from the EcmDocument?',
|
||||
'NTC_REMOVE_ACCOUNT_CONFIRMATION' => 'Are you sure you want to remove this ecmdocument from this account?',
|
||||
'ERR_DELETE_RECORD' => 'A record number must be specified to delete the ecmdocument.',
|
||||
|
||||
// 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',
|
||||
|
||||
// FOR GROUPS
|
||||
'LBL_GROUP_MASTER' => 'ECMDOCUMENT INFORMATION',
|
||||
'LBL_GROUP_EKMT_DESCRIPTION' => '',
|
||||
// FOR SUBPANELS
|
||||
'LBL_ECMDOCUMENTS_SUBPANEL_TITLE' => 'EcmDocuments',
|
||||
'LBL_ACTIVITIES_SUBPANEL_TITLE' => 'Activities',
|
||||
'LBL_HISTORY_SUBPANEL_TITLE' => 'History',
|
||||
'LBL_ECMDOCUMENTS' => 'EcmDocuments',
|
||||
|
||||
// FOR MENU LABELS
|
||||
'LNK_NEW_ECMDOCUMENTS' => 'Create EcmDocument',
|
||||
'LNK_LIST_ECMDOCUMENT' => 'EcmDocuments List',
|
||||
|
||||
// FOR MENU LINKS
|
||||
'LNK_NEW_ECMDOCUMENT' => 'Create EcmDocuments',
|
||||
'LNK_ECMDOCUMENTS_LIST' => 'EcmDocuments',
|
||||
'LNK_ECMDOCUMENTS_REPORTS' => 'EcmDocuments Reports',
|
||||
// FOR ADDITIONAL MENUS
|
||||
|
||||
// FOR DASHLETS
|
||||
'LBL_LIST_ECMDOCUMENTS' => 'EcmDocuments',
|
||||
);
|
||||
?>
|
||||
411
modules/EcmDocuments/layout_defs.php
Executable file
411
modules/EcmDocuments/layout_defs.php
Executable file
@@ -0,0 +1,411 @@
|
||||
<?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.
|
||||
********************************************************************************/
|
||||
/*******************************************************************************
|
||||
* Layout definition for EcmDocuments
|
||||
*******************************************************************************/
|
||||
require_once("modules/EcmDocuments/dirstree.php");
|
||||
$za="select treeread from users where id='".$_SESSION['authenticated_user_id']."'";
|
||||
$wy=mysql_query($za);
|
||||
$ro=mysql_fetch_array($wy);
|
||||
$treeread=$ro['treeread'];
|
||||
|
||||
$za="select assigned_user_id from ecmdocuments where id='".$_GET['record']."'";
|
||||
$wy=mysql_query($za);
|
||||
$ro=mysql_fetch_array($wy);
|
||||
$assigned_user_id=$ro['assigned_user_id'];
|
||||
$za="select id from ecmdocuments where iddir='".$_GET['record']."'";
|
||||
$wy=mysql_query($za);
|
||||
$katalogi_liczba=mysql_num_rows($wy);
|
||||
$za="select * from ecmdocuments_permissions where iddir='".$_GET['record']."' and userid='".$_SESSION['authenticated_user_id']."'";
|
||||
$wy=mysql_query($za);
|
||||
$ro=mysql_fetch_array($wy);
|
||||
$add=$ro['add'];
|
||||
error_reporting(E_ALL);
|
||||
if($add==1 || check_is_admin($_SESSION['authenticated_user_id']) || $assigned_user_id==$_SESSION['authenticated_user_id'] ||
|
||||
($treeread && ACLController::checkAccess('EcmDocuments', 'list', true)))$top_buttons='top_buttons';
|
||||
else $top_buttons='';
|
||||
if($katalogi_liczba==0)
|
||||
{
|
||||
$layout_defs['EcmDocuments'] = array(
|
||||
'subpanel_setup' => array(
|
||||
/*
|
||||
'ecmdocuments' => array(
|
||||
'order' => 10,
|
||||
'module' => 'EcmDocuments',
|
||||
'sort_order' => 'asc',
|
||||
'sort_by' => 'no',
|
||||
'subpanel_name' => 'default-ecmdocuments',
|
||||
'get_subpanel_data' => 'ecmdocuments',
|
||||
'add_subpanel_data' => 'iddir',
|
||||
'title_key' => 'LBL_ECMDOCUMENTS_DASHLET_TITLE',
|
||||
),*/
|
||||
'ecmdocs' => array(
|
||||
'order' => 20,
|
||||
'module' => 'EcmDocs',
|
||||
'sort_order' => 'asc',
|
||||
'sort_by' => 'name',
|
||||
'subpanel_name' => 'default',
|
||||
'get_subpanel_data' => 'ecmdocs',
|
||||
'add_subpanel_data' => 'ecmdoc_id',
|
||||
'title_key' => 'LBL_ECMDOCUMENTS_DASHLET_FILES_TITLE',
|
||||
$top_buttons => array(
|
||||
array('widget_class' => 'SubPanelTopSelectButton', 'mode'=>'MultiSelect'),
|
||||
array('widget_class' => 'SubPanelTopCreateButton'),
|
||||
),
|
||||
'refresh_page'=>1,
|
||||
),
|
||||
'ecmcontracts' => array(
|
||||
'order' => 30,
|
||||
'module' => 'EcmContracts',
|
||||
'sort_order' => 'asc',
|
||||
'sort_by' => 'name',
|
||||
'subpanel_name' => 'default',
|
||||
'get_subpanel_data' => 'ecmcontracts',
|
||||
'add_subpanel_data' => 'ecmcontract_id',
|
||||
'title_key' => 'LBL_CONTRACTS_SUBPANEL_TITLE',
|
||||
$top_buttons => array(
|
||||
array('widget_class' => 'SubPanelTopSelectButton', 'mode'=>'MultiSelect'),
|
||||
array('widget_class' => 'SubPanelTopCreateButton'),
|
||||
),
|
||||
'refresh_page'=>1,
|
||||
),
|
||||
'ecmcorrespondenceins' => array(
|
||||
'order' => 40,
|
||||
'module' => 'EcmCorrespondenceIns',
|
||||
'sort_order' => 'asc',
|
||||
'sort_by' => 'name',
|
||||
'subpanel_name' => 'default',
|
||||
'get_subpanel_data' => 'ecmcorrespondenceins',
|
||||
'add_subpanel_data' => 'ecmcorrespondencein_id',
|
||||
'title_key' => 'LBL_CORRESPONDENCES_SUBPANEL_TITLE',
|
||||
$top_buttons => array(
|
||||
array('widget_class' => 'SubPanelTopSelectButton', 'mode'=>'MultiSelect'),
|
||||
array('widget_class' => 'SubPanelTopCreateButton'),
|
||||
),
|
||||
'refresh_page'=>1,
|
||||
),
|
||||
'ecmcorrespondenceouts' => array(
|
||||
'order' => 50,
|
||||
'module' => 'EcmCorrespondenceOuts',
|
||||
'sort_order' => 'asc',
|
||||
'sort_by' => 'name',
|
||||
'subpanel_name' => 'default',
|
||||
'get_subpanel_data' => 'ecmcorrespondenceouts',
|
||||
'add_subpanel_data' => 'ecmcorrespondenceout_id',
|
||||
'title_key' => 'LBL_CORRESPONDENCESOUT_SUBPANEL_TITLE',
|
||||
$top_buttons => array(
|
||||
array('widget_class' => 'SubPanelTopSelectButton', 'mode'=>'MultiSelect'),
|
||||
array('widget_class' => 'SubPanelTopCreateButton'),
|
||||
),
|
||||
'refresh_page'=>1,
|
||||
|
||||
),
|
||||
'emailins' => array(
|
||||
'order' => 70,
|
||||
'sort_order' => 'desc',
|
||||
'sort_by' => 'name',
|
||||
'module' => 'Emails',
|
||||
'subpanel_name' => 'ForEcmDocumentsIn',
|
||||
'get_subpanel_data' => 'emails',
|
||||
'add_subpanel_data' => 'email_id',
|
||||
'title_key' => 'LBL_EMAILINS_SUBPANEL_TITLE',
|
||||
$top_buttons => array(
|
||||
array('widget_class' => 'SubPanelTopSelectButton', 'mode'=>'MultiSelect'),
|
||||
array('widget_class' => 'SubPanelTopCreateButton'),
|
||||
),
|
||||
'refresh_page'=>1,
|
||||
),
|
||||
'emailouts' => array(
|
||||
'order' => 170,
|
||||
'sort_order' => 'desc',
|
||||
'sort_by' => 'name',
|
||||
'module' => 'Emails',
|
||||
'subpanel_name' => 'ForEcmDocumentsOut',
|
||||
'get_subpanel_data' => 'emails',
|
||||
'add_subpanel_data' => 'email_id',
|
||||
'title_key' => 'LBL_EMAILOUTS_SUBPANEL_TITLE',
|
||||
$top_buttons => array(
|
||||
array('widget_class' => 'SubPanelTopSelectButton', 'mode'=>'MultiSelect'),
|
||||
array('widget_class' => 'SubPanelTopCreateButton'),
|
||||
),
|
||||
'refresh_page'=>1,
|
||||
),
|
||||
'ecminvoiceins' => array(
|
||||
'order' => 80,
|
||||
'sort_order' => 'desc',
|
||||
'sort_by' => 'name',
|
||||
'module' => 'EcmInvoiceIns',
|
||||
'subpanel_name' => 'default',
|
||||
'get_subpanel_data' => 'ecminvoiceins',
|
||||
'add_subpanel_data' => 'ecminvoicein_id',
|
||||
'title_key' => 'LBL_ECMINVOICES_SUBPANEL_TITLE',
|
||||
$top_buttons => array(
|
||||
array('widget_class' => 'SubPanelTopSelectButton', 'mode'=>'MultiSelect'),
|
||||
array('widget_class' => 'SubPanelTopCreateButton'),
|
||||
),
|
||||
'refresh_page'=>1,
|
||||
),
|
||||
'ecminvoiceouts' => array(
|
||||
'order' => 90,
|
||||
'sort_order' => 'desc',
|
||||
'sort_by' => 'name',
|
||||
'module' => 'EcmInvoiceOuts',
|
||||
'subpanel_name' => 'default',
|
||||
'get_subpanel_data' => 'ecminvoiceouts',
|
||||
'add_subpanel_data' => 'ecminvoiceout_id',
|
||||
'title_key' => 'LBL_ECMINVOICESOUT_SUBPANEL_TITLE',
|
||||
$top_buttons => array(
|
||||
array('widget_class' => 'SubPanelTopSelectButton', 'mode'=>'MultiSelect'),
|
||||
array('widget_class' => 'SubPanelTopCreateButton'),
|
||||
),
|
||||
'refresh_page'=>1,
|
||||
),
|
||||
'contacts' => array(
|
||||
'order' => 100,
|
||||
'module' => 'Contacts',
|
||||
'sort_order' => 'asc',
|
||||
'sort_by' => 'last_name, first_name',
|
||||
'subpanel_name' => 'default',
|
||||
'get_subpanel_data' => 'contacts',
|
||||
'add_subpanel_data' => 'contact_id',
|
||||
'title_key' => 'LBL_CONTACTS_SUBPANEL_TITLE',
|
||||
$top_buttons => array(
|
||||
array('widget_class' => 'SubPanelTopSelectButton', 'mode'=>'MultiSelect'),
|
||||
array('widget_class' => 'SubPanelTopCreateButton'),
|
||||
),
|
||||
'refresh_page'=>1,
|
||||
),
|
||||
'accounts' => array(
|
||||
'order' => 110,
|
||||
'sort_order' => 'desc',
|
||||
'sort_by' => 'name',
|
||||
'module' => 'Accounts',
|
||||
'subpanel_name' => 'default',
|
||||
'get_subpanel_data' => 'accounts',
|
||||
'add_subpanel_data' => 'account_id',
|
||||
'title_key' => 'LBL_ACCOUNTS_SUBPANEL_TITLE',
|
||||
$top_buttons => array(
|
||||
array('widget_class' => 'SubPanelTopSelectButton', 'mode'=>'MultiSelect'),
|
||||
array('widget_class' => 'SubPanelTopCreateButton'),
|
||||
),
|
||||
'refresh_page'=>1,
|
||||
),
|
||||
'calls' => array(
|
||||
'order' => 120,
|
||||
'sort_order' => 'desc',
|
||||
'sort_by' => 'name',
|
||||
'module' => 'Calls',
|
||||
'subpanel_name' => 'ForEcmDocuments',
|
||||
'get_subpanel_data' => 'calls',
|
||||
'add_subpanel_data' => 'call_id',
|
||||
'title_key' => 'LBL_CALLS_SUBPANEL_TITLE',
|
||||
$top_buttons => array(
|
||||
array('widget_class' => 'SubPanelTopSelectButton', 'mode'=>'MultiSelect'),
|
||||
array('widget_class' => 'SubPanelTopCreateButton'),
|
||||
),
|
||||
'refresh_page'=>1,
|
||||
),
|
||||
'meetings' => array(
|
||||
'order' => 130,
|
||||
'sort_order' => 'desc',
|
||||
'sort_by' => 'name',
|
||||
'module' => 'Meetings',
|
||||
'subpanel_name' => 'ForEcmDocuments',
|
||||
'get_subpanel_data' => 'meetings',
|
||||
'add_subpanel_data' => 'meeting_id',
|
||||
'title_key' => 'LBL_MEETINGS_SUBPANEL_TITLE',
|
||||
$top_buttons => array(
|
||||
array('widget_class' => 'SubPanelTopSelectButton', 'mode'=>'MultiSelect'),
|
||||
array('widget_class' => 'SubPanelTopCreateButton'),
|
||||
),
|
||||
'refresh_page'=>1,
|
||||
),
|
||||
'tasks' => array(
|
||||
'order' => 140,
|
||||
'sort_order' => 'desc',
|
||||
'sort_by' => 'name',
|
||||
'module' => 'Tasks',
|
||||
'subpanel_name' => 'ForEcmDocuments',
|
||||
'get_subpanel_data' => 'tasks',
|
||||
'add_subpanel_data' => 'task_id',
|
||||
'title_key' => 'LBL_TASKS_SUBPANEL_TITLE',
|
||||
$top_buttons => array(
|
||||
array('widget_class' => 'SubPanelTopSelectButton', 'mode'=>'MultiSelect'),
|
||||
array('widget_class' => 'SubPanelTopCreateButton'),
|
||||
),
|
||||
'refresh_page'=>1,
|
||||
),
|
||||
'notes' => array(
|
||||
'order' => 150,
|
||||
'sort_order' => 'desc',
|
||||
'sort_by' => 'name',
|
||||
'module' => 'Notes',
|
||||
'subpanel_name' => 'ForEcmDocuments',
|
||||
'get_subpanel_data' => 'notes',
|
||||
'add_subpanel_data' => 'note_id',
|
||||
'title_key' => 'LBL_NOTES_SUBPANEL_TITLE',
|
||||
$top_buttons => array(
|
||||
array('widget_class' => 'SubPanelTopSelectButton', 'mode'=>'MultiSelect'),
|
||||
array('widget_class' => 'SubPanelTopCreateButton'),
|
||||
),
|
||||
'refresh_page'=>1,
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
$layout_defs['EcmDocuments'] = array(
|
||||
'subpanel_setup' => array(
|
||||
/*
|
||||
'ecmdocuments' => array(
|
||||
'order' => 10,
|
||||
'module' => 'EcmDocuments',
|
||||
'sort_order' => 'asc',
|
||||
'sort_by' => 'no',
|
||||
'subpanel_name' => 'default-ecmdocuments',
|
||||
'get_subpanel_data' => 'ecmdocuments',
|
||||
'add_subpanel_data' => 'iddir',
|
||||
'title_key' => 'LBL_ECMDOCUMENTS_DASHLET_TITLE',
|
||||
),*/
|
||||
'contacts' => array(
|
||||
'order' => 20,
|
||||
'module' => 'Contacts',
|
||||
'sort_order' => 'asc',
|
||||
'sort_by' => 'last_name, first_name',
|
||||
'subpanel_name' => 'default',
|
||||
'get_subpanel_data' => 'contacts',
|
||||
'add_subpanel_data' => 'contact_id',
|
||||
'title_key' => 'LBL_CONTACTS_SUBPANEL_TITLE',
|
||||
$top_buttons => array(
|
||||
array('widget_class' => 'SubPanelTopSelectButton', 'mode'=>'MultiSelect'),
|
||||
array('widget_class' => 'SubPanelTopCreateButton'),
|
||||
),
|
||||
'refresh_page'=>1,
|
||||
),
|
||||
'accounts' => array(
|
||||
'order' => 30,
|
||||
'sort_order' => 'desc',
|
||||
'sort_by' => 'name',
|
||||
'module' => 'Accounts',
|
||||
'subpanel_name' => 'default',
|
||||
'get_subpanel_data' => 'accounts',
|
||||
'add_subpanel_data' => 'account_id',
|
||||
'title_key' => 'LBL_ACCOUNTS_SUBPANEL_TITLE',
|
||||
$top_buttons => array(
|
||||
array('widget_class' => 'SubPanelTopSelectButton', 'mode'=>'MultiSelect'),
|
||||
array('widget_class' => 'SubPanelTopCreateButton'),
|
||||
),
|
||||
'refresh_page'=>1,
|
||||
),
|
||||
'calls' => array(
|
||||
'order' => 40,
|
||||
'sort_order' => 'desc',
|
||||
'sort_by' => 'name',
|
||||
'module' => 'Calls',
|
||||
'subpanel_name' => 'ForEcmDocuments',
|
||||
'get_subpanel_data' => 'calls',
|
||||
'add_subpanel_data' => 'call_id',
|
||||
'title_key' => 'LBL_CALLS_SUBPANEL_TITLE',
|
||||
$top_buttons => array(
|
||||
array('widget_class' => 'SubPanelTopSelectButton', 'mode'=>'MultiSelect'),
|
||||
array('widget_class' => 'SubPanelTopCreateButton'),
|
||||
),
|
||||
'refresh_page'=>1,
|
||||
),
|
||||
'meetings' => array(
|
||||
'order' => 50,
|
||||
'sort_order' => 'desc',
|
||||
'sort_by' => 'name',
|
||||
'module' => 'Meetings',
|
||||
'subpanel_name' => 'ForEcmDocuments',
|
||||
'get_subpanel_data' => 'meetings',
|
||||
'add_subpanel_data' => 'meeting_id',
|
||||
'title_key' => 'LBL_MEETINGS_SUBPANEL_TITLE',
|
||||
$top_buttons => array(
|
||||
array('widget_class' => 'SubPanelTopSelectButton', 'mode'=>'MultiSelect'),
|
||||
array('widget_class' => 'SubPanelTopCreateButton'),
|
||||
),
|
||||
'refresh_page'=>1,
|
||||
),
|
||||
'tasks' => array(
|
||||
'order' => 60,
|
||||
'sort_order' => 'desc',
|
||||
'sort_by' => 'name',
|
||||
'module' => 'Tasks',
|
||||
'subpanel_name' => 'ForEcmDocuments',
|
||||
'get_subpanel_data' => 'tasks',
|
||||
'add_subpanel_data' => 'task_id',
|
||||
'title_key' => 'LBL_TASKS_SUBPANEL_TITLE',
|
||||
$top_buttons => array(
|
||||
array('widget_class' => 'SubPanelTopSelectButton', 'mode'=>'MultiSelect'),
|
||||
array('widget_class' => 'SubPanelTopCreateButton'),
|
||||
),
|
||||
'refresh_page'=>1,
|
||||
),
|
||||
'notes' => array(
|
||||
'order' => 70,
|
||||
'sort_order' => 'desc',
|
||||
'sort_by' => 'name',
|
||||
'module' => 'Notes',
|
||||
'subpanel_name' => 'ForEcmDocuments',
|
||||
'get_subpanel_data' => 'notes',
|
||||
'add_subpanel_data' => 'note_id',
|
||||
'title_key' => 'LBL_NOTES_SUBPANEL_TITLE',
|
||||
$top_buttons => array(
|
||||
array('widget_class' => 'SubPanelTopSelectButton', 'mode'=>'MultiSelect'),
|
||||
array('widget_class' => 'SubPanelTopCreateButton'),
|
||||
),
|
||||
'refresh_page'=>1,
|
||||
),
|
||||
)
|
||||
);
|
||||
}
|
||||
?>
|
||||
61
modules/EcmDocuments/metadata/SearchFields.php
Executable file
61
modules/EcmDocuments/metadata/SearchFields.php
Executable 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.
|
||||
********************************************************************************/
|
||||
$searchFields['EcmDocuments'] =
|
||||
array (
|
||||
'name' => array('query_type' => 'default'),
|
||||
'no' => array('query_type' => 'default'),
|
||||
'description' => 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'),
|
||||
);
|
||||
?>
|
||||
81
modules/EcmDocuments/metadata/additionalDetails.php
Executable file
81
modules/EcmDocuments/metadata/additionalDetails.php
Executable file
@@ -0,0 +1,81 @@
|
||||
<?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 additionalDetailsEcmDocument($fields) {
|
||||
static $mod_strings;
|
||||
global $app_strings;
|
||||
if(empty($mod_strings)) {
|
||||
global $current_language;
|
||||
$mod_strings = return_module_language($current_language, 'EcmDocuments');
|
||||
}
|
||||
|
||||
$overlib_string = '<div style="overflow:auto; height:100px; max-height:100px;">';
|
||||
|
||||
//BUILDER:START overlibstring
|
||||
if(!empty($fields['EKMT_DESCRIPTION'])){
|
||||
$overlib_string .= '<b>'. $mod_strings['LBL_EKMT_DESCRIPTION'] . '</b> <BR>' . $fields['EKMT_DESCRIPTION'];
|
||||
// if(strlen($fields['EKMT_DESCRIPTION']) > 300) $overlib_string .= '...';
|
||||
$overlib_string .= '<br>';
|
||||
}
|
||||
$overlib_string .= '</div>';
|
||||
|
||||
//BUILDER:END overlibstring
|
||||
|
||||
return array(
|
||||
'fieldToAddTo' => 'NAME',
|
||||
'string' => $overlib_string,
|
||||
'editLink' => "index.php?action=EditView&module=EcmDocuments&return_module=EcmDocuments&record={$fields['ID']}",
|
||||
'viewLink' => "index.php?action=DetailView&module=EcmDocuments&return_module=EcmDocuments&record={$fields['ID']}");
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
89
modules/EcmDocuments/metadata/listviewdefs.php
Executable file
89
modules/EcmDocuments/metadata/listviewdefs.php
Executable file
@@ -0,0 +1,89 @@
|
||||
<?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['EcmDocuments'] = array(
|
||||
'NO' => array(
|
||||
'width' => '7',
|
||||
'default' => true,
|
||||
'customCode' => '<div id="no{$ID}"></div><script language="javascript">mintajaxget("modules/EcmDocuments/getlinkedpath.php?record={$ID}","no{$ID}");</script>',
|
||||
'label' => 'LBL_NO'),
|
||||
|
||||
'NAME' => array(
|
||||
'width' => '30',
|
||||
'customCode' => '<div id="name{$ID}"></div><script language="javascript">mintajaxget("modules/EcmDocuments/getlinkedpath.php?record={$ID}&names=1","name{$ID}");</script>',
|
||||
'label' => 'LBL_NAME',
|
||||
'link' => true,
|
||||
'default' => true),
|
||||
|
||||
'DESCRIPTION' => array(
|
||||
'width' => '10',
|
||||
//'default' => true,
|
||||
'label' => 'LBL_EKMT_DESCRIPTION'),
|
||||
|
||||
|
||||
'DATE_MODIFIED' => array(
|
||||
'width' => '5',
|
||||
'label' => 'LBL_DATE_MODIFIED'),
|
||||
'DATE_ENTERED' => array(
|
||||
'width' => '5',
|
||||
'label' => 'LBL_DATE_ENTERED'),
|
||||
'CREATED_BY_NAME' => array(
|
||||
'width' => '10',
|
||||
'label' => 'LBL_CREATED'),
|
||||
'ASSIGNED_USER_NAME' => array(
|
||||
'width' => '2',
|
||||
'label' => 'LBL_LIST_ASSIGNED_USER',
|
||||
'default' => true),
|
||||
'MODIFIED_USER_NAME' => array(
|
||||
'width' => '2',
|
||||
'label' => 'LBL_MODIFIED')
|
||||
);
|
||||
?>
|
||||
60
modules/EcmDocuments/metadata/popupdefs.php
Executable file
60
modules/EcmDocuments/metadata/popupdefs.php
Executable 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' => 'EcmDocument',
|
||||
'varName' => 'ECMDOCUMENT',
|
||||
'orderBy' => 'ecmdocuments.name',
|
||||
'whereClauses' => array(
|
||||
'name' => 'ecmdocuments.name',
|
||||
),
|
||||
'searchInputs' => array('name', 'name')
|
||||
);
|
||||
?>
|
||||
76
modules/EcmDocuments/metadata/studio.php
Executable file
76
modules/EcmDocuments/metadata/studio.php
Executable 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']['EcmDocuments'] = array(
|
||||
'LBL_DETAILVIEW'=>array(
|
||||
'template' => 'xtpl',
|
||||
'template_file' => 'modules/EcmDocuments/DetailView.html',
|
||||
'php_file' => 'modules/EcmDocuments/DetailView.php',
|
||||
'type' => 'DetailView',
|
||||
),
|
||||
'LBL_EDITVIEW'=>array(
|
||||
'template' => 'xtpl',
|
||||
'template_file' => 'modules/EcmDocuments/EditView.html',
|
||||
'php_file' => 'modules/EcmDocuments/EditView.php',
|
||||
'type' => 'EditView',
|
||||
),
|
||||
'LBL_LISTVIEW'=>array(
|
||||
'template' => 'listview',
|
||||
'meta_file' => 'modules/EcmDocuments/listviewdefs.php',
|
||||
'type' => 'ListView',
|
||||
),
|
||||
'LBL_SEARCHFORM'=>array(
|
||||
'template' => 'xtpl',
|
||||
'template_file' => 'modules/EcmDocuments/SearchForm.html',
|
||||
'php_file' => 'modules/EcmDocuments/ListView.php',
|
||||
'type' => 'SearchForm',
|
||||
),
|
||||
|
||||
);
|
||||
116
modules/EcmDocuments/metadata/subpaneldefs.php
Executable file
116
modules/EcmDocuments/metadata/subpaneldefs.php
Executable file
@@ -0,0 +1,116 @@
|
||||
<?php
|
||||
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
|
||||
/**
|
||||
|
||||
* Layout definition for Accounts
|
||||
|
||||
*
|
||||
|
||||
* SugarCRM is a customer relationship management program developed by
|
||||
|
||||
* SugarCRM, Inc. Copyright (C) 2004 - 2007 SugarCRM Inc.
|
||||
|
||||
*
|
||||
|
||||
* This program is free software; you can redistribute it and/or modify it under
|
||||
|
||||
* the terms of the GNU General Public License version 3 as published by the
|
||||
|
||||
* Free Software Foundation with the addition of the following permission added
|
||||
|
||||
* to Section 15 as permitted in Section 7(a): FOR ANY PART OF THE COVERED WORK
|
||||
|
||||
* IN WHICH THE COPYRIGHT IS OWNED BY SUGARCRM, SUGARCRM DISCLAIMS THE WARRANTY
|
||||
|
||||
* OF NON INFRINGEMENT OF THIRD PARTY RIGHTS.
|
||||
|
||||
*
|
||||
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||
|
||||
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||
|
||||
* details.
|
||||
|
||||
*
|
||||
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
|
||||
* this program; if not, see http://www.gnu.org/licenses or write to the Free
|
||||
|
||||
* Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
|
||||
|
||||
* 02110-1301 USA.
|
||||
|
||||
*
|
||||
|
||||
* You can contact SugarCRM, Inc. headquarters at 10050 North Wolfe Road,
|
||||
|
||||
* SW2-130, Cupertino, CA 95014, USA. or at email address contact@sugarcrm.com.
|
||||
|
||||
*
|
||||
|
||||
* The interactive user interfaces in modified source and object code versions
|
||||
|
||||
* of this program must display Appropriate Legal Notices, as required under
|
||||
|
||||
* Section 5 of the GNU General Public License version 3.
|
||||
|
||||
*
|
||||
|
||||
* In accordance with Section 7(b) of the GNU General Public License version 3,
|
||||
|
||||
* these Appropriate Legal Notices must retain the display of the "Powered by
|
||||
|
||||
* SugarCRM" logo. If the display of the logo is not reasonably feasible for
|
||||
|
||||
* technical reasons, the Appropriate Legal Notices must display the words
|
||||
|
||||
* "Powered by SugarCRM".
|
||||
|
||||
*/
|
||||
|
||||
|
||||
$layout_defs['EcmDocuments']['subpanel_setup'] = array (
|
||||
|
||||
|
||||
'accounts' => array (
|
||||
'order' => 15,
|
||||
'module' => 'Accounts',
|
||||
'sort_order' => 'asc',
|
||||
'sort_by' => 'date_modified',
|
||||
'get_subpanel_data' => 'accounts',
|
||||
'add_subpanel_data' => 'account_id',
|
||||
'subpanel_name' => 'default',
|
||||
'title_key' => 'LBL_ACCOUNTS_SUBPANEL_TITLE',
|
||||
'top_buttons' => array(
|
||||
array('widget_class' => 'SubPanelTopSelectButton'),
|
||||
array('widget_class' => 'SubPanelTopCreateButton'),
|
||||
),
|
||||
),
|
||||
|
||||
'contacts' => array (
|
||||
'order' => 15,
|
||||
'module' => 'Contacts',
|
||||
'sort_order' => 'asc',
|
||||
'sort_by' => 'date_modified',
|
||||
'get_subpanel_data' => 'contacts',
|
||||
'add_subpanel_data' => 'account_id',
|
||||
'subpanel_name' => 'default',
|
||||
'title_key' => 'LBL_CONTACTS_SUBPANEL_TITLE',
|
||||
'top_buttons' => array(
|
||||
array('widget_class' => 'SubPanelTopSelectButton'),
|
||||
array('widget_class' => 'SubPanelTopCreateButton'),
|
||||
),
|
||||
),
|
||||
|
||||
);
|
||||
|
||||
|
||||
|
||||
?>
|
||||
|
||||
95
modules/EcmDocuments/metadata/subpanels/default-ecmdocuments.php
Executable file
95
modules/EcmDocuments/metadata/subpanels/default-ecmdocuments.php
Executable file
@@ -0,0 +1,95 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/*******************************************************************************
|
||||
* Subpanel Layout definition for SimpleModules
|
||||
*******************************************************************************/
|
||||
if($_SESSION['authenticated_user_id']!=1)
|
||||
{
|
||||
$wh=" and (";
|
||||
$z="select id from ecmdocuments where iddir='".$_REQUEST['record']."'";
|
||||
$w=mysql_query($z);
|
||||
$i=0;
|
||||
while($r=mysql_fetch_array($w))
|
||||
{
|
||||
$z1="select id from ecmdocuments_permissions where iddir='".$r['id']."' and userid='".$_SESSION['authenticated_user_id']."'";
|
||||
$w1=mysql_query($z1);
|
||||
$r1=mysql_fetch_array($w1);
|
||||
if($i==0)$or="";
|
||||
else $or=" or ";
|
||||
if(mysql_num_rows($w1)>0)
|
||||
{
|
||||
$wh.=$or."ecmdocuments.id='".$r['id']."'";
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
$wh.=")";
|
||||
}
|
||||
if($wh==" and ()")$wh="";
|
||||
$subpanel_layout = array(
|
||||
'top_buttons' => array(
|
||||
//array('widget_class' => 'SubPanelTopCreateButton'),
|
||||
//array('widget_class' => 'SubPanelTopSelectButton', 'popup_module' => 'EcmDocuments'),
|
||||
),
|
||||
|
||||
'where' => 'isdir=1'.$wh,
|
||||
|
||||
'list_fields' => array(
|
||||
// 'simplemodule_number' =>array(
|
||||
// 'vname' => 'LBL_LIST_NUMBER',
|
||||
// 'width' => '5%',
|
||||
// ),
|
||||
'no'=>array(
|
||||
'vname' => 'LBL_LIST_NAME',
|
||||
'widget_class' => 'SubPanelDetailViewLinkEcmDocuments',
|
||||
'width' => '50%',
|
||||
'module' => 'EcmDocuments',
|
||||
),
|
||||
/*
|
||||
'path'=>array(
|
||||
'vname' => 'LBL_LIST_PATH',
|
||||
'widget_class' => 'SubPanelDetailViewLink',
|
||||
'width' => '20%',
|
||||
'module' => 'EcmDocuments',
|
||||
),
|
||||
*/
|
||||
// 'status'=>array(
|
||||
// 'vname' => 'LBL_LIST_STATUS',
|
||||
// 'width' => '15%',
|
||||
// ),
|
||||
// 'type'=>array(
|
||||
// 'vname' => 'LBL_LIST_TYPE',
|
||||
// 'width' => '15%',
|
||||
// ),
|
||||
// 'priority'=>array(
|
||||
// 'vname' => 'LBL_LIST_PRIORITY',
|
||||
// 'width' => '11%',
|
||||
// ),
|
||||
'assigned_user_name' => array (
|
||||
'name' => 'assigned_user_name',
|
||||
'vname' => 'LBL_LIST_ASSIGNED_TO_NAME',
|
||||
),
|
||||
|
||||
'date_modified' => array (
|
||||
'name' => 'date_modified',
|
||||
'vname' => 'Date Modified',
|
||||
),
|
||||
'date_entered' => array (
|
||||
'name' => 'date_entered',
|
||||
'vname' => 'Date Created',
|
||||
),
|
||||
|
||||
/*
|
||||
'edit_button'=>array(
|
||||
'widget_class' => 'SubPanelEditButton',
|
||||
'module' => 'EcmDocuments',
|
||||
'width' => '4%',
|
||||
),
|
||||
'remove_button'=>array(
|
||||
'widget_class' => 'SubPanelRemoveButton',
|
||||
'module' => 'EcmDocuments',
|
||||
'width' => '5%',
|
||||
),*/
|
||||
),
|
||||
);
|
||||
|
||||
?>
|
||||
72
modules/EcmDocuments/metadata/subpanels/default.php
Executable file
72
modules/EcmDocuments/metadata/subpanels/default.php
Executable file
@@ -0,0 +1,72 @@
|
||||
<?php
|
||||
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');
|
||||
/*******************************************************************************
|
||||
* Subpanel Layout definition for SimpleModules
|
||||
*******************************************************************************/
|
||||
|
||||
$subpanel_layout = array(
|
||||
'top_buttons' => array(
|
||||
//array('widget_class' => 'SubPanelTopCreateButton'),
|
||||
//array('widget_class' => 'SubPanelTopSelectButton', 'popup_module' => 'EcmDocuments'),
|
||||
),
|
||||
|
||||
'where' => 'isdir=1',
|
||||
|
||||
'list_fields' => array(
|
||||
// 'simplemodule_number' =>array(
|
||||
// 'vname' => 'LBL_LIST_NUMBER',
|
||||
// 'width' => '5%',
|
||||
// ),
|
||||
'no'=>array(
|
||||
'vname' => 'LBL_LIST_NAME',
|
||||
'widget_class' => 'SubPanelDetailViewLinkEcmDocuments',
|
||||
'width' => '50%',
|
||||
'module' => 'EcmDocuments',
|
||||
),
|
||||
'path'=>array(
|
||||
'vname' => 'LBL_LIST_PATH',
|
||||
'widget_class' => 'SubPanelPathEcmDocuments',
|
||||
'width' => '20%',
|
||||
'module' => 'EcmDocuments',
|
||||
),
|
||||
// 'status'=>array(
|
||||
// 'vname' => 'LBL_LIST_STATUS',
|
||||
// 'width' => '15%',
|
||||
// ),
|
||||
// 'type'=>array(
|
||||
// 'vname' => 'LBL_LIST_TYPE',
|
||||
// 'width' => '15%',
|
||||
// ),
|
||||
// 'priority'=>array(
|
||||
// 'vname' => 'LBL_LIST_PRIORITY',
|
||||
// 'width' => '11%',
|
||||
// ),
|
||||
'assigned_user_name' => array (
|
||||
'name' => 'assigned_user_name',
|
||||
'vname' => 'LBL_LIST_ASSIGNED_TO_NAME',
|
||||
),
|
||||
/*
|
||||
'date_modified' => array (
|
||||
'name' => 'date_modified',
|
||||
'vname' => 'Date Modified',
|
||||
),
|
||||
'date_entered' => array (
|
||||
'name' => 'date_entered',
|
||||
'vname' => 'Date Created',
|
||||
),
|
||||
*/
|
||||
/*
|
||||
'edit_button'=>array(
|
||||
'widget_class' => 'SubPanelEditButton',
|
||||
'module' => 'EcmDocuments',
|
||||
'width' => '4%',
|
||||
),
|
||||
'remove_button'=>array(
|
||||
'widget_class' => 'SubPanelRemoveButton',
|
||||
'module' => 'EcmDocuments',
|
||||
'width' => '5%',
|
||||
),*/
|
||||
),
|
||||
);
|
||||
|
||||
?>
|
||||
239
modules/EcmDocuments/mimetype.php
Executable file
239
modules/EcmDocuments/mimetype.php
Executable file
@@ -0,0 +1,239 @@
|
||||
<?php
|
||||
/**
|
||||
Copyright (C) 2002 Jason Sheets <jsheets@shadonet.com>.
|
||||
All rights reserved.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
modification, are permitted provided that the following conditions
|
||||
are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright
|
||||
notice, this list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright
|
||||
notice, this list of conditions and the following disclaimer in the
|
||||
documentation and/or other materials provided with the distribution.
|
||||
|
||||
3. Neither the name of the project nor the names of its contributors
|
||||
may be used to endorse or promote products derived from this software
|
||||
without specific prior written permission.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
|
||||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGE.
|
||||
**/
|
||||
|
||||
/**
|
||||
Name: PHP MimeType Class
|
||||
|
||||
Version: 1.0
|
||||
Date Released: 10/20/02
|
||||
|
||||
Description: This class allows a PHP script to determine the mime type
|
||||
a file based on the file extension. This class is handy for PHP versions
|
||||
without the benefit of other tools to determine the mime type. The class
|
||||
defaults to octet-stream so if the file type is not recognized the user
|
||||
is presented with a file download prompt.
|
||||
|
||||
NOTES: The mime types for this version are based on Apache 1.3.27
|
||||
mime types may change or need to be added in the future, the mime types
|
||||
are stored in an array so that an awk or other script can automatically
|
||||
generate the code to make the array.
|
||||
|
||||
Usage:
|
||||
|
||||
First an instance of the mimetype class must be created, then the
|
||||
getType method should be called with the filename. It will return
|
||||
the mime type, an example follows.
|
||||
|
||||
Example:
|
||||
|
||||
$mimetype = new mimetype();
|
||||
print $mimetype->getType('acrobat.pdf');
|
||||
|
||||
Author: Jason Sheets <jsheets@shadonet.com>
|
||||
|
||||
License: This script is distributed under the BSD License, you are free
|
||||
to use, or modify it however you like. If you find this script useful please
|
||||
e-mail me.
|
||||
**/
|
||||
|
||||
class mimetype {
|
||||
function getType($filename) {
|
||||
// get base name of the filename provided by user
|
||||
$filename = basename($filename);
|
||||
|
||||
// break file into parts seperated by .
|
||||
$filename = explode('.', $filename);
|
||||
|
||||
// take the last part of the file to get the file extension
|
||||
$filename = $filename[count($filename)-1];
|
||||
|
||||
// find mime type
|
||||
return $this->privFindType($filename);
|
||||
}
|
||||
|
||||
function privFindType($ext) {
|
||||
// create mimetypes array
|
||||
$mimetypes = $this->privBuildMimeArray();
|
||||
|
||||
// return mime type for extension
|
||||
if (isset($mimetypes[$ext])) {
|
||||
return $mimetypes[$ext];
|
||||
// if the extension wasn't found return octet-stream
|
||||
} else {
|
||||
return 'application/octet-stream';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function privBuildMimeArray() {
|
||||
return array(
|
||||
"ez" => "application/andrew-inset",
|
||||
"hqx" => "application/mac-binhex40",
|
||||
"cpt" => "application/mac-compactpro",
|
||||
"doc" => "application/msword",
|
||||
"bin" => "application/octet-stream",
|
||||
"dms" => "application/octet-stream",
|
||||
"lha" => "application/octet-stream",
|
||||
"lzh" => "application/octet-stream",
|
||||
"exe" => "application/octet-stream",
|
||||
"class" => "application/octet-stream",
|
||||
"so" => "application/octet-stream",
|
||||
"dll" => "application/octet-stream",
|
||||
"oda" => "application/oda",
|
||||
"pdf" => "application/pdf",
|
||||
"ai" => "application/postscript",
|
||||
"eps" => "application/postscript",
|
||||
"ps" => "application/postscript",
|
||||
"smi" => "application/smil",
|
||||
"smil" => "application/smil",
|
||||
"wbxml" => "application/vnd.wap.wbxml",
|
||||
"wmlc" => "application/vnd.wap.wmlc",
|
||||
"wmlsc" => "application/vnd.wap.wmlscriptc",
|
||||
"bcpio" => "application/x-bcpio",
|
||||
"vcd" => "application/x-cdlink",
|
||||
"pgn" => "application/x-chess-pgn",
|
||||
"cpio" => "application/x-cpio",
|
||||
"csh" => "application/x-csh",
|
||||
"dcr" => "application/x-director",
|
||||
"dir" => "application/x-director",
|
||||
"dxr" => "application/x-director",
|
||||
"dvi" => "application/x-dvi",
|
||||
"spl" => "application/x-futuresplash",
|
||||
"gtar" => "application/x-gtar",
|
||||
"hdf" => "application/x-hdf",
|
||||
"js" => "application/x-javascript",
|
||||
"skp" => "application/x-koan",
|
||||
"skd" => "application/x-koan",
|
||||
"skt" => "application/x-koan",
|
||||
"skm" => "application/x-koan",
|
||||
"latex" => "application/x-latex",
|
||||
"nc" => "application/x-netcdf",
|
||||
"cdf" => "application/x-netcdf",
|
||||
"sh" => "application/x-sh",
|
||||
"shar" => "application/x-shar",
|
||||
"swf" => "application/x-shockwave-flash",
|
||||
"sit" => "application/x-stuffit",
|
||||
"sv4cpio" => "application/x-sv4cpio",
|
||||
"sv4crc" => "application/x-sv4crc",
|
||||
"tar" => "application/x-tar",
|
||||
"tcl" => "application/x-tcl",
|
||||
"tex" => "application/x-tex",
|
||||
"texinfo" => "application/x-texinfo",
|
||||
"texi" => "application/x-texinfo",
|
||||
"t" => "application/x-troff",
|
||||
"tr" => "application/x-troff",
|
||||
"roff" => "application/x-troff",
|
||||
"man" => "application/x-troff-man",
|
||||
"me" => "application/x-troff-me",
|
||||
"ms" => "application/x-troff-ms",
|
||||
"ustar" => "application/x-ustar",
|
||||
"src" => "application/x-wais-source",
|
||||
"xhtml" => "application/xhtml+xml",
|
||||
"xht" => "application/xhtml+xml",
|
||||
"zip" => "application/zip",
|
||||
"au" => "audio/basic",
|
||||
"snd" => "audio/basic",
|
||||
"mid" => "audio/midi",
|
||||
"midi" => "audio/midi",
|
||||
"kar" => "audio/midi",
|
||||
"mpga" => "audio/mpeg",
|
||||
"mp2" => "audio/mpeg",
|
||||
"mp3" => "audio/mpeg",
|
||||
"aif" => "audio/x-aiff",
|
||||
"aiff" => "audio/x-aiff",
|
||||
"aifc" => "audio/x-aiff",
|
||||
"m3u" => "audio/x-mpegurl",
|
||||
"ram" => "audio/x-pn-realaudio",
|
||||
"rm" => "audio/x-pn-realaudio",
|
||||
"rpm" => "audio/x-pn-realaudio-plugin",
|
||||
"ra" => "audio/x-realaudio",
|
||||
"wav" => "audio/x-wav",
|
||||
"pdb" => "chemical/x-pdb",
|
||||
"xyz" => "chemical/x-xyz",
|
||||
"bmp" => "image/bmp",
|
||||
"gif" => "image/gif",
|
||||
"ief" => "image/ief",
|
||||
"jpeg" => "image/jpeg",
|
||||
"jpg" => "image/jpeg",
|
||||
"jpe" => "image/jpeg",
|
||||
"png" => "image/png",
|
||||
"tiff" => "image/tiff",
|
||||
"tif" => "image/tif",
|
||||
"djvu" => "image/vnd.djvu",
|
||||
"djv" => "image/vnd.djvu",
|
||||
"wbmp" => "image/vnd.wap.wbmp",
|
||||
"ras" => "image/x-cmu-raster",
|
||||
"pnm" => "image/x-portable-anymap",
|
||||
"pbm" => "image/x-portable-bitmap",
|
||||
"pgm" => "image/x-portable-graymap",
|
||||
"ppm" => "image/x-portable-pixmap",
|
||||
"rgb" => "image/x-rgb",
|
||||
"xbm" => "image/x-xbitmap",
|
||||
"xpm" => "image/x-xpixmap",
|
||||
"xwd" => "image/x-windowdump",
|
||||
"igs" => "model/iges",
|
||||
"iges" => "model/iges",
|
||||
"msh" => "model/mesh",
|
||||
"mesh" => "model/mesh",
|
||||
"silo" => "model/mesh",
|
||||
"wrl" => "model/vrml",
|
||||
"vrml" => "model/vrml",
|
||||
"css" => "text/css",
|
||||
"html" => "text/html",
|
||||
"htm" => "text/html",
|
||||
"asc" => "text/plain",
|
||||
"txt" => "text/plain",
|
||||
"rtx" => "text/richtext",
|
||||
"rtf" => "text/rtf",
|
||||
"sgml" => "text/sgml",
|
||||
"sgm" => "text/sgml",
|
||||
"tsv" => "text/tab-seperated-values",
|
||||
"wml" => "text/vnd.wap.wml",
|
||||
"wmls" => "text/vnd.wap.wmlscript",
|
||||
"etx" => "text/x-setext",
|
||||
"xml" => "text/xml",
|
||||
"xsl" => "text/xml",
|
||||
"mpeg" => "video/mpeg",
|
||||
"mpg" => "video/mpeg",
|
||||
"mpe" => "video/mpeg",
|
||||
"qt" => "video/quicktime",
|
||||
"mov" => "video/quicktime",
|
||||
"mxu" => "video/vnd.mpegurl",
|
||||
"avi" => "video/x-msvideo",
|
||||
"movie" => "video/x-sgi-movie",
|
||||
"ice" => "x-conference-xcooltalk"
|
||||
);
|
||||
}
|
||||
}
|
||||
?>
|
||||
1667
modules/EcmDocuments/phpmailer/class.phpmailer.php
Executable file
1667
modules/EcmDocuments/phpmailer/class.phpmailer.php
Executable file
File diff suppressed because it is too large
Load Diff
391
modules/EcmDocuments/phpmailer/class.pop3.php
Executable file
391
modules/EcmDocuments/phpmailer/class.pop3.php
Executable file
@@ -0,0 +1,391 @@
|
||||
<?php
|
||||
/*~ class.pop3.php
|
||||
.---------------------------------------------------------------------------.
|
||||
| Software: PHPMailer - PHP email class |
|
||||
| Version: 2.0.0 rc2 |
|
||||
| Contact: via sourceforge.net support pages (also www.codeworxtech.com) |
|
||||
| Info: http://phpmailer.sourceforge.net |
|
||||
| Support: http://sourceforge.net/projects/phpmailer/ |
|
||||
| ------------------------------------------------------------------------- |
|
||||
| Author: Andy Prevost (project admininistrator) |
|
||||
| Author: Brent R. Matzelle (original founder) |
|
||||
| Copyright (c) 2004-2007, Andy Prevost. All Rights Reserved. |
|
||||
| Copyright (c) 2001-2003, Brent R. Matzelle |
|
||||
| ------------------------------------------------------------------------- |
|
||||
| License: Distributed under the Lesser General Public License (LGPL) |
|
||||
| http://www.gnu.org/copyleft/lesser.html |
|
||||
| This program is distributed in the hope that it will be useful - WITHOUT |
|
||||
| ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
||||
| FITNESS FOR A PARTICULAR PURPOSE. |
|
||||
| ------------------------------------------------------------------------- |
|
||||
| We offer a number of paid services (www.codeworxtech.com): |
|
||||
| - Web Hosting on highly optimized fast and secure servers |
|
||||
| - Technology Consulting |
|
||||
| - Oursourcing (highly qualified programmers and graphic designers) |
|
||||
'---------------------------------------------------------------------------'
|
||||
|
||||
/**
|
||||
* POP Before SMTP Authentication Class
|
||||
* Version 1.0
|
||||
*
|
||||
* Author: Richard Davey (rich@corephp.co.uk)
|
||||
* License: LGPL, see PHPMailer License
|
||||
*
|
||||
* Specifically for PHPMailer to allow POP before SMTP authentication.
|
||||
* Does not yet work with APOP - if you have an APOP account, contact me
|
||||
* and we can test changes to this script.
|
||||
*
|
||||
* This class is based on the structure of the SMTP class by Chris Ryan
|
||||
*
|
||||
* This class is rfc 1939 compliant and implements all the commands
|
||||
* required for POP3 connection, authentication and disconnection.
|
||||
*
|
||||
* @package PHPMailer
|
||||
* @author Richard Davey
|
||||
*/
|
||||
|
||||
class POP3 {
|
||||
/**
|
||||
* Default POP3 port
|
||||
* @var int
|
||||
*/
|
||||
public $POP3_PORT = 110;
|
||||
|
||||
/**
|
||||
* Default Timeout
|
||||
* @var int
|
||||
*/
|
||||
public $POP3_TIMEOUT = 30;
|
||||
|
||||
/**
|
||||
* POP3 Carriage Return + Line Feed
|
||||
* @var string
|
||||
*/
|
||||
public $CRLF = "\r\n";
|
||||
|
||||
/**
|
||||
* Displaying Debug warnings? (0 = now, 1+ = yes)
|
||||
* @var int
|
||||
*/
|
||||
public $do_debug = 2;
|
||||
|
||||
/**
|
||||
* POP3 Mail Server
|
||||
* @var string
|
||||
*/
|
||||
public $host;
|
||||
|
||||
/**
|
||||
* POP3 Port
|
||||
* @var int
|
||||
*/
|
||||
public $port;
|
||||
|
||||
/**
|
||||
* POP3 Timeout Value
|
||||
* @var int
|
||||
*/
|
||||
public $tval;
|
||||
|
||||
/**
|
||||
* POP3 Username
|
||||
* @var string
|
||||
*/
|
||||
public $username;
|
||||
|
||||
/**
|
||||
* POP3 Password
|
||||
* @var string
|
||||
*/
|
||||
public $password;
|
||||
|
||||
/**#@+
|
||||
* @access private
|
||||
*/
|
||||
private $pop_conn;
|
||||
private $connected;
|
||||
private $error; // Error log array
|
||||
/**#@-*/
|
||||
|
||||
/**
|
||||
* Constructor, sets the initial values
|
||||
*
|
||||
* @return POP3
|
||||
*/
|
||||
function __construct() {
|
||||
$this->pop_conn = 0;
|
||||
$this->connected = false;
|
||||
$this->error = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Combination of public events - connect, login, disconnect
|
||||
*
|
||||
* @param string $host
|
||||
* @param integer $port
|
||||
* @param integer $tval
|
||||
* @param string $username
|
||||
* @param string $password
|
||||
*/
|
||||
function Authorise ($host, $port = false, $tval = false, $username, $password, $debug_level = 0) {
|
||||
$this->host = $host;
|
||||
|
||||
// If no port value is passed, retrieve it
|
||||
if ($port == false) {
|
||||
$this->port = $this->POP3_PORT;
|
||||
} else {
|
||||
$this->port = $port;
|
||||
}
|
||||
|
||||
// If no port value is passed, retrieve it
|
||||
if ($tval == false) {
|
||||
$this->tval = $this->POP3_TIMEOUT;
|
||||
} else {
|
||||
$this->tval = $tval;
|
||||
}
|
||||
|
||||
$this->do_debug = $debug_level;
|
||||
$this->username = $username;
|
||||
$this->password = $password;
|
||||
|
||||
// Refresh the error log
|
||||
$this->error = null;
|
||||
|
||||
// Connect
|
||||
$result = $this->Connect($this->host, $this->port, $this->tval);
|
||||
|
||||
if ($result) {
|
||||
$login_result = $this->Login($this->username, $this->password);
|
||||
|
||||
if ($login_result) {
|
||||
$this->Disconnect();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// We need to disconnect regardless if the login succeeded
|
||||
$this->Disconnect();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Connect to the POP3 server
|
||||
*
|
||||
* @param string $host
|
||||
* @param integer $port
|
||||
* @param integer $tval
|
||||
* @return boolean
|
||||
*/
|
||||
function Connect ($host, $port = false, $tval = 30) {
|
||||
// Are we already connected?
|
||||
if ($this->connected) {
|
||||
return true;
|
||||
}
|
||||
|
||||
/*
|
||||
On Windows this will raise a PHP Warning error if the hostname doesn't exist.
|
||||
Rather than supress it with @fsockopen, let's capture it cleanly instead
|
||||
*/
|
||||
|
||||
set_error_handler(array(&$this, 'catchWarning'));
|
||||
|
||||
// Connect to the POP3 server
|
||||
$this->pop_conn = fsockopen($host, // POP3 Host
|
||||
$port, // Port #
|
||||
$errno, // Error Number
|
||||
$errstr, // Error Message
|
||||
$tval); // Timeout (seconds)
|
||||
|
||||
// Restore the error handler
|
||||
restore_error_handler();
|
||||
|
||||
// Does the Error Log now contain anything?
|
||||
if ($this->error && $this->do_debug >= 1) {
|
||||
$this->displayErrors();
|
||||
}
|
||||
|
||||
// Did we connect?
|
||||
if ($this->pop_conn == false) {
|
||||
// It would appear not...
|
||||
$this->error = array(
|
||||
'error' => "Failed to connect to server $host on port $port",
|
||||
'errno' => $errno,
|
||||
'errstr' => $errstr
|
||||
);
|
||||
|
||||
if ($this->do_debug >= 1) {
|
||||
$this->displayErrors();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
// Increase the stream time-out
|
||||
|
||||
// Check for PHP 4.3.0 or later
|
||||
if (version_compare(phpversion(), '4.3.0', 'ge')) {
|
||||
stream_set_timeout($this->pop_conn, $tval, 0);
|
||||
} else {
|
||||
// Does not work on Windows
|
||||
if (substr(PHP_OS, 0, 3) !== 'WIN') {
|
||||
socket_set_timeout($this->pop_conn, $tval, 0);
|
||||
}
|
||||
}
|
||||
|
||||
// Get the POP3 server response
|
||||
$pop3_response = $this->getResponse();
|
||||
|
||||
// Check for the +OK
|
||||
if ($this->checkResponse($pop3_response)) {
|
||||
// The connection is established and the POP3 server is talking
|
||||
$this->connected = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Login to the POP3 server (does not support APOP yet)
|
||||
*
|
||||
* @param string $username
|
||||
* @param string $password
|
||||
* @return boolean
|
||||
*/
|
||||
function Login ($username = '', $password = '') {
|
||||
if ($this->connected == false) {
|
||||
$this->error = 'Not connected to POP3 server';
|
||||
|
||||
if ($this->do_debug >= 1) {
|
||||
$this->displayErrors();
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($username)) {
|
||||
$username = $this->username;
|
||||
}
|
||||
|
||||
if (empty($password)) {
|
||||
$password = $this->password;
|
||||
}
|
||||
|
||||
$pop_username = "USER $username" . $this->CRLF;
|
||||
$pop_password = "PASS $password" . $this->CRLF;
|
||||
|
||||
// Send the Username
|
||||
$this->sendString($pop_username);
|
||||
$pop3_response = $this->getResponse();
|
||||
|
||||
if ($this->checkResponse($pop3_response)) {
|
||||
// Send the Password
|
||||
$this->sendString($pop_password);
|
||||
$pop3_response = $this->getResponse();
|
||||
|
||||
if ($this->checkResponse($pop3_response)) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Disconnect from the POP3 server
|
||||
*/
|
||||
function Disconnect () {
|
||||
$this->sendString('QUIT');
|
||||
|
||||
fclose($this->pop_conn);
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////
|
||||
// Private Methods
|
||||
/////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
* Get the socket response back.
|
||||
* $size is the maximum number of bytes to retrieve
|
||||
*
|
||||
* @param integer $size
|
||||
* @return string
|
||||
*/
|
||||
function getResponse ($size = 128) {
|
||||
$pop3_response = fgets($this->pop_conn, $size);
|
||||
|
||||
return $pop3_response;
|
||||
}
|
||||
|
||||
/**
|
||||
* Send a string down the open socket connection to the POP3 server
|
||||
*
|
||||
* @param string $string
|
||||
* @return integer
|
||||
*/
|
||||
function sendString ($string) {
|
||||
$bytes_sent = fwrite($this->pop_conn, $string, strlen($string));
|
||||
|
||||
return $bytes_sent;
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks the POP3 server response for +OK or -ERR
|
||||
*
|
||||
* @param string $string
|
||||
* @return boolean
|
||||
*/
|
||||
function checkResponse ($string) {
|
||||
if (substr($string, 0, 3) !== '+OK') {
|
||||
$this->error = array(
|
||||
'error' => "Server reported an error: $string",
|
||||
'errno' => 0,
|
||||
'errstr' => ''
|
||||
);
|
||||
|
||||
if ($this->do_debug >= 1) {
|
||||
$this->displayErrors();
|
||||
}
|
||||
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* If debug is enabled, display the error message array
|
||||
*
|
||||
*/
|
||||
function displayErrors () {
|
||||
echo '<pre>';
|
||||
|
||||
foreach ($this->error as $single_error) {
|
||||
print_r($single_error);
|
||||
}
|
||||
|
||||
echo '</pre>';
|
||||
}
|
||||
|
||||
/**
|
||||
* Takes over from PHP for the socket warning handler
|
||||
*
|
||||
* @param integer $errno
|
||||
* @param string $errstr
|
||||
* @param string $errfile
|
||||
* @param integer $errline
|
||||
*/
|
||||
function catchWarning ($errno, $errstr, $errfile, $errline) {
|
||||
$this->error[] = array(
|
||||
'error' => "Connecting to the POP3 server raised a PHP warning: ",
|
||||
'errno' => $errno,
|
||||
'errstr' => $errstr
|
||||
);
|
||||
}
|
||||
|
||||
// End of class
|
||||
}
|
||||
?>
|
||||
1065
modules/EcmDocuments/phpmailer/class.smtp.php
Executable file
1065
modules/EcmDocuments/phpmailer/class.smtp.php
Executable file
File diff suppressed because it is too large
Load Diff
39
modules/EcmDocuments/phpmailer/examples/pop3_before_smtp_test.php
Executable file
39
modules/EcmDocuments/phpmailer/examples/pop3_before_smtp_test.php
Executable file
@@ -0,0 +1,39 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>POP before SMTP Test</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<pre>
|
||||
<?php
|
||||
require 'class.phpmailer.php';
|
||||
require 'class.pop3.php';
|
||||
|
||||
$pop = new POP3();
|
||||
$pop->Authorise('pop3.example.com', 110, 30, 'mailer', 'password', 1);
|
||||
|
||||
$mail = new PHPMailer();
|
||||
|
||||
$mail->IsSMTP();
|
||||
$mail->SMTPDebug = 2;
|
||||
$mail->IsHTML(false);
|
||||
|
||||
$mail->Host = 'relay.example.com';
|
||||
|
||||
$mail->From = 'mailer@example.com';
|
||||
$mail->FromName = 'Example Mailer';
|
||||
|
||||
$mail->Subject = 'My subject';
|
||||
$mail->Body = 'Hello world';
|
||||
$mail->AddAddress('name@anydomain.com', 'First Last');
|
||||
|
||||
if (!$mail->Send())
|
||||
{
|
||||
echo $mail->ErrorInfo;
|
||||
}
|
||||
?>
|
||||
</pre>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
29
modules/EcmDocuments/phpmailer/examples/test1.php
Executable file
29
modules/EcmDocuments/phpmailer/examples/test1.php
Executable file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
include_once('../class.phpmailer.php');
|
||||
|
||||
$mail = new PHPMailer();
|
||||
|
||||
$body = $mail->getFile('contents.html');
|
||||
|
||||
$body = eregi_replace("[\]",'',$body);
|
||||
$subject = eregi_replace("[\]",'',$subject);
|
||||
|
||||
$mail->From = "name@yourdomain.com";
|
||||
$mail->FromName = "First Last";
|
||||
|
||||
$mail->Subject = "PHPMailer Test Subject";
|
||||
|
||||
$mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
|
||||
|
||||
$mail->MsgHTML($body);
|
||||
|
||||
$mail->AddAddress("whoto@otherdomain.com", "John Doe");
|
||||
|
||||
if(!$mail->Send()) {
|
||||
echo 'Failed to send mail';
|
||||
} else {
|
||||
echo 'Mail sent';
|
||||
}
|
||||
|
||||
?>
|
||||
21
modules/EcmDocuments/phpmailer/language/phpmailer.lang-br.php
Executable file
21
modules/EcmDocuments/phpmailer/language/phpmailer.lang-br.php
Executable file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
/**
|
||||
* PHPMailer language file.
|
||||
* Portuguese Version
|
||||
* By Paulo Henrique Garcia - paulo@controllerweb.com.br
|
||||
*/
|
||||
|
||||
$PHPMAILER_LANG = array();
|
||||
$PHPMAILER_LANG["provide_address"] = 'Voc<6F> deve fornecer pelo menos um endere<72>o de destinat<61>rio de email.';
|
||||
$PHPMAILER_LANG["mailer_not_supported"] = ' mailer n<>o suportado.';
|
||||
$PHPMAILER_LANG["execute"] = 'N<>o foi poss<73>vel executar: ';
|
||||
$PHPMAILER_LANG["instantiate"] = 'N<>o foi poss<73>vel instanciar a fun<75><6E>o mail.';
|
||||
$PHPMAILER_LANG["authenticate"] = 'Erro de SMTP: N<>o foi poss<73>vel autenticar.';
|
||||
$PHPMAILER_LANG["from_failed"] = 'Os endere<72>os de rementente a seguir falharam: ';
|
||||
$PHPMAILER_LANG["recipients_failed"] = 'Erro de SMTP: Os endere<72>os de destinat<61>rio a seguir falharam: ';
|
||||
$PHPMAILER_LANG["data_not_accepted"] = 'Erro de SMTP: Dados n<>o aceitos.';
|
||||
$PHPMAILER_LANG["connect_host"] = 'Erro de SMTP: N<>o foi poss<73>vel conectar com o servidor SMTP.';
|
||||
$PHPMAILER_LANG["file_access"] = 'N<>o foi poss<73>vel acessar o arquivo: ';
|
||||
$PHPMAILER_LANG["file_open"] = 'Erro de Arquivo: N<>o foi poss<73>vel abrir o arquivo: ';
|
||||
$PHPMAILER_LANG["encoding"] = 'Codifica<63><61>o desconhecida: ';
|
||||
?>
|
||||
22
modules/EcmDocuments/phpmailer/language/phpmailer.lang-ca.php
Executable file
22
modules/EcmDocuments/phpmailer/language/phpmailer.lang-ca.php
Executable file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* PHPMailer language file.
|
||||
* Catalan Version
|
||||
* By Ivan: web AT microstudi DOT com
|
||||
*/
|
||||
|
||||
$PHPMAILER_LANG = array();
|
||||
|
||||
$PHPMAILER_LANG["provide_address"] = 'S\'ha de proveir almenys una adre<72>a d\'email com a destinatari.';
|
||||
$PHPMAILER_LANG["mailer_not_supported"] = ' mailer no est<73> suportat';
|
||||
$PHPMAILER_LANG["execute"] = 'No es pot executar: ';
|
||||
$PHPMAILER_LANG["instantiate"] = 'No s\'ha pogut crear una inst<73>ncia de la funci<63> Mail.';
|
||||
$PHPMAILER_LANG["authenticate"] = 'Error SMTP: No s\'hapogut autenticar.';
|
||||
$PHPMAILER_LANG["from_failed"] = 'La(s) seg<65>ent(s) adreces de remitent han fallat: ';
|
||||
$PHPMAILER_LANG["recipients_failed"] = 'Error SMTP: Els seg<65>ents destinataris han fallat: ';
|
||||
$PHPMAILER_LANG["data_not_accepted"] = 'Error SMTP: Dades no acceptades.';
|
||||
$PHPMAILER_LANG["connect_host"] = 'Error SMTP: No es pot connectar al servidor SMTP.';
|
||||
$PHPMAILER_LANG["file_access"] = 'No es pot accedir a l\'arxiu: ';
|
||||
$PHPMAILER_LANG["file_open"] = 'Error d\'Arxiu: No es pot obrir l\'arxiu: ';
|
||||
$PHPMAILER_LANG["encoding"] = 'Codificaci<63> desconeguda: ';
|
||||
?>
|
||||
24
modules/EcmDocuments/phpmailer/language/phpmailer.lang-cz.php
Executable file
24
modules/EcmDocuments/phpmailer/language/phpmailer.lang-cz.php
Executable file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
/**
|
||||
* PHPMailer language file.
|
||||
* Czech Version
|
||||
*/
|
||||
|
||||
$PHPMAILER_LANG = array();
|
||||
|
||||
$PHPMAILER_LANG["provide_address"] = 'Mus<75>te zadat alespo<70> jednu ' .
|
||||
'emailovou adresu p<><70>jemce.';
|
||||
$PHPMAILER_LANG["mailer_not_supported"] = ' mailov<6F> klient nen<65> podporov<6F>n.';
|
||||
$PHPMAILER_LANG["execute"] = 'Nelze prov<6F>st: ';
|
||||
$PHPMAILER_LANG["instantiate"] = 'Nelze vytvo<76>it instanci emailov<6F> funkce.';
|
||||
$PHPMAILER_LANG["authenticate"] = 'SMTP Error: Chyba autentikace.';
|
||||
$PHPMAILER_LANG["from_failed"] = 'N<>sleduj<75>c<EFBFBD> adresa From je nespr<70>vn<76>: ';
|
||||
$PHPMAILER_LANG["recipients_failed"] = 'SMTP Error: Adresy p<><70>jemc<6D> ' .
|
||||
'nejsou spr<70>vn<76> ' .
|
||||
$PHPMAILER_LANG["data_not_accepted"] = 'SMTP Error: Data nebyla p<>ijata';
|
||||
$PHPMAILER_LANG["connect_host"] = 'SMTP Error: Nelze nav<61>zat spojen<65> se ' .
|
||||
' SMTP serverem.';
|
||||
$PHPMAILER_LANG["file_access"] = 'Soubor nenalezen: ';
|
||||
$PHPMAILER_LANG["file_open"] = 'File Error: Nelze otev<65><76>t soubor pro <20>ten<65>: ';
|
||||
$PHPMAILER_LANG["encoding"] = 'Nezn<7A>m<EFBFBD> k<>dov<6F>n<EFBFBD>: ';
|
||||
?>
|
||||
23
modules/EcmDocuments/phpmailer/language/phpmailer.lang-de.php
Executable file
23
modules/EcmDocuments/phpmailer/language/phpmailer.lang-de.php
Executable file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
/**
|
||||
* PHPMailer language file.
|
||||
* German Version
|
||||
*/
|
||||
|
||||
$PHPMAILER_LANG = array();
|
||||
|
||||
$PHPMAILER_LANG["provide_address"] = 'Bitte geben Sie mindestens eine ' .
|
||||
'Empfänger Emailadresse an.';
|
||||
$PHPMAILER_LANG["mailer_not_supported"] = ' mailer wird nicht unterstützt.';
|
||||
$PHPMAILER_LANG["execute"] = 'Konnte folgenden Befehl nicht ausführen: ';
|
||||
$PHPMAILER_LANG["instantiate"] = 'Mail Funktion konnte nicht initialisiert werden.';
|
||||
$PHPMAILER_LANG["authenticate"] = 'SMTP Fehler: Authentifizierung fehlgeschlagen.';
|
||||
$PHPMAILER_LANG["from_failed"] = 'Die folgende Absenderadresse ist nicht korrekt: ';
|
||||
$PHPMAILER_LANG["recipients_failed"] = 'SMTP Fehler: Die folgenden ' .
|
||||
'Empfänger sind nicht korrekt: ';
|
||||
$PHPMAILER_LANG["data_not_accepted"] = 'SMTP Fehler: Daten werden nicht akzeptiert.';
|
||||
$PHPMAILER_LANG["connect_host"] = 'SMTP Fehler: Konnte keine Verbindung zum SMTP-Host herstellen.';
|
||||
$PHPMAILER_LANG["file_access"] = 'Zugriff auf folgende Datei fehlgeschlagen: ';
|
||||
$PHPMAILER_LANG["file_open"] = 'Datei Fehler: konnte folgende Datei nicht öffnen: ';
|
||||
$PHPMAILER_LANG["encoding"] = 'Unbekanntes Encoding-Format: ';
|
||||
?>
|
||||
24
modules/EcmDocuments/phpmailer/language/phpmailer.lang-dk.php
Executable file
24
modules/EcmDocuments/phpmailer/language/phpmailer.lang-dk.php
Executable file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
/**
|
||||
* PHPMailer language file.
|
||||
* Danish Version
|
||||
* Author: Mikael Stokkebro <info@stokkebro.dk>
|
||||
*/
|
||||
|
||||
$PHPMAILER_LANG = array();
|
||||
|
||||
$PHPMAILER_LANG["provide_address"] = 'Du skal indtaste mindst en ' .
|
||||
'modtagers emailadresse.';
|
||||
$PHPMAILER_LANG["mailer_not_supported"] = ' mailer underst<73>ttes ikke.';
|
||||
$PHPMAILER_LANG["execute"] = 'Kunne ikke k<>re: ';
|
||||
$PHPMAILER_LANG["instantiate"] = 'Kunne ikke initialisere email funktionen.';
|
||||
$PHPMAILER_LANG["authenticate"] = 'SMTP fejl: Kunne ikke logge p<>.';
|
||||
$PHPMAILER_LANG["from_failed"] = 'F<>lgende afsenderadresse er forkert: ';
|
||||
$PHPMAILER_LANG["recipients_failed"] = 'SMTP fejl: F<>lgende' .
|
||||
'modtagere er forkerte: ';
|
||||
$PHPMAILER_LANG["data_not_accepted"] = 'SMTP fejl: Data kunne ikke accepteres.';
|
||||
$PHPMAILER_LANG["connect_host"] = 'SMTP fejl: Kunne ikke tilslutte SMTP serveren.';
|
||||
$PHPMAILER_LANG["file_access"] = 'Ingen adgang til fil: ';
|
||||
$PHPMAILER_LANG["file_open"] = 'Fil fejl: Kunne ikke <20>bne filen: ';
|
||||
$PHPMAILER_LANG["encoding"] = 'Ukendt encode-format: ';
|
||||
?>
|
||||
23
modules/EcmDocuments/phpmailer/language/phpmailer.lang-en.php
Executable file
23
modules/EcmDocuments/phpmailer/language/phpmailer.lang-en.php
Executable file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
/**
|
||||
* PHPMailer language file.
|
||||
* English Version
|
||||
*/
|
||||
|
||||
$PHPMAILER_LANG = array();
|
||||
|
||||
$PHPMAILER_LANG["provide_address"] = 'You must provide at least one ' .
|
||||
'recipient email address.';
|
||||
$PHPMAILER_LANG["mailer_not_supported"] = ' mailer is not supported.';
|
||||
$PHPMAILER_LANG["execute"] = 'Could not execute: ';
|
||||
$PHPMAILER_LANG["instantiate"] = 'Could not instantiate mail function.';
|
||||
$PHPMAILER_LANG["authenticate"] = 'SMTP Error: Could not authenticate.';
|
||||
$PHPMAILER_LANG["from_failed"] = 'The following From address failed: ';
|
||||
$PHPMAILER_LANG["recipients_failed"] = 'SMTP Error: The following ' .
|
||||
'recipients failed: ';
|
||||
$PHPMAILER_LANG["data_not_accepted"] = 'SMTP Error: Data not accepted.';
|
||||
$PHPMAILER_LANG["connect_host"] = 'SMTP Error: Could not connect to SMTP host.';
|
||||
$PHPMAILER_LANG["file_access"] = 'Could not access file: ';
|
||||
$PHPMAILER_LANG["file_open"] = 'File Error: Could not open file: ';
|
||||
$PHPMAILER_LANG["encoding"] = 'Unknown encoding: ';
|
||||
?>
|
||||
23
modules/EcmDocuments/phpmailer/language/phpmailer.lang-es.php
Executable file
23
modules/EcmDocuments/phpmailer/language/phpmailer.lang-es.php
Executable file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
/**
|
||||
* PHPMailer language file.
|
||||
* Versi<73>n en espa<70>ol
|
||||
*/
|
||||
|
||||
$PHPMAILER_LANG = array();
|
||||
|
||||
$PHPMAILER_LANG["provide_address"] = 'Debe proveer al menos una ' .
|
||||
'direcci<63>n de email como destinatario.';
|
||||
$PHPMAILER_LANG["mailer_not_supported"] = ' mailer no est<73> soportado.';
|
||||
$PHPMAILER_LANG["execute"] = 'No puedo ejecutar: ';
|
||||
$PHPMAILER_LANG["instantiate"] = 'No pude crear una instancia de la funci<63>n Mail.';
|
||||
$PHPMAILER_LANG["authenticate"] = 'Error SMTP: No se pudo autentificar.';
|
||||
$PHPMAILER_LANG["from_failed"] = 'La(s) siguiente(s) direcciones de remitente fallaron: ';
|
||||
$PHPMAILER_LANG["recipients_failed"] = 'Error SMTP: Los siguientes ' .
|
||||
'destinatarios fallaron: ';
|
||||
$PHPMAILER_LANG["data_not_accepted"] = 'Error SMTP: Datos no aceptados.';
|
||||
$PHPMAILER_LANG["connect_host"] = 'Error SMTP: No puedo conectar al servidor SMTP.';
|
||||
$PHPMAILER_LANG["file_access"] = 'No puedo acceder al archivo: ';
|
||||
$PHPMAILER_LANG["file_open"] = 'Error de Archivo: No puede abrir el archivo: ';
|
||||
$PHPMAILER_LANG["encoding"] = 'Codificaci<63>n desconocida: ';
|
||||
?>
|
||||
22
modules/EcmDocuments/phpmailer/language/phpmailer.lang-et.php
Executable file
22
modules/EcmDocuments/phpmailer/language/phpmailer.lang-et.php
Executable file
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
/**
|
||||
* PHPMailer language file.
|
||||
* Estonian Version
|
||||
* By Indrek Päri
|
||||
*/
|
||||
|
||||
$PHPMAILER_LANG = array();
|
||||
|
||||
$PHPMAILER_LANG["provide_address"] = 'Te peate määrama vähemalt ühe saaja e-posti aadressi.';
|
||||
$PHPMAILER_LANG["mailer_not_supported"] = ' maileri tugi puudub.';
|
||||
$PHPMAILER_LANG["execute"] = 'Tegevus ebaõnnestus: ';
|
||||
$PHPMAILER_LANG["instantiate"] = 'mail funktiooni käivitamine ebaõnnestus.';
|
||||
$PHPMAILER_LANG["authenticate"] = 'SMTP Viga: Autoriseerimise viga.';
|
||||
$PHPMAILER_LANG["from_failed"] = 'Järgnev saatja e-posti aadress on vigane: ';
|
||||
$PHPMAILER_LANG["recipients_failed"] = 'SMTP Viga: Järgnevate saajate e-posti aadressid on vigased: ';
|
||||
$PHPMAILER_LANG["data_not_accepted"] = 'SMTP Viga: Vigased andmed.';
|
||||
$PHPMAILER_LANG["connect_host"] = 'SMTP Viga: Ei õnnestunud luua ühendust SMTP serveriga.';
|
||||
$PHPMAILER_LANG["file_access"] = 'Pole piisavalt õiguseid järgneva faili avamiseks: ';
|
||||
$PHPMAILER_LANG["file_open"] = 'Faili Viga: Faili avamine ebaõnnestus: ';
|
||||
$PHPMAILER_LANG["encoding"] = 'Tundmatu Unknown kodeering: ';
|
||||
?>
|
||||
23
modules/EcmDocuments/phpmailer/language/phpmailer.lang-fi.php
Executable file
23
modules/EcmDocuments/phpmailer/language/phpmailer.lang-fi.php
Executable file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
/**
|
||||
* PHPMailer language file.
|
||||
* Finnish Version
|
||||
* By Jyry Kuukanen
|
||||
*/
|
||||
|
||||
$PHPMAILER_LANG = array();
|
||||
|
||||
$PHPMAILER_LANG["provide_address"] = 'Aseta vähintään yksi vastaanottajan ' .
|
||||
'sähköpostiosoite.';
|
||||
$PHPMAILER_LANG["mailer_not_supported"] = 'postivälitintyyppiä ei tueta.';
|
||||
$PHPMAILER_LANG["execute"] = 'Suoritus epäonnistui: ';
|
||||
$PHPMAILER_LANG["instantiate"] = 'mail-funktion luonti epäonnistui.';
|
||||
$PHPMAILER_LANG["authenticate"] = 'SMTP-virhe: käyttäjätunnistus epäonnistui.';
|
||||
$PHPMAILER_LANG["from_failed"] = 'Seuraava lähettäjän osoite on virheellinen: ';
|
||||
$PHPMAILER_LANG["recipients_failed"] = 'SMTP-virhe: seuraava vastaanottaja osoite on virheellinen.';
|
||||
$PHPMAILER_LANG["data_not_accepted"] = 'SMTP-virhe: data on virheellinen.';
|
||||
$PHPMAILER_LANG["connect_host"] = 'SMTP-virhe: yhteys palvelimeen ei onnistu.';
|
||||
$PHPMAILER_LANG["file_access"] = 'Seuraavaan tiedostoon ei ole oikeuksia: ';
|
||||
$PHPMAILER_LANG["file_open"] = 'Tiedostovirhe: Ei voida avata tiedostoa: ';
|
||||
$PHPMAILER_LANG["encoding"] = 'Tuntematon koodaustyyppi: ';
|
||||
?>
|
||||
25
modules/EcmDocuments/phpmailer/language/phpmailer.lang-fo.php
Executable file
25
modules/EcmDocuments/phpmailer/language/phpmailer.lang-fo.php
Executable file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
|
||||
* PHPMailer language file.
|
||||
|
||||
* Faroese Version [language of the Faroe Islands, a Danish dominion]
|
||||
|
||||
* This file created: 11-06-2004
|
||||
|
||||
* Supplied by D<>vur S<>rensen [www.profo-webdesign.dk]
|
||||
|
||||
*/
|
||||
|
||||
|
||||
|
||||
$PHPMAILER_LANG = array();
|
||||
|
||||
|
||||
|
||||
$PHPMAILER_LANG["provide_address"] = 'T<> skal uppgeva minst ' .
|
||||
|
||||
'm<>ttakara-emailadressu(r).';
|
||||
|
||||
$PHPMAILER_LANG["mailer_not_supported"] = ' er ikki supportera<72>.';
|
||||
24
modules/EcmDocuments/phpmailer/language/phpmailer.lang-fr.php
Executable file
24
modules/EcmDocuments/phpmailer/language/phpmailer.lang-fr.php
Executable file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
/**
|
||||
* PHPMailer language file.
|
||||
* French Version
|
||||
* bruno@ioda-net.ch 09.08.2003
|
||||
*/
|
||||
|
||||
$PHPMAILER_LANG = array();
|
||||
|
||||
$PHPMAILER_LANG["provide_address"] = 'Vous devez fournir au moins ' .
|
||||
'une adresse de destinataire.';
|
||||
$PHPMAILER_LANG["mailer_not_supported"] = ' mailer non support<72>.';
|
||||
$PHPMAILER_LANG["execute"] = 'Ne peut pas lancer l\'ex<65>cution: ';
|
||||
$PHPMAILER_LANG["instantiate"] = 'Impossible d\'instancier la fonction mail.';
|
||||
$PHPMAILER_LANG["authenticate"] = 'SMTP Erreur: Echec de l\'authentification.';
|
||||
$PHPMAILER_LANG["from_failed"] = 'L\'adresse From suivante a <20>chou<6F> : ';
|
||||
$PHPMAILER_LANG["recipients_failed"] = 'SMTP Erreur: Les destinataires ' .
|
||||
'suivants sont en erreur : ';
|
||||
$PHPMAILER_LANG["data_not_accepted"] = 'SMTP Erreur: Data non accept<70>e.';
|
||||
$PHPMAILER_LANG["connect_host"] = 'SMTP Erreur: Impossible de connecter le serveur SMTP .';
|
||||
$PHPMAILER_LANG["file_access"] = 'N\'arrive pas <20> acc<63>der au fichier: ';
|
||||
$PHPMAILER_LANG["file_open"] = 'Erreur Fichier: ouverture impossible: ';
|
||||
$PHPMAILER_LANG["encoding"] = 'Encodage inconnu: ';
|
||||
?>
|
||||
23
modules/EcmDocuments/phpmailer/language/phpmailer.lang-hu.php
Executable file
23
modules/EcmDocuments/phpmailer/language/phpmailer.lang-hu.php
Executable file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
/**
|
||||
* PHPMailer language file.
|
||||
* Hungarian Version
|
||||
*/
|
||||
|
||||
$PHPMAILER_LANG = array();
|
||||
|
||||
$PHPMAILER_LANG["provide_address"] = 'Meg kell adnod legal<61>bb egy ' .
|
||||
'c<>mzett email c<>met.';
|
||||
$PHPMAILER_LANG["mailer_not_supported"] = ' levelez<65> nem t<>mogatott.';
|
||||
$PHPMAILER_LANG["execute"] = 'Nem tudtam v<>grehajtani: ';
|
||||
$PHPMAILER_LANG["instantiate"] = 'Nem siker<65>lt p<>ld<6C>nyos<6F>tani a mail funkci<63>t.';
|
||||
$PHPMAILER_LANG["authenticate"] = 'SMTP Hiba: Sikertelen autentik<69>ci<63>.';
|
||||
$PHPMAILER_LANG["from_failed"] = 'Az al<61>bbi Felad<61> c<>m hib<69>s: ';
|
||||
$PHPMAILER_LANG["recipients_failed"] = 'SMTP Hiba: Az al<61>bbi ' .
|
||||
'c<>mzettek hib<69>sak: ';
|
||||
$PHPMAILER_LANG["data_not_accepted"] = 'SMTP Hiba: Nem elfogadhat<61> adat.';
|
||||
$PHPMAILER_LANG["connect_host"] = 'SMTP Hiba: Nem tudtam csatlakozni az SMTP host-hoz.';
|
||||
$PHPMAILER_LANG["file_access"] = 'Nem siker<65>lt el<65>rni a k<>vetkez<65> f<>jlt: ';
|
||||
$PHPMAILER_LANG["file_open"] = 'F<>jl Hiba: Nem siker<65>lt megnyitni a k<>vetkez<65> f<>jlt: ';
|
||||
$PHPMAILER_LANG["encoding"] = 'Ismeretlen k<>dol<6F>s: ';
|
||||
?>
|
||||
28
modules/EcmDocuments/phpmailer/language/phpmailer.lang-it.php
Executable file
28
modules/EcmDocuments/phpmailer/language/phpmailer.lang-it.php
Executable file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
/**
|
||||
* PHPMailer language file.
|
||||
* Italian version
|
||||
* @package PHPMailer
|
||||
* @author Ilias Bartolini <brain79@inwind.it>
|
||||
*/
|
||||
|
||||
$PHPMAILER_LANG = array();
|
||||
|
||||
$PHPMAILER_LANG["provide_address"] = 'Deve essere fornito almeno un'.
|
||||
' indirizzo ricevente';
|
||||
$PHPMAILER_LANG["mailer_not_supported"] = 'Mailer non supportato';
|
||||
$PHPMAILER_LANG["execute"] = "Impossibile eseguire l'operazione: ";
|
||||
$PHPMAILER_LANG["instantiate"] = 'Impossibile istanziare la funzione mail';
|
||||
$PHPMAILER_LANG["authenticate"] = 'SMTP Error: Impossibile autenticarsi.';
|
||||
$PHPMAILER_LANG["from_failed"] = 'I seguenti indirizzi mittenti hanno'.
|
||||
' generato errore: ';
|
||||
$PHPMAILER_LANG["recipients_failed"] = 'SMTP Error: I seguenti indirizzi'.
|
||||
'destinatari hanno generato errore: ';
|
||||
$PHPMAILER_LANG["data_not_accepted"] = 'SMTP Error: Data non accettati dal'.
|
||||
'server.';
|
||||
$PHPMAILER_LANG["connect_host"] = 'SMTP Error: Impossibile connettersi'.
|
||||
' all\'host SMTP.';
|
||||
$PHPMAILER_LANG["file_access"] = 'Impossibile accedere al file: ';
|
||||
$PHPMAILER_LANG["file_open"] = 'File Error: Impossibile aprire il file: ';
|
||||
$PHPMAILER_LANG["encoding"] = 'Encoding set dei caratteri sconosciuto: ';
|
||||
?>
|
||||
25
modules/EcmDocuments/phpmailer/language/phpmailer.lang-ja.php
Executable file
25
modules/EcmDocuments/phpmailer/language/phpmailer.lang-ja.php
Executable file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
/**
|
||||
* PHPMailer language file.
|
||||
* Japanese Version
|
||||
* By Mitsuhiro Yoshida - http://mitstek.com/
|
||||
* This file is written in EUC-JP.
|
||||
*/
|
||||
|
||||
$PHPMAILER_LANG = array();
|
||||
|
||||
$PHPMAILER_LANG["provide_address"] = '<27><><EFBFBD>ʤ<EFBFBD><CAA4>Ȥ<EFBFBD>1<EFBFBD>ĥ<C4A5>륢<EFBFBD>ɥ쥹<C9A5><ECA5B9>' .
|
||||
'<27><><EFBFBD>ꤹ<EFBFBD><EAA4B9>ɬ<EFBFBD>פ<EFBFBD><D7A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD>';
|
||||
$PHPMAILER_LANG["mailer_not_supported"] = ' <20><EFBFBD>顼<EFBFBD><E9A1BC><EFBFBD><EFBFBD><EFBFBD>ݡ<EFBFBD><DDA1>Ȥ<EFBFBD><C8A4><EFBFBD><EFBFBD>Ƥ<EFBFBD><C6A4>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD><EFBFBD>';
|
||||
$PHPMAILER_LANG["execute"] = '<27>¹ԤǤ<D4A4><C7A4>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD>Ǥ<EFBFBD><C7A4><EFBFBD>: ';
|
||||
$PHPMAILER_LANG["instantiate"] = '<27><EFBFBD><E1A1BC><EFBFBD>ؿ<EFBFBD><D8BF><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ư<EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD>Ǥ<EFBFBD><C7A4><EFBFBD><EFBFBD><EFBFBD>';
|
||||
$PHPMAILER_LANG["authenticate"] = 'SMTP<54><50><EFBFBD>顼: ǧ<>ڤǤ<DAA4><C7A4>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD>Ǥ<EFBFBD><C7A4><EFBFBD><EFBFBD><EFBFBD>';
|
||||
$PHPMAILER_LANG["from_failed"] = '<27><><EFBFBD><EFBFBD>From<6F><6D><EFBFBD>ɥ쥹<C9A5>˴ְ㤤<D6B0><E3A4A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD>: ';
|
||||
$PHPMAILER_LANG["recipients_failed"] = 'SMTP<54><50><EFBFBD>顼: <20><><EFBFBD>μ<EFBFBD><CEBC><EFBFBD><EFBFBD>ԥ<EFBFBD><D4A5>ɥ쥹<C9A5><ECA5B9> ' .
|
||||
'<27>ְ㤤<D6B0><E3A4A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD>: ';
|
||||
$PHPMAILER_LANG["data_not_accepted"] = 'SMTP<54><50><EFBFBD>顼: <20>ǡ<EFBFBD><C7A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>դ<EFBFBD><D5A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD>Ǥ<EFBFBD><C7A4><EFBFBD><EFBFBD><EFBFBD>';
|
||||
$PHPMAILER_LANG["connect_host"] = 'SMTP<54><50><EFBFBD>顼: SMTP<54>ۥ<EFBFBD><DBA5>Ȥ<EFBFBD><C8A4><EFBFBD>³<EFBFBD>Ǥ<EFBFBD><C7A4>ޤ<EFBFBD><DEA4><EFBFBD><EFBFBD>Ǥ<EFBFBD><C7A4><EFBFBD><EFBFBD><EFBFBD>';
|
||||
$PHPMAILER_LANG["file_access"] = '<27>ե<EFBFBD><D5A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>˥<EFBFBD><CBA5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ǥ<EFBFBD><C7A4>ޤ<EFBFBD><DEA4><EFBFBD>: ';
|
||||
$PHPMAILER_LANG["file_open"] = '<27>ե<EFBFBD><D5A5><EFBFBD><EFBFBD>륨<EFBFBD>顼: <20>ե<EFBFBD><D5A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><F2B3ABA4>ޤ<EFBFBD><DEA4><EFBFBD>: ';
|
||||
$PHPMAILER_LANG["encoding"] = '<27><><EFBFBD><EFBFBD><EFBFBD>ʥ<EFBFBD><CAA5><EFBFBD><F3A5B3A1>ǥ<EFBFBD><C7A5><EFBFBD><EFBFBD><EFBFBD>: ';
|
||||
?>
|
||||
23
modules/EcmDocuments/phpmailer/language/phpmailer.lang-nl.php
Executable file
23
modules/EcmDocuments/phpmailer/language/phpmailer.lang-nl.php
Executable file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
/**
|
||||
* PHPMailer language file.
|
||||
* Dutch Version
|
||||
*/
|
||||
|
||||
$PHPMAILER_LANG = array();
|
||||
|
||||
$PHPMAILER_LANG["provide_address"] = 'Er moet tenmiste één ' .
|
||||
'ontvanger emailadres opgegeven worden.';
|
||||
$PHPMAILER_LANG["mailer_not_supported"] = ' mailer wordt niet ondersteund.';
|
||||
$PHPMAILER_LANG["execute"] = 'Kon niet uitvoeren: ';
|
||||
$PHPMAILER_LANG["instantiate"] = 'Kon mail functie niet initialiseren.';
|
||||
$PHPMAILER_LANG["authenticate"] = 'SMTP Fout: authenticatie mislukt.';
|
||||
$PHPMAILER_LANG["from_failed"] = 'De volgende afzender adressen zijn mislukt: ';
|
||||
$PHPMAILER_LANG["recipients_failed"] = 'SMTP Fout: De volgende ' .
|
||||
'ontvangers zijn mislukt: ';
|
||||
$PHPMAILER_LANG["data_not_accepted"] = 'SMTP Fout: Data niet geaccepteerd.';
|
||||
$PHPMAILER_LANG["connect_host"] = 'SMTP Fout: Kon niet verbinden met SMTP host.';
|
||||
$PHPMAILER_LANG["file_access"] = 'Kreeg geen toegang tot bestand: ';
|
||||
$PHPMAILER_LANG["file_open"] = 'Bestandsfout: Kon bestand niet openen: ';
|
||||
$PHPMAILER_LANG["encoding"] = 'Onbekende codering: ';
|
||||
?>
|
||||
23
modules/EcmDocuments/phpmailer/language/phpmailer.lang-no.php
Executable file
23
modules/EcmDocuments/phpmailer/language/phpmailer.lang-no.php
Executable file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
/**
|
||||
* PHPMailer language file.
|
||||
* Norwegian Version
|
||||
*/
|
||||
|
||||
$PHPMAILER_LANG = array();
|
||||
|
||||
$PHPMAILER_LANG["provide_address"] = 'Du m<> ha med minst en' .
|
||||
'mottager adresse.';
|
||||
$PHPMAILER_LANG["mailer_not_supported"] = ' mailer er ikke supportert.';
|
||||
$PHPMAILER_LANG["execute"] = 'Kunne ikke utf<74>re: ';
|
||||
$PHPMAILER_LANG["instantiate"] = 'Kunne ikke instantiate mail funksjonen.';
|
||||
$PHPMAILER_LANG["authenticate"] = 'SMTP Feil: Kunne ikke authentisere.';
|
||||
$PHPMAILER_LANG["from_failed"] = 'F<>lgende Fra feilet: ';
|
||||
$PHPMAILER_LANG["recipients_failed"] = 'SMTP Feil: F<>lgende' .
|
||||
'mottagere feilet: ';
|
||||
$PHPMAILER_LANG["data_not_accepted"] = 'SMTP Feil: Data ble ikke akseptert.';
|
||||
$PHPMAILER_LANG["connect_host"] = 'SMTP Feil: Kunne ikke koble til SMTP host.';
|
||||
$PHPMAILER_LANG["file_access"] = 'Kunne ikke f<> tilgang til filen: ';
|
||||
$PHPMAILER_LANG["file_open"] = 'Fil feil: Kunne ikke <20>pne filen: ';
|
||||
$PHPMAILER_LANG["encoding"] = 'Ukjent encoding: ';
|
||||
?>
|
||||
24
modules/EcmDocuments/phpmailer/language/phpmailer.lang-pl.php
Executable file
24
modules/EcmDocuments/phpmailer/language/phpmailer.lang-pl.php
Executable file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
/**
|
||||
* PHPMailer language file.
|
||||
* Polish Version, encoding: windows-1250
|
||||
* translated from english lang file ver. 1.72
|
||||
*/
|
||||
|
||||
$PHPMAILER_LANG = array();
|
||||
|
||||
$PHPMAILER_LANG["provide_address"] = 'Nale<6C>y poda<64> prawid<69>owy adres email Odbiorcy.';
|
||||
$PHPMAILER_LANG["mailer_not_supported"] = 'Wybrana metoda wysy<73>ki wiadomo<6D>ci nie jest obs<62>ugiwana.';
|
||||
$PHPMAILER_LANG["execute"] = 'Nie mo<6D>na uruchomi<6D>: ';
|
||||
$PHPMAILER_LANG["instantiate"] = 'Nie mo<6D>na wywo<77>a<EFBFBD> funkcji mail(). Sprawd<77> konfiguracj<63> serwera.';
|
||||
$PHPMAILER_LANG["authenticate"] = 'B<><42>d SMTP: Nie mo<6D>na przeprowadzi<7A> autentykacji.';
|
||||
$PHPMAILER_LANG["from_failed"] = 'Nast<73>puj<75>cy adres Nadawcy jest jest nieprawid<69>owy: ';
|
||||
$PHPMAILER_LANG["recipients_failed"] = 'B<><42>d SMTP: Nast<73>puj<75>cy ' .
|
||||
'odbiorcy s<> nieprawid<69>owi: ';
|
||||
$PHPMAILER_LANG["data_not_accepted"] = 'B<><42>d SMTP: Dane nie zosta<74>y przyj<79>te.';
|
||||
$PHPMAILER_LANG["connect_host"] = 'B<><42>d SMTP: Nie mo<6D>na po<70><6F>czy<7A> si<73> z wybranym hostem.';
|
||||
$PHPMAILER_LANG["file_access"] = 'Brak dost<73>pu do pliku: ';
|
||||
$PHPMAILER_LANG["file_open"] = 'Nie mo<6D>na otworzy<7A> pliku: ';
|
||||
$PHPMAILER_LANG["encoding"] = 'Nieznany spos<6F>b kodowania znak<61>w: ';
|
||||
|
||||
?>
|
||||
23
modules/EcmDocuments/phpmailer/language/phpmailer.lang-ro.php
Executable file
23
modules/EcmDocuments/phpmailer/language/phpmailer.lang-ro.php
Executable file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
/**
|
||||
* PHPMailer language file.
|
||||
* Romanian Version
|
||||
* @package PHPMailer
|
||||
* @author Catalin Constantin <catalin@dazoot.ro>
|
||||
*/
|
||||
|
||||
$PHPMAILER_LANG = array();
|
||||
|
||||
$PHPMAILER_LANG["provide_address"] = 'Trebuie sa adaugati cel putin un recipient (adresa de mail).';
|
||||
$PHPMAILER_LANG["mailer_not_supported"] = ' mailer nu este suportat.';
|
||||
$PHPMAILER_LANG["execute"] = 'Nu pot executa: ';
|
||||
$PHPMAILER_LANG["instantiate"] = 'Nu am putut instantia functia mail.';
|
||||
$PHPMAILER_LANG["authenticate"] = 'Eroare SMTP: Nu a functionat autentificarea.';
|
||||
$PHPMAILER_LANG["from_failed"] = 'Urmatoarele adrese From au dat eroare: ';
|
||||
$PHPMAILER_LANG["recipients_failed"] = 'Eroare SMTP: Urmatoarele adrese de mail au dat eroare: ';
|
||||
$PHPMAILER_LANG["data_not_accepted"] = 'Eroare SMTP: Continutul mailului nu a fost acceptat.';
|
||||
$PHPMAILER_LANG["connect_host"] = 'Eroare SMTP: Nu m-am putut conecta la adresa SMTP.';
|
||||
$PHPMAILER_LANG["file_access"] = 'Nu pot accesa fisierul: ';
|
||||
$PHPMAILER_LANG["file_open"] = 'Eroare de fisier: Nu pot deschide fisierul: ';
|
||||
$PHPMAILER_LANG["encoding"] = 'Encodare necunoscuta: ';
|
||||
?>
|
||||
23
modules/EcmDocuments/phpmailer/language/phpmailer.lang-ru.php
Executable file
23
modules/EcmDocuments/phpmailer/language/phpmailer.lang-ru.php
Executable file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
/**
|
||||
* PHPMailer language file.
|
||||
* Russian Version by Alexey Chumakov <alex@chumakov.ru>
|
||||
*/
|
||||
|
||||
$PHPMAILER_LANG = array();
|
||||
$PHPMAILER_LANG["provide_address"] = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> e-mail ' .
|
||||
'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.';
|
||||
$PHPMAILER_LANG["mailer_not_supported"] = ' - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.';
|
||||
$PHPMAILER_LANG["execute"] = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: ';
|
||||
$PHPMAILER_LANG["instantiate"] = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> mail.';
|
||||
$PHPMAILER_LANG["authenticate"] = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> SMTP: <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.';
|
||||
$PHPMAILER_LANG["from_failed"] = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: ';
|
||||
$PHPMAILER_LANG["recipients_failed"] = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> SMTP: <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ' .
|
||||
'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: ';
|
||||
$PHPMAILER_LANG["data_not_accepted"] = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> SMTP: <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.';
|
||||
$PHPMAILER_LANG["connect_host"] = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> SMTP: <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> SMTP.';
|
||||
$PHPMAILER_LANG["file_access"] = '<27><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD>: ';
|
||||
$PHPMAILER_LANG["file_open"] = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>: ';
|
||||
$PHPMAILER_LANG["encoding"] = '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: ';
|
||||
?>
|
||||
|
||||
24
modules/EcmDocuments/phpmailer/language/phpmailer.lang-se.php
Executable file
24
modules/EcmDocuments/phpmailer/language/phpmailer.lang-se.php
Executable file
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
/**
|
||||
* PHPMailer language file.
|
||||
* Swedish Version
|
||||
* Author: Johan Linn<6E>r <johan@linner.biz>
|
||||
*/
|
||||
|
||||
$PHPMAILER_LANG = array();
|
||||
|
||||
$PHPMAILER_LANG["provide_address"] = 'Du m<>ste ange minst en ' .
|
||||
'mottagares e-postadress.';
|
||||
$PHPMAILER_LANG["mailer_not_supported"] = ' mailer st<73>ds inte.';
|
||||
$PHPMAILER_LANG["execute"] = 'Kunde inte k<>ra: ';
|
||||
$PHPMAILER_LANG["instantiate"] = 'Kunde inte initiera e-postfunktion.';
|
||||
$PHPMAILER_LANG["authenticate"] = 'SMTP fel: Kunde inte autentisera.';
|
||||
$PHPMAILER_LANG["from_failed"] = 'F<>ljande avs<76>ndaradress <20>r felaktig: ';
|
||||
$PHPMAILER_LANG["recipients_failed"] = 'SMTP fel: F<>ljande ' .
|
||||
'mottagare <20>r felaktig: ';
|
||||
$PHPMAILER_LANG["data_not_accepted"] = 'SMTP fel: Data accepterades inte.';
|
||||
$PHPMAILER_LANG["connect_host"] = 'SMTP fel: Kunde inte ansluta till SMTP-server.';
|
||||
$PHPMAILER_LANG["file_access"] = 'Ingen <20>tkomst till fil: ';
|
||||
$PHPMAILER_LANG["file_open"] = 'Fil fel: Kunde inte <20>ppna fil: ';
|
||||
$PHPMAILER_LANG["encoding"] = 'Ok<4F>nt encode-format: ';
|
||||
?>
|
||||
25
modules/EcmDocuments/phpmailer/language/phpmailer.lang-tr.php
Executable file
25
modules/EcmDocuments/phpmailer/language/phpmailer.lang-tr.php
Executable file
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
/**
|
||||
* PHPMailer dil dosyas<61>.
|
||||
* T<>rk<72>e Versiyonu
|
||||
* <20>ZYAZILIM - El<45>in <20>zel - Can Y<>lmaz - Mehmet Benlio<69>lu
|
||||
*/
|
||||
|
||||
$PHPMAILER_LANG = array();
|
||||
|
||||
$PHPMAILER_LANG["provide_address"] = 'En az bir tane mail adresi belirtmek zorundas<61>n<EFBFBD>z ' .
|
||||
'al<61>c<EFBFBD>n<EFBFBD>n email adresi.';
|
||||
$PHPMAILER_LANG["mailer_not_supported"] = ' mailler desteklenmemektedir.';
|
||||
$PHPMAILER_LANG["execute"] = '<27>al<61><6C>t<EFBFBD>r<EFBFBD>lam<61>yor: ';
|
||||
$PHPMAILER_LANG["instantiate"] = '<27>rnek mail fonksiyonu yarat<61>lamad<61>.';
|
||||
$PHPMAILER_LANG["authenticate"] = 'SMTP Hatas<61>: Do<44>rulanam<61>yor.';
|
||||
$PHPMAILER_LANG["from_failed"] = 'Ba<42>ar<61>s<EFBFBD>z olan g<>nderici adresi: ';
|
||||
$PHPMAILER_LANG["recipients_failed"] = 'SMTP Hatas<61>: ' .
|
||||
'al<61>c<EFBFBD>lara ula<6C>mad<61>: ';
|
||||
$PHPMAILER_LANG["data_not_accepted"] = 'SMTP Hatas<61>: Veri kabul edilmedi.';
|
||||
$PHPMAILER_LANG["connect_host"] = 'SMTP Hatas<61>: SMTP hosta ba<62>lan<61>lam<61>yor.';
|
||||
$PHPMAILER_LANG["file_access"] = 'Dosyaya eri<72>ilemiyor: ';
|
||||
$PHPMAILER_LANG["file_open"] = 'Dosya Hatas<61>: Dosya a<><61>lam<61>yor: ';
|
||||
$PHPMAILER_LANG["encoding"] = 'Bilinmeyen <20>ifreleme: ';
|
||||
|
||||
?>
|
||||
572
modules/EcmDocuments/phpmailer/test/phpmailer_test.php
Executable file
572
modules/EcmDocuments/phpmailer/test/phpmailer_test.php
Executable file
@@ -0,0 +1,572 @@
|
||||
<?php
|
||||
/*******************
|
||||
Unit Test
|
||||
Type: phpmailer class
|
||||
********************/
|
||||
|
||||
$INCLUDE_DIR = "../";
|
||||
|
||||
require("phpunit.php");
|
||||
require($INCLUDE_DIR . "class.phpmailer.php");
|
||||
error_reporting(E_ALL);
|
||||
|
||||
/**
|
||||
* Performs authentication tests
|
||||
*/
|
||||
class phpmailerTest extends TestCase
|
||||
{
|
||||
/**
|
||||
* Holds the default phpmailer instance.
|
||||
* @private
|
||||
* @type object
|
||||
*/
|
||||
var $Mail = false;
|
||||
|
||||
/**
|
||||
* Holds the SMTP mail host.
|
||||
* @public
|
||||
* @type string
|
||||
*/
|
||||
var $Host = "";
|
||||
|
||||
/**
|
||||
* Holds the change log.
|
||||
* @private
|
||||
* @type string array
|
||||
*/
|
||||
var $ChangeLog = array();
|
||||
|
||||
/**
|
||||
* Holds the note log.
|
||||
* @private
|
||||
* @type string array
|
||||
*/
|
||||
var $NoteLog = array();
|
||||
|
||||
/**
|
||||
* Class constuctor.
|
||||
*/
|
||||
function phpmailerTest($name) {
|
||||
/* must define this constructor */
|
||||
$this->TestCase( $name );
|
||||
}
|
||||
|
||||
/**
|
||||
* Run before each test is started.
|
||||
*/
|
||||
function setUp() {
|
||||
global $global_vars;
|
||||
global $INCLUDE_DIR;
|
||||
|
||||
$this->Mail = new PHPMailer();
|
||||
|
||||
$this->Mail->Priority = 3;
|
||||
$this->Mail->Encoding = "8bit";
|
||||
$this->Mail->CharSet = "iso-8859-1";
|
||||
$this->Mail->From = "unit_test@phpmailer.sf.net";
|
||||
$this->Mail->FromName = "Unit Tester";
|
||||
$this->Mail->Sender = "";
|
||||
$this->Mail->Subject = "Unit Test";
|
||||
$this->Mail->Body = "";
|
||||
$this->Mail->AltBody = "";
|
||||
$this->Mail->WordWrap = 0;
|
||||
$this->Mail->Host = $global_vars["mail_host"];
|
||||
$this->Mail->Port = 25;
|
||||
$this->Mail->Helo = "localhost.localdomain";
|
||||
$this->Mail->SMTPAuth = false;
|
||||
$this->Mail->Username = "";
|
||||
$this->Mail->Password = "";
|
||||
$this->Mail->PluginDir = $INCLUDE_DIR;
|
||||
$this->Mail->AddReplyTo("no_reply@phpmailer.sf.net", "Reply Guy");
|
||||
$this->Mail->Sender = "unit_test@phpmailer.sf.net";
|
||||
|
||||
if(strlen($this->Mail->Host) > 0)
|
||||
$this->Mail->Mailer = "smtp";
|
||||
else
|
||||
{
|
||||
$this->Mail->Mailer = "mail";
|
||||
$this->Sender = "unit_test@phpmailer.sf.net";
|
||||
}
|
||||
|
||||
global $global_vars;
|
||||
$this->SetAddress($global_vars["mail_to"], "Test User");
|
||||
if(strlen($global_vars["mail_cc"]) > 0)
|
||||
$this->SetAddress($global_vars["mail_cc"], "Carbon User", "cc");
|
||||
}
|
||||
|
||||
/**
|
||||
* Run after each test is completed.
|
||||
*/
|
||||
function tearDown() {
|
||||
// Clean global variables
|
||||
$this->Mail = NULL;
|
||||
$this->ChangeLog = array();
|
||||
$this->NoteLog = array();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Build the body of the message in the appropriate format.
|
||||
* @private
|
||||
* @returns void
|
||||
*/
|
||||
function BuildBody() {
|
||||
$this->CheckChanges();
|
||||
|
||||
// Determine line endings for message
|
||||
if($this->Mail->ContentType == "text/html" || strlen($this->Mail->AltBody) > 0)
|
||||
{
|
||||
$eol = "<br/>";
|
||||
$bullet = "<li>";
|
||||
$bullet_start = "<ul>";
|
||||
$bullet_end = "</ul>";
|
||||
}
|
||||
else
|
||||
{
|
||||
$eol = "\n";
|
||||
$bullet = " - ";
|
||||
$bullet_start = "";
|
||||
$bullet_end = "";
|
||||
}
|
||||
|
||||
$ReportBody = "";
|
||||
|
||||
$ReportBody .= "---------------------" . $eol;
|
||||
$ReportBody .= "Unit Test Information" . $eol;
|
||||
$ReportBody .= "---------------------" . $eol;
|
||||
$ReportBody .= "phpmailer version: " . $this->Mail->Version . $eol;
|
||||
$ReportBody .= "Content Type: " . $this->Mail->ContentType . $eol;
|
||||
|
||||
if(strlen($this->Mail->Host) > 0)
|
||||
$ReportBody .= "Host: " . $this->Mail->Host . $eol;
|
||||
|
||||
// If attachments then create an attachment list
|
||||
if(count($this->Mail->attachment) > 0)
|
||||
{
|
||||
$ReportBody .= "Attachments:" . $eol;
|
||||
$ReportBody .= $bullet_start;
|
||||
for($i = 0; $i < count($this->Mail->attachment); $i++)
|
||||
{
|
||||
$ReportBody .= $bullet . "Name: " . $this->Mail->attachment[$i][1] . ", ";
|
||||
$ReportBody .= "Encoding: " . $this->Mail->attachment[$i][3] . ", ";
|
||||
$ReportBody .= "Type: " . $this->Mail->attachment[$i][4] . $eol;
|
||||
}
|
||||
$ReportBody .= $bullet_end . $eol;
|
||||
}
|
||||
|
||||
// If there are changes then list them
|
||||
if(count($this->ChangeLog) > 0)
|
||||
{
|
||||
$ReportBody .= "Changes" . $eol;
|
||||
$ReportBody .= "-------" . $eol;
|
||||
|
||||
$ReportBody .= $bullet_start;
|
||||
for($i = 0; $i < count($this->ChangeLog); $i++)
|
||||
{
|
||||
$ReportBody .= $bullet . $this->ChangeLog[$i][0] . " was changed to [" .
|
||||
$this->ChangeLog[$i][1] . "]" . $eol;
|
||||
}
|
||||
$ReportBody .= $bullet_end . $eol . $eol;
|
||||
}
|
||||
|
||||
// If there are notes then list them
|
||||
if(count($this->NoteLog) > 0)
|
||||
{
|
||||
$ReportBody .= "Notes" . $eol;
|
||||
$ReportBody .= "-----" . $eol;
|
||||
|
||||
$ReportBody .= $bullet_start;
|
||||
for($i = 0; $i < count($this->NoteLog); $i++)
|
||||
{
|
||||
$ReportBody .= $bullet . $this->NoteLog[$i] . $eol;
|
||||
}
|
||||
$ReportBody .= $bullet_end;
|
||||
}
|
||||
|
||||
// Re-attach the original body
|
||||
$this->Mail->Body .= $eol . $eol . $ReportBody;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check which default settings have been changed for the report.
|
||||
* @private
|
||||
* @returns void
|
||||
*/
|
||||
function CheckChanges() {
|
||||
if($this->Mail->Priority != 3)
|
||||
$this->AddChange("Priority", $this->Mail->Priority);
|
||||
if($this->Mail->Encoding != "8bit")
|
||||
$this->AddChange("Encoding", $this->Mail->Encoding);
|
||||
if($this->Mail->CharSet != "iso-8859-1")
|
||||
$this->AddChange("CharSet", $this->Mail->CharSet);
|
||||
if($this->Mail->Sender != "")
|
||||
$this->AddChange("Sender", $this->Mail->Sender);
|
||||
if($this->Mail->WordWrap != 0)
|
||||
$this->AddChange("WordWrap", $this->Mail->WordWrap);
|
||||
if($this->Mail->Mailer != "mail")
|
||||
$this->AddChange("Mailer", $this->Mail->Mailer);
|
||||
if($this->Mail->Port != 25)
|
||||
$this->AddChange("Port", $this->Mail->Port);
|
||||
if($this->Mail->Helo != "localhost.localdomain")
|
||||
$this->AddChange("Helo", $this->Mail->Helo);
|
||||
if($this->Mail->SMTPAuth)
|
||||
$this->AddChange("SMTPAuth", "true");
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a change entry.
|
||||
* @private
|
||||
* @returns void
|
||||
*/
|
||||
function AddChange($sName, $sNewValue) {
|
||||
$cur = count($this->ChangeLog);
|
||||
$this->ChangeLog[$cur][0] = $sName;
|
||||
$this->ChangeLog[$cur][1] = $sNewValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a simple note to the message.
|
||||
* @public
|
||||
* @returns void
|
||||
*/
|
||||
function AddNote($sValue) {
|
||||
$this->NoteLog[] = $sValue;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds all of the addresses
|
||||
* @public
|
||||
* @returns void
|
||||
*/
|
||||
function SetAddress($sAddress, $sName = "", $sType = "to") {
|
||||
switch($sType)
|
||||
{
|
||||
case "to":
|
||||
$this->Mail->AddAddress($sAddress, $sName);
|
||||
break;
|
||||
case "cc":
|
||||
$this->Mail->AddCC($sAddress, $sName);
|
||||
break;
|
||||
case "bcc":
|
||||
$this->Mail->AddBCC($sAddress, $sName);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////
|
||||
// UNIT TESTS
|
||||
/////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
* Try a plain message.
|
||||
*/
|
||||
function test_WordWrap() {
|
||||
|
||||
$this->Mail->WordWrap = 40;
|
||||
$my_body = "Here is the main body of this message. It should " .
|
||||
"be quite a few lines. It should be wrapped at the " .
|
||||
"40 characters. Make sure that it is.";
|
||||
$nBodyLen = strlen($my_body);
|
||||
$my_body .= "\n\nThis is the above body length: " . $nBodyLen;
|
||||
|
||||
$this->Mail->Body = $my_body;
|
||||
$this->Mail->Subject .= ": Wordwrap";
|
||||
|
||||
$this->BuildBody();
|
||||
$this->assert($this->Mail->Send(), $this->Mail->ErrorInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* Try a plain message.
|
||||
*/
|
||||
function test_Low_Priority() {
|
||||
|
||||
$this->Mail->Priority = 5;
|
||||
$this->Mail->Body = "Here is the main body. There should be " .
|
||||
"a reply to address in this message.";
|
||||
$this->Mail->Subject .= ": Low Priority";
|
||||
$this->Mail->AddReplyTo("nobody@nobody.com", "Nobody (Unit Test)");
|
||||
|
||||
$this->BuildBody();
|
||||
$this->assert($this->Mail->Send(), $this->Mail->ErrorInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* Simple plain file attachment test.
|
||||
*/
|
||||
function test_Multiple_Plain_FileAttachment() {
|
||||
|
||||
$this->Mail->Body = "Here is the text body";
|
||||
$this->Mail->Subject .= ": Plain + Multiple FileAttachments";
|
||||
|
||||
if(!$this->Mail->AddAttachment("test.png"))
|
||||
{
|
||||
$this->assert(false, $this->Mail->ErrorInfo);
|
||||
return;
|
||||
}
|
||||
|
||||
if(!$this->Mail->AddAttachment("phpmailer_test.php", "test.txt"))
|
||||
{
|
||||
$this->assert(false, $this->Mail->ErrorInfo);
|
||||
return;
|
||||
}
|
||||
|
||||
$this->BuildBody();
|
||||
$this->assert($this->Mail->Send(), $this->Mail->ErrorInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* Simple plain string attachment test.
|
||||
*/
|
||||
function test_Plain_StringAttachment() {
|
||||
|
||||
$this->Mail->Body = "Here is the text body";
|
||||
$this->Mail->Subject .= ": Plain + StringAttachment";
|
||||
|
||||
$sAttachment = "These characters are the content of the " .
|
||||
"string attachment.\nThis might be taken from a ".
|
||||
"database or some other such thing. ";
|
||||
|
||||
$this->Mail->AddStringAttachment($sAttachment, "string_attach.txt");
|
||||
|
||||
$this->BuildBody();
|
||||
$this->assert($this->Mail->Send(), $this->Mail->ErrorInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* Plain quoted-printable message.
|
||||
*/
|
||||
function test_Quoted_Printable() {
|
||||
|
||||
$this->Mail->Body = "Here is the main body";
|
||||
$this->Mail->Subject .= ": Plain + Quoted-printable";
|
||||
$this->Mail->Encoding = "quoted-printable";
|
||||
|
||||
$this->BuildBody();
|
||||
$this->assert($this->Mail->Send(), $this->Mail->ErrorInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* Try a plain message.
|
||||
*/
|
||||
function test_Html() {
|
||||
|
||||
$this->Mail->IsHTML(true);
|
||||
$this->Mail->Subject .= ": HTML only";
|
||||
|
||||
$this->Mail->Body = "This is a <b>test message</b> written in HTML. </br>" .
|
||||
"Go to <a href=\"http://phpmailer.sourceforge.net/\">" .
|
||||
"http://phpmailer.sourceforge.net/</a> for new versions of " .
|
||||
"phpmailer. <p/> Thank you!";
|
||||
|
||||
$this->BuildBody();
|
||||
$this->assert($this->Mail->Send(), $this->Mail->ErrorInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* Simple HTML and attachment test
|
||||
*/
|
||||
function test_HTML_Attachment() {
|
||||
|
||||
$this->Mail->Body = "This is the <b>HTML</b> part of the email.";
|
||||
$this->Mail->Subject .= ": HTML + Attachment";
|
||||
$this->Mail->IsHTML(true);
|
||||
|
||||
if(!$this->Mail->AddAttachment("phpmailer_test.php", "test_attach.txt"))
|
||||
{
|
||||
$this->assert(false, $this->Mail->ErrorInfo);
|
||||
return;
|
||||
}
|
||||
|
||||
$this->BuildBody();
|
||||
$this->assert($this->Mail->Send(), $this->Mail->ErrorInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* An embedded attachment test.
|
||||
*/
|
||||
function test_Embedded_Image() {
|
||||
|
||||
$this->Mail->Body = "Embedded Image: <img alt=\"phpmailer\" src=\"cid:my-attach\">" .
|
||||
"Here is an image!</a>";
|
||||
$this->Mail->Subject .= ": Embedded Image";
|
||||
$this->Mail->IsHTML(true);
|
||||
|
||||
if(!$this->Mail->AddEmbeddedImage("test.png", "my-attach", "test.png",
|
||||
"base64", "image/png"))
|
||||
{
|
||||
$this->assert(false, $this->Mail->ErrorInfo);
|
||||
return;
|
||||
}
|
||||
|
||||
$this->BuildBody();
|
||||
$this->assert($this->Mail->Send(), $this->Mail->ErrorInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* An embedded attachment test.
|
||||
*/
|
||||
function test_Multi_Embedded_Image() {
|
||||
|
||||
$this->Mail->Body = "Embedded Image: <img alt=\"phpmailer\" src=\"cid:my-attach\">" .
|
||||
"Here is an image!</a>";
|
||||
$this->Mail->Subject .= ": Embedded Image + Attachment";
|
||||
$this->Mail->IsHTML(true);
|
||||
|
||||
if(!$this->Mail->AddEmbeddedImage("test.png", "my-attach", "test.png",
|
||||
"base64", "image/png"))
|
||||
{
|
||||
$this->assert(false, $this->Mail->ErrorInfo);
|
||||
return;
|
||||
}
|
||||
|
||||
if(!$this->Mail->AddAttachment("phpmailer_test.php", "test.txt"))
|
||||
{
|
||||
$this->assert(false, $this->Mail->ErrorInfo);
|
||||
return;
|
||||
}
|
||||
|
||||
$this->BuildBody();
|
||||
$this->assert($this->Mail->Send(), $this->Mail->ErrorInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* Simple multipart/alternative test.
|
||||
*/
|
||||
function test_AltBody() {
|
||||
|
||||
$this->Mail->Body = "This is the <b>HTML</b> part of the email.";
|
||||
$this->Mail->AltBody = "Here is the text body of this message. " .
|
||||
"It should be quite a few lines. It should be wrapped at the " .
|
||||
"40 characters. Make sure that it is.";
|
||||
$this->Mail->WordWrap = 40;
|
||||
$this->AddNote("This is a mulipart alternative email");
|
||||
$this->Mail->Subject .= ": AltBody + Word Wrap";
|
||||
|
||||
$this->BuildBody();
|
||||
$this->assert($this->Mail->Send(), $this->Mail->ErrorInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
* Simple HTML and attachment test
|
||||
*/
|
||||
function test_AltBody_Attachment() {
|
||||
|
||||
$this->Mail->Body = "This is the <b>HTML</b> part of the email.";
|
||||
$this->Mail->AltBody = "This is the text part of the email.";
|
||||
$this->Mail->Subject .= ": AltBody + Attachment";
|
||||
$this->Mail->IsHTML(true);
|
||||
|
||||
if(!$this->Mail->AddAttachment("phpmailer_test.php", "test_attach.txt"))
|
||||
{
|
||||
$this->assert(false, $this->Mail->ErrorInfo);
|
||||
return;
|
||||
}
|
||||
|
||||
$this->BuildBody();
|
||||
$this->assert($this->Mail->Send(), $this->Mail->ErrorInfo);
|
||||
|
||||
$fp = fopen("message.txt", "w");
|
||||
fwrite($fp, $this->Mail->CreateHeader() . $this->Mail->CreateBody());
|
||||
fclose($fp);
|
||||
}
|
||||
|
||||
function test_MultipleSend() {
|
||||
$this->Mail->Body = "Sending two messages without keepalive";
|
||||
$this->BuildBody();
|
||||
$subject = $this->Mail->Subject;
|
||||
|
||||
$this->Mail->Subject = $subject . ": SMTP 1";
|
||||
$this->assert($this->Mail->Send(), $this->Mail->ErrorInfo);
|
||||
|
||||
$this->Mail->Subject = $subject . ": SMTP 2";
|
||||
$this->assert($this->Mail->Send(), $this->Mail->ErrorInfo);
|
||||
}
|
||||
|
||||
function test_SmtpKeepAlive() {
|
||||
$this->Mail->Body = "This was done using the SMTP keep-alive.";
|
||||
$this->BuildBody();
|
||||
$subject = $this->Mail->Subject;
|
||||
|
||||
$this->Mail->SMTPKeepAlive = true;
|
||||
$this->Mail->Subject = $subject . ": SMTP keep-alive 1";
|
||||
$this->assert($this->Mail->Send(), $this->Mail->ErrorInfo);
|
||||
|
||||
$this->Mail->Subject = $subject . ": SMTP keep-alive 2";
|
||||
$this->assert($this->Mail->Send(), $this->Mail->ErrorInfo);
|
||||
$this->Mail->SmtpClose();
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests this denial of service attack:
|
||||
* http://www.cybsec.com/vuln/PHPMailer-DOS.pdf
|
||||
*/
|
||||
function test_DenialOfServiceAttack() {
|
||||
$this->Mail->Body = "This should no longer cause a denial of service.";
|
||||
$this->BuildBody();
|
||||
|
||||
$this->Mail->Subject = str_repeat("A", 998);
|
||||
$this->assert($this->Mail->Send(), $this->Mail->ErrorInfo);
|
||||
}
|
||||
|
||||
function test_Error() {
|
||||
$this->Mail->Subject .= ": This should be sent";
|
||||
$this->BuildBody();
|
||||
$this->Mail->ClearAllRecipients(); // no addresses should cause an error
|
||||
$this->assert($this->Mail->IsError() == false, "Error found");
|
||||
$this->assert($this->Mail->Send() == false, "Send succeeded");
|
||||
$this->assert($this->Mail->IsError(), "No error found");
|
||||
$this->assertEquals('You must provide at least one ' .
|
||||
'recipient email address.', $this->Mail->ErrorInfo);
|
||||
$this->Mail->AddAddress(get("mail_to"));
|
||||
$this->assert($this->Mail->Send(), "Send failed");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Create and run test instance.
|
||||
*/
|
||||
|
||||
if(isset($HTTP_GET_VARS))
|
||||
$global_vars = $HTTP_GET_VARS;
|
||||
else
|
||||
$global_vars = $_REQUEST;
|
||||
|
||||
if(isset($global_vars["submitted"]))
|
||||
{
|
||||
echo "Test results:<br>";
|
||||
$suite = new TestSuite( "phpmailerTest" );
|
||||
|
||||
$testRunner = new TestRunner;
|
||||
$testRunner->run($suite);
|
||||
echo "<hr noshade/>";
|
||||
}
|
||||
|
||||
function get($sName) {
|
||||
global $global_vars;
|
||||
if(isset($global_vars[$sName]))
|
||||
return $global_vars[$sName];
|
||||
else
|
||||
return "";
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<html>
|
||||
<body>
|
||||
<h3>phpmailer Unit Test</h3>
|
||||
By entering a SMTP hostname it will automatically perform tests with SMTP.
|
||||
|
||||
<form name="phpmailer_unit" action="phpmailer_test.php" method="get">
|
||||
<input type="hidden" name="submitted" value="1"/>
|
||||
To Address: <input type="text" size="50" name="mail_to" value="<?php echo get("mail_to"); ?>"/>
|
||||
<br/>
|
||||
Cc Address: <input type="text" size="50" name="mail_cc" value="<?php echo get("mail_cc"); ?>"/>
|
||||
<br/>
|
||||
SMTP Hostname: <input type="text" size="50" name="mail_host" value="<?php echo get("mail_host"); ?>"/>
|
||||
<p/>
|
||||
<input type="submit" value="Run Test"/>
|
||||
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
376
modules/EcmDocuments/phpmailer/test/phpunit.php
Executable file
376
modules/EcmDocuments/phpmailer/test/phpunit.php
Executable file
@@ -0,0 +1,376 @@
|
||||
<?php
|
||||
//
|
||||
// PHP framework for testing, based on the design of "JUnit".
|
||||
//
|
||||
// Written by Fred Yankowski <fred@ontosys.com>
|
||||
// OntoSys, Inc <http://www.OntoSys.com>
|
||||
//
|
||||
// $Id: phpunit.php,v 1.1 2002/03/30 19:32:17 bmatzelle Exp $
|
||||
|
||||
// Copyright (c) 2000 Fred Yankowski
|
||||
|
||||
// Permission is hereby granted, free of charge, to any person
|
||||
// obtaining a copy of this software and associated documentation
|
||||
// files (the "Software"), to deal in the Software without
|
||||
// restriction, including without limitation the rights to use, copy,
|
||||
// modify, merge, publish, distribute, sublicense, and/or sell copies
|
||||
// of the Software, and to permit persons to whom the Software is
|
||||
// furnished to do so, subject to the following conditions:
|
||||
//
|
||||
// The above copyright notice and this permission notice shall be
|
||||
// included in all copies or substantial portions of the Software.
|
||||
//
|
||||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
|
||||
// BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
||||
// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
||||
// CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
// SOFTWARE.
|
||||
//
|
||||
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE |
|
||||
E_CORE_ERROR | E_CORE_WARNING);
|
||||
|
||||
/*
|
||||
interface Test {
|
||||
function run(&$aTestResult);
|
||||
function countTestCases();
|
||||
}
|
||||
*/
|
||||
|
||||
function trace($msg) {
|
||||
return;
|
||||
print($msg);
|
||||
flush();
|
||||
}
|
||||
|
||||
|
||||
class Exception {
|
||||
/* Emulate a Java exception, sort of... */
|
||||
var $message;
|
||||
function Exception($message) {
|
||||
$this->message = $message;
|
||||
}
|
||||
function getMessage() {
|
||||
return $this->message;
|
||||
}
|
||||
}
|
||||
|
||||
class Assert {
|
||||
function assert($boolean, $message=0) {
|
||||
if (! $boolean)
|
||||
$this->fail($message);
|
||||
}
|
||||
|
||||
function assertEquals($expected, $actual, $message=0) {
|
||||
if ($expected != $actual) {
|
||||
$this->failNotEquals($expected, $actual, "expected", $message);
|
||||
}
|
||||
}
|
||||
|
||||
function assertRegexp($regexp, $actual, $message=false) {
|
||||
if (! preg_match($regexp, $actual)) {
|
||||
$this->failNotEquals($regexp, $actual, "pattern", $message);
|
||||
}
|
||||
}
|
||||
|
||||
function failNotEquals($expected, $actual, $expected_label, $message=0) {
|
||||
// Private function for reporting failure to match.
|
||||
$str = $message ? ($message . ' ') : '';
|
||||
$str .= "($expected_label/actual)<br>";
|
||||
$htmlExpected = htmlspecialchars($expected);
|
||||
$htmlActual = htmlspecialchars($actual);
|
||||
$str .= sprintf("<pre>%s\n--------\n%s</pre>",
|
||||
$htmlExpected, $htmlActual);
|
||||
$this->fail($str);
|
||||
}
|
||||
}
|
||||
|
||||
class TestCase extends Assert /* implements Test */ {
|
||||
/* Defines context for running tests. Specific context -- such as
|
||||
instance variables, global variables, global state -- is defined
|
||||
by creating a subclass that specializes the setUp() and
|
||||
tearDown() methods. A specific test is defined by a subclass
|
||||
that specializes the runTest() method. */
|
||||
var $fName;
|
||||
var $fResult;
|
||||
var $fExceptions = array();
|
||||
|
||||
function TestCase($name) {
|
||||
$this->fName = $name;
|
||||
}
|
||||
|
||||
function run($testResult=0) {
|
||||
/* Run this single test, by calling the run() method of the
|
||||
TestResult object which will in turn call the runBare() method
|
||||
of this object. That complication allows the TestResult object
|
||||
to do various kinds of progress reporting as it invokes each
|
||||
test. Create/obtain a TestResult object if none was passed in.
|
||||
Note that if a TestResult object was passed in, it must be by
|
||||
reference. */
|
||||
if (! $testResult)
|
||||
$testResult = $this->_createResult();
|
||||
$this->fResult = $testResult;
|
||||
$testResult->run(&$this);
|
||||
$this->fResult = 0;
|
||||
return $testResult;
|
||||
}
|
||||
|
||||
function countTestCases() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
function runTest() {
|
||||
$name = $this->name();
|
||||
// Since isset($this->$name) is false, no way to run defensive checks
|
||||
$this->$name();
|
||||
}
|
||||
|
||||
function setUp() /* expect override */ {
|
||||
//print("TestCase::setUp()<br>\n");
|
||||
}
|
||||
|
||||
function tearDown() /* possible override */ {
|
||||
//print("TestCase::tearDown()<br>\n");
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
function _createResult() /* protected */ {
|
||||
/* override this to use specialized subclass of TestResult */
|
||||
return new TestResult;
|
||||
}
|
||||
|
||||
function fail($message=0) {
|
||||
//printf("TestCase::fail(%s)<br>\n", ($message) ? $message : '');
|
||||
/* JUnit throws AssertionFailedError here. We just record the
|
||||
failure and carry on */
|
||||
$this->fExceptions[] = new Exception(&$message);
|
||||
}
|
||||
|
||||
function error($message) {
|
||||
/* report error that requires correction in the test script
|
||||
itself, or (heaven forbid) in this testing infrastructure */
|
||||
printf('<b>ERROR: ' . $message . '</b><br>');
|
||||
$this->fResult->stop();
|
||||
}
|
||||
|
||||
function failed() {
|
||||
return count($this->fExceptions);
|
||||
}
|
||||
|
||||
function getExceptions() {
|
||||
return $this->fExceptions;
|
||||
}
|
||||
|
||||
function name() {
|
||||
return $this->fName;
|
||||
}
|
||||
|
||||
function runBare() {
|
||||
$this->setup();
|
||||
$this->runTest();
|
||||
$this->tearDown();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class TestSuite /* implements Test */ {
|
||||
/* Compose a set of Tests (instances of TestCase or TestSuite), and
|
||||
run them all. */
|
||||
var $fTests = array();
|
||||
|
||||
function TestSuite($classname=false) {
|
||||
if ($classname) {
|
||||
// Find all methods of the given class whose name starts with
|
||||
// "test" and add them to the test suite. We are just _barely_
|
||||
// able to do this with PHP's limited introspection... Note
|
||||
// that PHP seems to store method names in lower case, and we
|
||||
// have to avoid the constructor function for the TestCase class
|
||||
// superclass. This will fail when $classname starts with
|
||||
// "Test" since that will have a constructor method that will
|
||||
// get matched below and then treated (incorrectly) as a test
|
||||
// method. So don't name any TestCase subclasses as "Test..."!
|
||||
if (floor(phpversion()) >= 4) {
|
||||
// PHP4 introspection, submitted by Dylan Kuhn
|
||||
$names = get_class_methods($classname);
|
||||
while (list($key, $method) = each($names)) {
|
||||
if (preg_match('/^test/', $method) && $method != "testcase") {
|
||||
$this->addTest(new $classname($method));
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
$dummy = new $classname("dummy");
|
||||
$names = (array) $dummy;
|
||||
while (list($key, $value) = each($names)) {
|
||||
$type = gettype($value);
|
||||
if ($type == "user function" && preg_match('/^test/', $key)
|
||||
&& $key != "testcase") {
|
||||
$this->addTest(new $classname($key));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function addTest($test) {
|
||||
/* Add TestCase or TestSuite to this TestSuite */
|
||||
$this->fTests[] = $test;
|
||||
}
|
||||
|
||||
function run(&$testResult) {
|
||||
/* Run all TestCases and TestSuites comprising this TestSuite,
|
||||
accumulating results in the given TestResult object. */
|
||||
reset($this->fTests);
|
||||
while (list($na, $test) = each($this->fTests)) {
|
||||
if ($testResult->shouldStop())
|
||||
break;
|
||||
$test->run(&$testResult);
|
||||
}
|
||||
}
|
||||
|
||||
function countTestCases() {
|
||||
/* Number of TestCases comprising this TestSuite (including those
|
||||
in any constituent TestSuites) */
|
||||
$count = 0;
|
||||
reset($fTests);
|
||||
while (list($na, $test_case) = each($this->fTests)) {
|
||||
$count += $test_case->countTestCases();
|
||||
}
|
||||
return $count;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class TestFailure {
|
||||
/* Record failure of a single TestCase, associating it with the
|
||||
exception(s) that occurred */
|
||||
var $fFailedTestName;
|
||||
var $fExceptions;
|
||||
|
||||
function TestFailure(&$test, &$exceptions) {
|
||||
$this->fFailedTestName = $test->name();
|
||||
$this->fExceptions = $exceptions;
|
||||
}
|
||||
|
||||
function getExceptions() {
|
||||
return $this->fExceptions;
|
||||
}
|
||||
function getTestName() {
|
||||
return $this->fFailedTestName;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class TestResult {
|
||||
/* Collect the results of running a set of TestCases. */
|
||||
var $fFailures = array();
|
||||
var $fRunTests = 0;
|
||||
var $fStop = false;
|
||||
|
||||
function TestResult() { }
|
||||
|
||||
function _endTest($test) /* protected */ {
|
||||
/* specialize this for end-of-test action, such as progress
|
||||
reports */
|
||||
}
|
||||
|
||||
function getFailures() {
|
||||
return $this->fFailures;
|
||||
}
|
||||
|
||||
function run($test) {
|
||||
/* Run a single TestCase in the context of this TestResult */
|
||||
$this->_startTest($test);
|
||||
$this->fRunTests++;
|
||||
|
||||
$test->runBare();
|
||||
|
||||
/* this is where JUnit would catch AssertionFailedError */
|
||||
$exceptions = $test->getExceptions();
|
||||
if ($exceptions)
|
||||
$this->fFailures[] = new TestFailure(&$test, &$exceptions);
|
||||
$this->_endTest($test);
|
||||
}
|
||||
|
||||
function countTests() {
|
||||
return $this->fRunTests;
|
||||
}
|
||||
|
||||
function shouldStop() {
|
||||
return $this->fStop;
|
||||
}
|
||||
|
||||
function _startTest($test) /* protected */ {
|
||||
/* specialize this for start-of-test actions */
|
||||
}
|
||||
|
||||
function stop() {
|
||||
/* set indication that the test sequence should halt */
|
||||
$fStop = true;
|
||||
}
|
||||
|
||||
function countFailures() {
|
||||
return count($this->fFailures);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class TextTestResult extends TestResult {
|
||||
/* Specialize TestResult to produce text/html report */
|
||||
function TextTestResult() {
|
||||
$this->TestResult(); // call superclass constructor
|
||||
}
|
||||
|
||||
function report() {
|
||||
/* report result of test run */
|
||||
$nRun = $this->countTests();
|
||||
$nFailures = $this->countFailures();
|
||||
printf("<p>%s test%s run<br>", $nRun, ($nRun == 1) ? '' : 's');
|
||||
printf("%s failure%s.<br>\n", $nFailures, ($nFailures == 1) ? '' : 's');
|
||||
if ($nFailures == 0)
|
||||
return;
|
||||
|
||||
print("<ol>\n");
|
||||
$failures = $this->getFailures();
|
||||
while (list($i, $failure) = each($failures)) {
|
||||
$failedTestName = $failure->getTestName();
|
||||
printf("<li>%s\n", $failedTestName);
|
||||
|
||||
$exceptions = $failure->getExceptions();
|
||||
print("<ul>");
|
||||
while (list($na, $exception) = each($exceptions))
|
||||
printf("<li>%s\n", $exception->getMessage());
|
||||
print("</ul>");
|
||||
}
|
||||
print("</ol>\n");
|
||||
}
|
||||
|
||||
function _startTest($test) {
|
||||
printf("%s ", $test->name());
|
||||
flush();
|
||||
}
|
||||
|
||||
function _endTest($test) {
|
||||
$outcome = $test->failed()
|
||||
? "<font color=\"red\">FAIL</font>"
|
||||
: "<font color=\"green\">ok</font>";
|
||||
printf("$outcome<br>\n");
|
||||
flush();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class TestRunner {
|
||||
/* Run a suite of tests and report results. */
|
||||
function run($suite) {
|
||||
$result = new TextTestResult;
|
||||
$suite->run($result);
|
||||
$result->report();
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
9
modules/EcmDocuments/save_tree_settings.php
Executable file
9
modules/EcmDocuments/save_tree_settings.php
Executable file
@@ -0,0 +1,9 @@
|
||||
<?
|
||||
session_start();
|
||||
include("../../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']);
|
||||
$z="update users set tree_width='".str_replace("px","",$_GET['width'])."',tree_height='".str_replace("px","",$_GET['height'])."' where id='".$_SESSION['authenticated_user_id']."'";
|
||||
mysql_query($z);
|
||||
mysql_close($sql);
|
||||
?>
|
||||
462
modules/EcmDocuments/search_projects.php
Executable file
462
modules/EcmDocuments/search_projects.php
Executable file
@@ -0,0 +1,462 @@
|
||||
<?
|
||||
function search_ids($id,$html="")
|
||||
{
|
||||
$z="select id from ecmdocuments where iddir='".$id."' and deleted='0'";
|
||||
$w=mysql_query($z);
|
||||
while($r=mysql_fetch_array($w))
|
||||
{
|
||||
$html.=$r['id']."||";
|
||||
$html=search_ids($r['id'],$html);
|
||||
}
|
||||
return $html;
|
||||
}
|
||||
$record=$_REQUEST['record'];
|
||||
$ids=search_ids($record,"").$record;
|
||||
$idy=explode("||",$ids);
|
||||
|
||||
////////////////////////Contracts/////////////////////////
|
||||
if($_GET['tab']=="Contracts" or $_GET['tab']=="All")
|
||||
{
|
||||
foreach($idy as $idx)
|
||||
{
|
||||
$z="select contract_id from ecmdocuments_contracts where ecmdocument_id='".$idx."' and deleted='0'";
|
||||
$w=mysql_query($z);
|
||||
while($r=mysql_fetch_array($w))
|
||||
{
|
||||
if($_GET['tab']=="Contracts")
|
||||
{
|
||||
if(mysql_num_rows(mysql_query("select id from contracts where id='".$r['contract_id']."' and name like '%".$_POST['name']."%' and kntr_description like '%".$_POST['kntr_description']."%' and group_name like '%".$_POST['group_name']."%' and contractant_name like '%".$_POST['contractant_name']."%' and signedon like '%".$_POST['signedon']."%' and deleted='0'"))>0)$contracts[]=$r['contract_id'];
|
||||
}
|
||||
else
|
||||
{
|
||||
if(mysql_num_rows(mysql_query("select id from contracts where id='".$r['contract_id']."' and name like '%".$_POST['name']."%' and kntr_description like '%".$_POST['description']."%' and deleted='0'"))>0)$contracts[]=$r['contract_id'];
|
||||
}
|
||||
}
|
||||
}
|
||||
$contractsw="";
|
||||
$i=0;
|
||||
if(count($contracts)>0)
|
||||
{
|
||||
foreach($contracts as $contract)
|
||||
{
|
||||
if($i==0)$or="";
|
||||
else $or=" or";
|
||||
$contractsw.=$or." id='".$contract."'";
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////Correspondences/////////////////////////
|
||||
if($_GET['tab']=="Correspondences" or $_GET['tab']=="All")
|
||||
{
|
||||
foreach($idy as $idx)
|
||||
{
|
||||
$z="select correspondence_id from ecmdocuments_correspondences where ecmdocument_id='".$idx."' and deleted='0'";
|
||||
$w=mysql_query($z);
|
||||
while($r=mysql_fetch_array($w))
|
||||
{
|
||||
if($_GET['tab']=="Correspondences")
|
||||
{
|
||||
if(mysql_num_rows(mysql_query("select id from correspondences where id='".$r['correspondence_id']."' and name like '%".$_POST['name']."%' and account_name_from like '%".$_POST['account_name_from']."%' and account_name_to like '%".$_POST['account_name_to']."%' and krsp_description like '%".$_POST['krsp_description']."%' and document_date like '%".$_POST['document_date']."%' and delivery_date like '%".$_POST['delivery_date']."%' and stamp_date like '%".$_POST['stamp_date']."%' and reg_date like '%".$_POST['reg_date']."%' and deleted='0'"))>0)$correspondences[]=$r['correspondence_id'];
|
||||
}
|
||||
else
|
||||
{
|
||||
if(mysql_num_rows(mysql_query("select id from correspondences where id='".$r['correspondence_id']."' and name like '%".$_POST['name']."%' and krsp_description like '%".$_POST['description']."%' and deleted='0'"))>0)$correspondences[]=$r['correspondence_id'];
|
||||
}
|
||||
}
|
||||
}
|
||||
$correspondencesw="";
|
||||
$i=0;
|
||||
if(count($correspondences)>0)
|
||||
{
|
||||
foreach($correspondences as $correspondence)
|
||||
{
|
||||
if($i==0)$or="";
|
||||
else $or=" or";
|
||||
$correspondencesw.=$or." id='".$correspondence."'";
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////EcmInvoices/////////////////////////
|
||||
if($_GET['tab']=="EcmInvoices" or $_GET['tab']=="All")
|
||||
{
|
||||
foreach($idy as $idx)
|
||||
{
|
||||
$z="select ecminvoice_id from ecmdocuments_ecminvoices where ecmdocument_id='".$idx."' and deleted='0'";
|
||||
$w=mysql_query($z);
|
||||
while($r=mysql_fetch_array($w))
|
||||
{
|
||||
if($_GET['tab']=="EcmInvoices")
|
||||
{
|
||||
if(mysql_num_rows(mysql_query("select id from ecminvoices where id='".$r['ecminvoice_id']."' and name like '%".$_POST['name']."%' and description like '%".$_POST['ekmn_description']."%' and filename like '%".$_POST['ekmn_filename']."%' and from_name like '%".$_POST['from_name']."%' and to_name like '%".$_POST['to_name']."%' and deleted='0'"))>0)$ecminvoices[]=$r['ecminvoice_id'];
|
||||
}
|
||||
else
|
||||
{
|
||||
if(mysql_num_rows(mysql_query("select id from ecminvoices where id='".$r['ecminvoice_id']."' and name like '%".$_POST['name']."%' and description like '%".$_POST['description']."%' and deleted='0'"))>0)$ecminvoices[]=$r['ecminvoice_id'];
|
||||
}
|
||||
}
|
||||
}
|
||||
$ecminvoicesw="";
|
||||
$i=0;
|
||||
if(count($ecminvoices)>0)
|
||||
{
|
||||
foreach($ecminvoices as $ecminvoice)
|
||||
{
|
||||
if($i==0)$or="";
|
||||
else $or=" or";
|
||||
$ecminvoicesw.=$or." id='".$ecminvoice."'";
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////Contracts/////////////////////////
|
||||
if($_GET['tab']=="EcmFiles" or $_GET['tab']=="All")
|
||||
{
|
||||
foreach($idy as $idx)
|
||||
{
|
||||
$z="select ecmfile_id from ecmdocuments_ecmfiles where ecmdocument_id='".$idx."' and deleted='0'";
|
||||
$w=mysql_query($z);
|
||||
while($r=mysql_fetch_array($w))
|
||||
{
|
||||
if($_GET['tab']=="EcmFiles")
|
||||
{
|
||||
if(mysql_num_rows(mysql_query("select id from ecmfiles where id='".$r['ecmfile_id']."' and name like '%".$_POST['name']."%' and description like '%".$_POST['description']."%' and deleted='0'"))>0)$ecmfiles[]=$r['ecmfile_id'];
|
||||
}
|
||||
else
|
||||
{
|
||||
if(mysql_num_rows(mysql_query("select id from ecmfiles where id='".$r['ecmfile_id']."' and name like '%".$_POST['name']."%' and description like '%".$_POST['description']."%' and deleted='0'"))>0)$ecmfiles[]=$r['ecmfile_id'];
|
||||
}
|
||||
}
|
||||
}
|
||||
$ecmfilesw="";
|
||||
$i=0;
|
||||
if(count($ecmfiles)>0)
|
||||
{
|
||||
foreach($ecmfiles as $ecmfile)
|
||||
{
|
||||
if($i==0)$or="";
|
||||
else $or=" or";
|
||||
$ecmfilesw.=$or." id='".$ecmfile."'";
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
<form id="form1" name="form1" method="post" action="index.php?module=EcmDocuments&action=SearchProjects&record=<?print $_REQUEST['record'];?>&tab=<?print $_REQUEST['tab'];?>">
|
||||
<ul class="tablist">
|
||||
<li <?if($_GET['tab']=="All")print 'class="active"';?>><a <?if($_GET['tab']=="All")print 'class="current"';?> href="index.php?module=EcmDocuments&action=SearchProjects&record=<?print $_GET['record'];?>&tab=All">All</a></li>
|
||||
<li <?if($_GET['tab']=="Contracts")print 'class="active"';?>><a <?if($_GET['tab']=="Contracts")print 'class="current"';?> href="index.php?module=EcmDocuments&action=SearchProjects&record=<?print $_GET['record'];?>&tab=Contracts">Contracts</a></li>
|
||||
<li <?if($_GET['tab']=="Correspondences")print 'class="active"';?>><a <?if($_GET['tab']=="Correspondences")print 'class="current"';?> href="index.php?module=EcmDocuments&action=SearchProjects&record=<?print $_GET['record'];?>&tab=Correspondences">Correspondences</a></li>
|
||||
<li <?if($_GET['tab']=="EcmInvoices")print 'class="active"';?>><a <?if($_GET['tab']=="EcmInvoices")print 'class="current"';?> href="index.php?module=EcmDocuments&action=SearchProjects&record=<?print $_GET['record'];?>&tab=EcmInvoices">EcmInvoices</a></li>
|
||||
<li <?if($_GET['tab']=="EcmFiles")print 'class="active"';?>><a <?if($_GET['tab']=="EcmFiles")print 'class="current"';?> href="index.php?module=EcmDocuments&action=SearchProjects&record=<?print $_GET['record'];?>&tab=EcmFiles">EcmFiles</a></li>
|
||||
</ul>
|
||||
<?
|
||||
if($_GET['tab']=="All")
|
||||
{
|
||||
print '
|
||||
<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">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"></span sugar="slot"></td>
|
||||
<td width="20%" valign="top" class="dataLabel"><span sugar="slot`3`">Description</span sugar="slot"></td>
|
||||
<td width="30%" valign="top" class="dataField"><span sugar="slot`3`b">
|
||||
<textarea name="description" cols="25" rows="4" id="description" tabindex="`3`" title="Description"></textarea>
|
||||
</span sugar="slot"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>';
|
||||
}
|
||||
if($_GET['tab']=="Contracts")
|
||||
{
|
||||
print '<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"></span sugar="slot">Name</td>
|
||||
<td width="30%" valign="top" class="dataField"><span sugar="slot1b"><input name="name" type="text" tabindex="1" size="30" maxlength="50" value=""></span sugar="slot"></td>
|
||||
<td width="20%" valign="top" class="dataLabel">Signed On</td>
|
||||
<td width="30%" valign="top" class="dataField"><input name="signedon" id="signedon_field" onBlur="SugarWidgetScheduler.update_time();" tabindex="1" size="10" maxlength="11" type="text" value="">
|
||||
<slot><img src="themes/Sugar/images/jscalendar.gif" alt="Enter Date" id="signedon_trigger" align="absmiddle"/> <span class="dateFormat">(yyyy-mm-dd)</span></slot>
|
||||
<script type="text/javascript">
|
||||
Calendar.setup ({
|
||||
inputField : "signedon_field", ifFormat : "%Y-%m-%d", showsTime : false, button : "signedon_trigger", singleClick : true, step : 1
|
||||
});
|
||||
</script></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td rowspan="3" valign="top" class="dataLabel">Description</td>
|
||||
<td width="30%" rowspan="2" valign="top" class="dataField"><span sugar="slot`3b">
|
||||
<textarea name="kntr_description" title="Description" tabindex="`3`" cols="25" rows="4"></textarea>
|
||||
</span sugar="slot"></td>
|
||||
<td class="dataLabel" valign="top">Celtic Group</td>
|
||||
<td class="dataField"><input name="group_name" type="text" id="group_name" tabindex="1" value="" size="25" maxlength="50" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top" class="dataLabel">Contractant</td>
|
||||
<td class="dataField"><input name="contractant_name" type="text" id="contractant_name" tabindex="1" value="" size="25" maxlength="50" /></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
';
|
||||
}
|
||||
if($_GET['tab']=="Correspondences")
|
||||
{
|
||||
print '
|
||||
<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">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"></span sugar="slot"></td>
|
||||
<td width="20%" valign="top" class="dataLabel">Reg Date </td>
|
||||
<td width="30%" valign="top" class="dataField"><input name="reg_date" id="reg_date_field" onBlur="SugarWidgetScheduler.update_time();" tabindex="1" size="10" maxlength="11" type="text" />
|
||||
<img src="themes/Sugar/images/jscalendar.gif" alt="Enter Date" id="reg_date_trigger" align="absmiddle"/> <span class="dateFormat">(yyyy-mm-dd)</span>
|
||||
<script type="text/javascript">
|
||||
Calendar.setup ({
|
||||
inputField : "reg_date_field", ifFormat : "%Y-%m-%d", showsTime : false, button : "reg_date_trigger", singleClick : true, step : 1
|
||||
});
|
||||
</script></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top"><span class="dataLabel">Account Name From </span></td><td valign="top"><span class="dataField">
|
||||
<input name="account_name_from" type="text" id="account_name_from" tabindex="1" size="25" maxlength="50" />
|
||||
</span></td>
|
||||
<td class="dataLabel" valign="top">Account Name To </td>
|
||||
<td class="dataField"><input name="account_name_to" type="text" id="account_name_to" tabindex="1" size="25" maxlength="50" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top"><span class="dataLabel">Document Date </span></td>
|
||||
<td valign="top"><input name="document_date" id="document_date_field" onblur="SugarWidgetScheduler.update_time();" tabindex="11" size="10" maxlength="11" type="text" />
|
||||
<img src="themes/Sugar/images/jscalendar.gif" alt="Enter Date" id="document_date_trigger" align="absmiddle"/> <span class="dateFormat">(yyyy-mm-dd)</span>
|
||||
<script type="text/javascript">
|
||||
Calendar.setup ({
|
||||
inputField : "document_date_field", ifFormat : "%Y-%m-%d", showsTime : false, button : "document_date_trigger", singleClick : true, step : 1
|
||||
});
|
||||
</script></td>
|
||||
<td rowspan="3" valign="top" class="dataLabel"><span sugar="slot`3`">Description</span sugar="slot"></td>
|
||||
<td rowspan="3" valign="top" class="dataField"><span sugar="slot`3`b">
|
||||
<textarea name="krsp_description" title="Description" tabindex="3" cols="25" rows="4"></textarea>
|
||||
</span sugar="slot"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top"><span class="dataLabel">Stamp Date </span></td>
|
||||
<td valign="top"><input name="stamp_date" id="stamp_date_field" onblur="SugarWidgetScheduler.update_time();" tabindex="11" size="10" maxlength="11" type="text" />
|
||||
<img src="themes/Sugar/images/jscalendar.gif" alt="Enter Date" id="stamp_date_trigger" align="absmiddle"/> <span class="dateFormat">(yyyy-mm-dd)</span>
|
||||
<script type="text/javascript">
|
||||
Calendar.setup ({
|
||||
inputField : "stamp_date_field", ifFormat : "%Y-%m-%d", showsTime : false, button : "stamp_date_trigger", singleClick : true, step : 1
|
||||
});
|
||||
</script></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top"><span class="dataLabel">Delivery Date </span></td>
|
||||
<td valign="top"><input name="delivery_date" id="delivery_date_field" onblur="SugarWidgetScheduler.update_time();" tabindex="11" size="10" maxlength="11" type="text" />
|
||||
<img src="themes/Sugar/images/jscalendar.gif" alt="Enter Date" id="delivery_date_trigger" align="absmiddle"/> <span class="dateFormat">(yyyy-mm-dd)</span>
|
||||
<script type="text/javascript">
|
||||
Calendar.setup ({
|
||||
inputField : "delivery_date_field", ifFormat : "%Y-%m-%d", showsTime : false, button : "delivery_date_trigger", singleClick : true, step : 1
|
||||
});
|
||||
</script></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>';
|
||||
}
|
||||
if($_GET['tab']=="EcmInvoices")
|
||||
{
|
||||
print '
|
||||
<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">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"></span sugar="slot"></td>
|
||||
<td width="20%" valign="top" class="dataLabel">Filename</td>
|
||||
<td width="30%" valign="top" class="dataField"><span sugar="slot1b">
|
||||
<input name="ekmn_filename" title="Filename" type="text" tabindex="1" maxlength="255">
|
||||
</span sugar="slot"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td rowspan="3" valign="top"><span class="dataLabel"><span sugar="slot`3`">Description</span sugar="slot"></span></td><td rowspan="3" valign="top"><span class="dataField"><span sugar="slot`3`b">
|
||||
<textarea name="ekmn_description" title="Description" tabindex="`3`" cols="25" rows="4"></textarea>
|
||||
</span sugar="slot"></span></td>
|
||||
|
||||
<td valign="top" class="dataLabel">From</td>
|
||||
<td valign="top" class="dataField"><input name="from_name" type="text" id="from_name" tabindex="1" title="Filename" maxlength="255" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top" class="dataLabel">To</td>
|
||||
<td valign="top" class="dataField"><input name="to_name" type="text" id="to_name" tabindex="1" title="Filename" maxlength="255" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top" class="dataLabel"> </td>
|
||||
<td valign="top" class="dataField"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>';
|
||||
}
|
||||
|
||||
if($_GET['tab']=="EcmFiles")
|
||||
{
|
||||
print '
|
||||
<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">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"></span sugar="slot"></td>
|
||||
<td width="20%" valign="top" class="dataLabel"><span sugar="slot`3`">Description</span sugar="slot"></td>
|
||||
<td width="30%" valign="top" class="dataField"><span sugar="slot`3`b">
|
||||
<textarea name="description" cols="25" rows="4" id="description" tabindex="`3`" title="Description"></textarea>
|
||||
</span sugar="slot"></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>';
|
||||
}
|
||||
?>
|
||||
<input type="submit" name="search" value="Search" class="button">
|
||||
</form>
|
||||
<?
|
||||
////////////////////////Contracts/////////////////////////
|
||||
if($_GET['tab']=="Contracts" or $_GET['tab']=="All")
|
||||
{
|
||||
print '<div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div></p><p><table width="100%" cellpadding="0" cellspacing="0" border="0" class="h3Row"><tr><td nowrap><h3>Contracts List</h3></td><td width="100%"><IMG height="1" width="1" src="include/images/blank.gif" alt=""></td></tr></table><table cellpadding="0" cellspacing="0" width="100%" border="0" class="listView">
|
||||
<tr height="20">
|
||||
<td scope="col" width="40%" class="listViewThS1" NOWRAP>Name</td>
|
||||
<td scope="col" width="20%" class="listViewThS1" NOWRAP>Celtic Group</td>
|
||||
<td scope="col" width="23%" class="listViewThS1" NOWRAP>Contractant</td>
|
||||
<td scope="col" width="20%" class="listViewThS1" NOWRAP>Signed On</td>
|
||||
</tr>';
|
||||
if(!$contractsw)$contractsw="id='xxx'";
|
||||
$z="select distinct * from contracts where ".$contractsw." order by name";
|
||||
$w=mysql_query($z);
|
||||
while($r=mysql_fetch_array($w))
|
||||
{
|
||||
print '
|
||||
<tr height="20">
|
||||
|
||||
<td scope="row" valign=TOP class="oddListRowS1" bgcolor="#ffffff">
|
||||
<slot><a href="index.php?action=DetailView&module=Contracts&record='.$r['id'].'" class="listViewTdLinkS1">'.$r['name'].'</a></slot> </td>
|
||||
|
||||
<td valign=TOP class="oddListRowS1" bgcolor="#ffffff" nowrap><a href="index.php?action=DetailView&module=Accounts&record='.$r['group_id'].'" class="listViewTdLinkS1">'.$r['group_name'].'</a></td>
|
||||
<td valign=TOP class="oddListRowS1" bgcolor="#ffffff" nowrap><a href="index.php?action=DetailView&module=Accounts&record='.$r['contractant_id'].'" class="listViewTdLinkS1">'.$r['contractant_name'].'</a></td>
|
||||
<td valign=TOP class="oddListRowS1" bgcolor="#ffffff" nowrap>'.$r['signedon'].'</td>
|
||||
|
||||
</tr>
|
||||
<tr><td colspan="27" class="listViewHRS1"></td></tr>
|
||||
';
|
||||
}
|
||||
print '</table>';
|
||||
}
|
||||
////////////////////////Correspondences/////////////////////////
|
||||
if($_GET['tab']=="Correspondences" or $_GET['tab']=="All")
|
||||
{
|
||||
print '<div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div></p><p><table width="100%" cellpadding="0" cellspacing="0" border="0" class="h3Row"><tr><td nowrap><h3>Correspondence List</h3></td><td width="100%"><IMG height="1" width="1" src="include/images/blank.gif" alt=""></td></tr></table><table cellpadding="0" cellspacing="0" width="100%" border="0" class="listView">
|
||||
<tr height="20">
|
||||
<td scope="col" width="40%" class="listViewThS1" NOWRAP>Name</td>
|
||||
<td scope="col" width="20%" class="listViewThS1" NOWRAP>From</td>
|
||||
<td scope="col" width="20%" class="listViewThS1" NOWRAP>To</td>
|
||||
<td scope="col" width="20%" class="listViewThS1" NOWRAP>Register Date</td>
|
||||
</tr>';
|
||||
if(!$correspondencesw)$correspondencesw="id='xxx'";
|
||||
$z="select distinct * from correspondences where ".$correspondencesw." order by name";
|
||||
$w=mysql_query($z);
|
||||
while($r=mysql_fetch_array($w))
|
||||
{
|
||||
print '
|
||||
<tr height="20">
|
||||
|
||||
<td scope="row" valign=TOP class="oddListRowS1" bgcolor="#ffffff">
|
||||
<slot><a href="index.php?action=DetailView&module=Correspondences&record='.$r['id'].'" class="listViewTdLinkS1">'.$r['name'].'</a></slot> </td>
|
||||
|
||||
<td valign=TOP class="oddListRowS1" bgcolor="#ffffff" nowrap><a href="index.php?action=DetailView&module=Accounts&record='.$r['account_from'].'" class="listViewTdLinkS1">'.$r['account_name_from'].'</a></td>
|
||||
<td valign=TOP class="oddListRowS1" bgcolor="#ffffff" nowrap><a href="index.php?action=DetailView&module=Accounts&record='.$r['account_to'].'" class="listViewTdLinkS1">'.$r['account_name_to'].'</a></td>
|
||||
<td valign=TOP class="oddListRowS1" bgcolor="#ffffff" nowrap>'.$r['reg_date'].'</td>
|
||||
|
||||
</tr>
|
||||
<tr><td colspan="27" class="listViewHRS1"></td></tr>
|
||||
';
|
||||
}
|
||||
print '</table>';
|
||||
}
|
||||
////////////////////////EcmInvoices/////////////////////////
|
||||
if($_GET['tab']=="EcmInvoices" or $_GET['tab']=="All")
|
||||
{
|
||||
print '<div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div></p><p><table width="100%" cellpadding="0" cellspacing="0" border="0" class="h3Row"><tr><td nowrap><h3>EcmInvoices List</h3></td><td width="100%"><IMG height="1" width="1" src="include/images/blank.gif" alt=""></td></tr></table>
|
||||
<table cellpadding="0" cellspacing="0" width="100%" border="0" class="listView">
|
||||
<tr height="20">
|
||||
<td scope="col" width="40%" class="listViewThS1" NOWRAP>Name</td>
|
||||
<td scope="col" width="20%" class="listViewThS1" NOWRAP>From</td>
|
||||
<td scope="col" width="20%" class="listViewThS1" NOWRAP>To</td>
|
||||
<td scope="col" width="20%" class="listViewThS1" NOWRAP>Type</td>
|
||||
</tr>';
|
||||
if(!$ecminvoicesw)$ecminvoicesw="id='xxx'";
|
||||
$z="select distinct * from ecminvoices where ".$ecminvoicesw." order by name";
|
||||
$w=mysql_query($z);
|
||||
while($r=mysql_fetch_array($w))
|
||||
{
|
||||
print '
|
||||
<!-- BEGIN: row -->
|
||||
<tr height="20">
|
||||
|
||||
<td scope="row" valign=TOP class="oddListRowS1" bgcolor="#ffffff">
|
||||
<slot><a href="index.php?action=DetailView&module=EcmInvoices&record='.$r['id'].'" class="listViewTdLinkS1">'.$r['name'].'</a></slot> </td>
|
||||
|
||||
<td valign=TOP class="oddListRowS1" bgcolor="#ffffff" nowrap><a href="index.php?action=DetailView&module=Accounts&record='.$r['from_id'].'" class="listViewTdLinkS1">'.$r['from_name'].'</a></td>
|
||||
<td valign=TOP class="oddListRowS1" bgcolor="#ffffff" nowrap><a href="index.php?action=DetailView&module=Accounts&record='.$r['to_id'].'" class="listViewTdLinkS1">'.$r['to_name'].'</a></td>
|
||||
<td valign=TOP class="oddListRowS1" bgcolor="#ffffff" nowrap>'.$r['invoice_type'].'</td>
|
||||
|
||||
</tr>
|
||||
<tr><td colspan="27" class="listViewHRS1"></td></tr>
|
||||
';
|
||||
}
|
||||
print '</table>';
|
||||
}
|
||||
////////////////////////EcmFiles/////////////////////////
|
||||
if($_GET['tab']=="EcmFiles" or $_GET['tab']=="All")
|
||||
{
|
||||
print '<div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div></p><p><table width="100%" cellpadding="0" cellspacing="0" border="0" class="h3Row"><tr><td nowrap><h3>EcmFiles List</h3></td><td width="100%"><IMG height="1" width="1" src="include/images/blank.gif" alt=""></td></tr></table>
|
||||
<table cellpadding="0" cellspacing="0" width="100%" border="0" class="listView">
|
||||
<tr height="20">
|
||||
<td scope="col" width="40%" class="listViewThS1" NOWRAP>Name</td>
|
||||
</tr>';
|
||||
if(!$ecmfilesw)$ecmfilesw="id='xxx'";
|
||||
$z="select distinct * from ecmfiles where ".$ecmfilesw." order by name";
|
||||
$w=mysql_query($z);
|
||||
while($r=mysql_fetch_array($w))
|
||||
{
|
||||
print '
|
||||
<!-- BEGIN: row -->
|
||||
<tr height="20">
|
||||
|
||||
<td scope="row" valign=TOP class="oddListRowS1" bgcolor="#ffffff">
|
||||
<slot><a href="index.php?action=DetailView&module=EcmFiles&record='.$r['id'].'" class="listViewTdLinkS1">'.$r['name'].'</a></slot> </td>
|
||||
|
||||
</tr>
|
||||
<tr><td colspan="27" class="listViewHRS1"></td></tr>
|
||||
';
|
||||
}
|
||||
print '</table>';
|
||||
}
|
||||
?>
|
||||
5
modules/EcmDocuments/setSearch.php
Executable file
5
modules/EcmDocuments/setSearch.php
Executable file
@@ -0,0 +1,5 @@
|
||||
<?
|
||||
session_start();
|
||||
$_SESSION['type_search']=$_GET['what'];j
|
||||
print $_SESSION['type_search']."mmmmmmmmmmm";
|
||||
?>
|
||||
40
modules/EcmDocuments/show_related_ecm.php
Executable file
40
modules/EcmDocuments/show_related_ecm.php
Executable file
@@ -0,0 +1,40 @@
|
||||
<?
|
||||
session_start();
|
||||
require_once("../../config.php");
|
||||
print '<html >
|
||||
<head >
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
</head>
|
||||
<body>
|
||||
';
|
||||
$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']);
|
||||
mysql_query("set names utf8");
|
||||
mysql_query("set charaecterset utf8");
|
||||
require_once("dirstree.php");
|
||||
$z="select ecmdocument_id from ".$_REQUEST['relation']." where ".$_REQUEST['relationid']."='".$_REQUEST['record']."' and deleted=0";
|
||||
$rr=mysql_fetch_array(mysql_query("select name from ".str_replace("ecmdocuments_","",$_REQUEST['relation'])." where id='".$_REQUEST['record']."'"));
|
||||
$name=$rr['name'];
|
||||
|
||||
$w=mysql_query($z);
|
||||
while($r=mysql_fetch_array($w))$idp[]=$r['ecmdocument_id'];
|
||||
$linked_path="";
|
||||
if(mysql_num_rows($w)>0)
|
||||
{
|
||||
foreach($idp as $ids)
|
||||
{
|
||||
$bl=explode("||",$ids."||".check_block($ids,""));
|
||||
for($i=count($bl)-1;$i>=0;$i--)
|
||||
{
|
||||
$z="select name,id,no from ecmdocuments where id='".$bl[$i]."'";
|
||||
$w=mysql_query($z);
|
||||
$r=mysql_fetch_array($w);
|
||||
if($r['name'])$linked_path.='<a class=utilsLink href=index.php?module=EcmDocuments&action=DetailView&record='.$r['id'].'>'.$r['no'].'.'.$r['name'].'</a> / ';
|
||||
}
|
||||
$linked_path.="<br>";
|
||||
}
|
||||
}
|
||||
print shortlinkdescription("name",255,$_REQUEST['record'],$linked_path,"",$_REQUEST['module'],1,$name);
|
||||
mysql_close($sql);
|
||||
print "</body></html>";
|
||||
?>
|
||||
38
modules/EcmDocuments/show_related_ecm_ajax.php
Executable file
38
modules/EcmDocuments/show_related_ecm_ajax.php
Executable file
@@ -0,0 +1,38 @@
|
||||
<?
|
||||
function show_related_ecm($relation,$relationid,$record,$module)
|
||||
{
|
||||
$z="select ecmdocument_id from ".$relation." where ".$relationid."='".$record."' and deleted=0";
|
||||
if($module=="Contacts")$wh="first_name,last_name";
|
||||
else $wh="name";
|
||||
$rr=mysql_fetch_array(mysql_query("select ".$wh." from ".str_replace("ecmdocuments_","",$relation)." where id='".$record."'"));
|
||||
$name=$rr['name'];
|
||||
if($relation=="ecmdocuments_emails" && !$name)$name="<NO SUBJECT>";
|
||||
if($module=="Contacts")$name=$rr['first_name']." ".$rr['last_name'];
|
||||
$w=mysql_query($z);
|
||||
while($r=mysql_fetch_array($w))$idp[]=$r['ecmdocument_id'];
|
||||
$linked_path="";
|
||||
if(mysql_num_rows($w)>0)
|
||||
{
|
||||
foreach($idp as $ids)
|
||||
{
|
||||
$bl=explode("||",$ids."||".check_block($ids,""));
|
||||
for($i=count($bl)-1;$i>=0;$i--)
|
||||
{
|
||||
$z="select name,id,no from ecmdocuments where id='".$bl[$i]."'";
|
||||
$w=mysql_query($z);
|
||||
$r=mysql_fetch_array($w);
|
||||
if($r['name'])$linked_path.='<a class=utilsLink href=index.php?module=EcmDocuments&action=DetailView&record='.$r['id'].'>'.$r['no'].'.'.$r['name'].'</a> / ';
|
||||
}
|
||||
$linked_path.="<br>";
|
||||
}
|
||||
}
|
||||
$name=str_replace("\n","",$name);
|
||||
$name=str_replace("\l","",$name);
|
||||
$name=str_replace("\r","",$name);
|
||||
$name=str_replace("'","·",$name);
|
||||
$name=str_replace('"',""",$name);
|
||||
$name=str_replace('
|
||||
',"",$name);
|
||||
return shortlinkdescription("name",255,$record,$linked_path,"",$module,1,$name);
|
||||
}
|
||||
?>
|
||||
14
modules/EcmDocuments/showhide_panel.php
Executable file
14
modules/EcmDocuments/showhide_panel.php
Executable file
@@ -0,0 +1,14 @@
|
||||
<?
|
||||
session_start();
|
||||
include("../../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']);
|
||||
if($_GET['what']=="firstblock")$set="show_details='".$_GET['value']."'";
|
||||
if($_GET['what']=="uploadblock")$set="show_upload='".$_GET['value']."'";
|
||||
if($_GET['what']=="optionsblock")$set="show_options='".$_GET['value']."'";
|
||||
if($_GET['what']=="searchblock")$set="show_search='".$_GET['value']."'";
|
||||
if($_GET['what']=="ListViewSmb")$set="show_smb='".$_GET['value']."'";
|
||||
$z="update ecmdocuments set ".$set." where id='".$_GET['record']."'";
|
||||
mysql_query($z);
|
||||
mysql_close($sql);
|
||||
?>
|
||||
19
modules/EcmDocuments/showtree_email.php
Executable file
19
modules/EcmDocuments/showtree_email.php
Executable file
@@ -0,0 +1,19 @@
|
||||
<?
|
||||
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']);
|
||||
mysql_query("set names utf8");
|
||||
mysql_query("set charaecterset utf8");
|
||||
|
||||
require_once("dirstree.php");
|
||||
if($_GET['iddirs']=="")$_GET['iddirs']=$_SESSION['email_iddir'];
|
||||
if($_GET['iddir'])$iddir=$_GET['iddir'];
|
||||
else $iddir=0;
|
||||
$_SESSION['email_iddir']=$iddir;
|
||||
$target=$_GET['target'];
|
||||
$tab=$_GET['tab'];
|
||||
echo display_dir_data_email($iddir,$sql,$_SESSION['authenticated_user_id'],$_GET['target'],$_GET['tab']);
|
||||
mysql_close($sql);
|
||||
?>
|
||||
10
modules/EcmDocuments/updateTime.php
Executable file
10
modules/EcmDocuments/updateTime.php
Executable file
@@ -0,0 +1,10 @@
|
||||
<?
|
||||
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']);
|
||||
$z="update ".$_REQUEST['type']." set date_start='".$_REQUEST['date']."',time_start='".$_REQUEST['date']."' where id='".$_REQUEST['record']."'";
|
||||
if(mysql_query($z))print "saved";
|
||||
else print "no";
|
||||
mysql_close($sql);
|
||||
?>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user