init
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',
|
||||
'hidden' => true);
|
||||
?>
|
||||
@@ -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']);
|
||||
?>
|
||||
180
modules/EcmDocuments/DetailView.html
Executable file
180
modules/EcmDocuments/DetailView.html
Executable file
@@ -0,0 +1,180 @@
|
||||
<!--
|
||||
/*****************************************************************************
|
||||
* The contents of this file are subject to the RECIPROCAL PUBLIC LICENSE
|
||||
* Version 1.1 ("License"); You may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
* http://opensource.org/licenses/rpl.php. Software distributed under the
|
||||
* License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
|
||||
* either express or implied.
|
||||
*
|
||||
* You may:
|
||||
* a) Use and distribute this code exactly as you received without payment or
|
||||
* a royalty or other fee.
|
||||
* b) Create extensions for this code, provided that you make the extensions
|
||||
* publicly available and document your modifications clearly.
|
||||
* c) Charge for a fee for warranty or support or for accepting liability
|
||||
* obligations for your customers.
|
||||
*
|
||||
* You may NOT:
|
||||
* a) Charge for the use of the original code or extensions, including in
|
||||
* electronic distribution models, such as ASP (Application Service
|
||||
* Provider).
|
||||
* b) Charge for the original source code or your extensions other than a
|
||||
* nominal fee to cover distribution costs where such distribution
|
||||
* involves PHYSICAL media.
|
||||
* c) Modify or delete any pre-existing copyright notices, change notices,
|
||||
* or License text in the Licensed Software
|
||||
* d) Assert any patent claims against the Licensor or Contributors, or
|
||||
* which would in any way restrict the ability of any third party to use the
|
||||
* Licensed Software.
|
||||
*
|
||||
* You must:
|
||||
* a) Document any modifications you make to this code including the nature of
|
||||
* the change, the authors of the change, and the date of the change.
|
||||
* b) Make the source code for any extensions you deploy available via an
|
||||
* Electronic Distribution Mechanism such as FTP or HTTP download.
|
||||
* c) Notify the licensor of the availability of source code to your extensions
|
||||
* and include instructions on how to acquire the source code and updates.
|
||||
* d) Grant Licensor a world-wide, non-exclusive, royalty-free license to use,
|
||||
* reproduce, perform, modify, sublicense, and distribute your extensions.
|
||||
*
|
||||
* The Original Code is: CommuniCore
|
||||
* Olavo Farias
|
||||
* 2006-04-7 olavo.farias@gmail.com
|
||||
*
|
||||
* The Initial Developer of the Original Code is CommuniCore.
|
||||
* Portions created by CommuniCore are Copyright (C) 2005 CommuniCore Ltda
|
||||
* All Rights Reserved.
|
||||
********************************************************************************/
|
||||
-->
|
||||
<!-- BEGIN: main -->
|
||||
<div style="background:#ffffff;display:none;position:absolute; top:20; left:20; border:solid; border-width:2px; border-color:#333333" id="fade" class="fade"><div style="text-align:center; vertical-align:middle"><br />
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<span style="font-size:16px; font-weight: bold;">Loading</span><br /><img src="modules/EcmDocuments/images/loading-big.gif" border="0" width="100" height="100"></div></div>
|
||||
<script>
|
||||
document.getElementById('fade').style.width=screen.width-57;
|
||||
document.getElementById('fade').style.height=screen.height-215;
|
||||
</script>
|
||||
<script type="text/javascript" src="include/javascript/overlibmws.js"></script>
|
||||
<script>
|
||||
function quick_create_overlib(id, theme, db_id) {
|
||||
return overlib(
|
||||
"<a style='width: 150px' class='menuItem' onmouseover='hiliteItem(this,\"yes\");' onmouseout='unhiliteItem(this);' href='index.php?module=EcmContracts&action=EditView&samba_file=" + id + "&db_id=" + db_id + "'>" +
|
||||
"<img border='0' src='themes/" + theme + "/images/Contracts.gif' style='margin-right:5px'>"
|
||||
+ "Contract" + "</a>" +
|
||||
"<a style='width: 150px' class='menuItem' onmouseover='hiliteItem(this,\"yes\");' onmouseout='unhiliteItem(this);' href='index.php?module=EcmCorrespondenceIns&action=EditView&samba_file=" + id + "&db_id=" + db_id + "'>" +
|
||||
"<img border='0' src='themes/" + theme + "/images/Contracts.gif' style='margin-right:5px'>"
|
||||
+ "Correspondence In" + "</a>" +
|
||||
"<a style='width: 150px' class='menuItem' onmouseover='hiliteItem(this,\"yes\");' onmouseout='unhiliteItem(this);' href='index.php?module=EcmCorrespondenceOuts&action=EditView&samba_file=" + id + "&db_id=" + db_id + "'>" +
|
||||
"<img border='0' src='themes/" + theme + "/images/Contracts.gif' style='margin-right:5px'>"
|
||||
+ "Correspondence Out" + "</a>" +
|
||||
"<a style='width: 150px' class='menuItem' onmouseover='hiliteItem(this,\"yes\");' onmouseout='unhiliteItem(this);' href='index.php?module=EcmDocs&action=EditView&samba_file=" + id + "&db_id=" + db_id + "'>" +
|
||||
"<img border='0' src='themes/" + theme + "/images/Contracts.gif' style='margin-right:5px'>"
|
||||
+ "File" + "</a>" +
|
||||
"<a style='width: 150px' class='menuItem' onmouseover='hiliteItem(this,\"yes\");' onmouseout='unhiliteItem(this);' href='index.php?module=EcmInvoiceIns&action=EditView&samba_file=" + id + "&db_id=" + db_id + "'>" +
|
||||
"<img border='0' src='themes/" + theme + "/images/Contracts.gif' style='margin-right:5px'>"
|
||||
+ "Invoice In" + "</a>" +
|
||||
"<a style='width: 150px' class='menuItem' onmouseover='hiliteItem(this,\"yes\");' onmouseout='unhiliteItem(this);' href='index.php?module=EcmInvoiceOuts&action=EditView&samba_file=" + id + "&db_id=" + db_id + "'>" +
|
||||
"<img border='0' src='themes/" + theme + "/images/Contracts.gif' style='margin-right:5px'>"
|
||||
+ "Invoice Out" + "</a>"
|
||||
, CAPTION, "Quick Create"
|
||||
, STICKY, MOUSEOFF, 3000, CLOSETEXT, '<img border=0 src="themes/' + theme + '/images/close_inline.gif">', WIDTH, 150, CLOSETITLE, SUGAR.language.get('app_strings', 'LBL_ADDITIONAL_DETAILS_CLOSE_TITLE'), CLOSECLICK, FGCLASS, 'olOptionsFgClass',
|
||||
CGCLASS, 'olOptionsCgClass', BGCLASS, 'olBgClass', TEXTFONTCLASS, 'olFontClass', CAPTIONFONTCLASS, 'olOptionsCapFontClass', CLOSEFONTCLASS, 'olOptionsCloseFontClass');
|
||||
}
|
||||
</script>
|
||||
<form action="index.php" method="post" name="DetailView" id="form">
|
||||
<input type="hidden" name="module" value="EcmDocuments">
|
||||
<input type="hidden" name="record" value="{ID}">
|
||||
<input type="hidden" name="isDuplicate" value=false>
|
||||
<input type="hidden" name="action">
|
||||
<input type="hidden" name="return_module">
|
||||
<input type="hidden" name="return_action">
|
||||
<input type="hidden" name="return_id" >
|
||||
<input type="hidden" name="contact_id">
|
||||
<input type="hidden" name="task_id">
|
||||
<input type="hidden" name="meeting_id">
|
||||
<input type="hidden" name="call_id">
|
||||
<input type="hidden" name="account_id">
|
||||
<input type="hidden" name="case_id">
|
||||
|
||||
</form>
|
||||
{SEARCHBLOCK}<br />
|
||||
|
||||
<table width="100%" cellspacing="0" cellpadding="0" border="0" class="subpanelTabForm" style="padding-top: 0px; margin-top: 0px; border-top: 0px none; border-bottom: 0px none; margin-bottom: 0px; padding-bottom: 0px;">
|
||||
<tr>
|
||||
<td>
|
||||
<table width="100%" cellpadding="0" cellspacing="0" border="0" class="h3Row"><tr><td width="100%" nowrap><h3><a name="ecmdocuments"></a>
|
||||
<a style="cursor:pointer;" class='utilsLink' onclick="displayshowblock('firstblock');"><input type="hidden" id="firstblock_input" value="{FIRSTBLOCKINPUTVALUE}" /><img src='themes/{THEME}/images/{IMGD}_search.gif' id='firstblock_image' width='8' height='8' alt="Hide" border="0" align="absmiddle"></a> Details</h3></td><td width='100%'><IMG height='1' width='1' src='include/images/blank.gif' alt=''></td></tr>
|
||||
</table>
|
||||
<div id="firstblock" class="{CLASSD}">
|
||||
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td width="50%"><form action="index.php?module=EcmDocuments&action=SaveInformation&record={ID}" method="post">
|
||||
|
||||
|
||||
<table width="100%" border="0" cellspacing="{GRIDLINE}" cellpadding="0" class="tabDetailView">
|
||||
<tr>
|
||||
<td width="15%" class="tabDetailViewDL"><span sugar='slot1'>{MOD.LBL_NAME}</span sugar='slot'></td>
|
||||
<td width="35%" class="tabDetailViewDF"><span sugar='slot1b'>{NAME} </span sugar='slot'></td>
|
||||
<td width="15%" valign="top" class="tabDetailViewDL">Cloning</td>
|
||||
<td width="35%" colspan="2" valign="top" class="tabDetailViewDF">{CLONING}</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td valign="top" class="tabDetailViewDL"><span sugar='slot2'>Full Path</span sugar='slot'></td>
|
||||
<td valign="top" class="tabDetailViewDF"><span sugar='slot2b'>{SCIEZKA}</span sugar='slot'></td>
|
||||
<td valign="top" class="tabDetailViewDL">Shortcut</td>
|
||||
<td colspan="2" valign="top" class="tabDetailViewDF">{SHORTCUT}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top" class="tabDetailViewDL">Date Modified </td>
|
||||
<td valign="top" class="tabDetailViewDF">{DATE_MODIFIED}</td>
|
||||
<td colspan="3" rowspan="2" valign="top" class="tabDetailViewDL">{OPTIONSBLOCK}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td valign="top" class="tabDetailViewDL">Date Created </td>
|
||||
<td valign="top" class="tabDetailViewDF">{DATE_ENTERED}</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td valign="top" class="tabDetailViewDL"><span sugar='slot3'>Description</span sugar='slot'></td>
|
||||
<td valign="top" class="tabDetailViewDF"><span sugar='slot3b'>{DESCRIPTION} {SAVEINFO}</span sugar='slot'></td>
|
||||
<td valign="top" class="tabDetailViewDL"><span sugar='slot2'>{APP.LBL_ASSIGNED_TO}</span sugar='slot'></td>
|
||||
<td align="left" valign="top" class="tabDetailViewDL"><table width="10" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td><span class="tabDetailViewDF"><span sugar='slot2b'>{ASSIGNED_TO}</span sugar='slot'></span></td>
|
||||
</tr>
|
||||
</table></td>
|
||||
<td align="left" valign="top" class="tabDetailViewDL"> </td>
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td colspan="5" align="left" valign="top" class="tabDetailViewDL"> </td>
|
||||
</tr>
|
||||
</table>
|
||||
</form></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
{SAMBABLOCK}
|
||||
|
||||
<!-- END: main -->
|
||||
<!-- BEGIN: subpanel -->
|
||||
<span sugar='slot23'>{SUBPANEL}</span sugar='slot'>
|
||||
<!-- END: subpanel -->
|
||||
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);
|
||||
}
|
||||
}
|
||||
?>
|
||||
144
modules/EcmDocuments/EditView.html
Executable file
144
modules/EcmDocuments/EditView.html
Executable file
@@ -0,0 +1,144 @@
|
||||
<!--
|
||||
/*****************************************************************************
|
||||
* The contents of this file are subject to the RECIPROCAL PUBLIC LICENSE
|
||||
* Version 1.1 ("License"); You may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
* http://opensource.org/licenses/rpl.php. Software distributed under the
|
||||
* License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
|
||||
* either express or implied.
|
||||
*
|
||||
* You may:
|
||||
* a) Use and distribute this code exactly as you received without payment or
|
||||
* a royalty or other fee.
|
||||
* b) Create extensions for this code, provided that you make the extensions
|
||||
* publicly available and document your modifications clearly.
|
||||
* c) Charge for a fee for warranty or support or for accepting liability
|
||||
* obligations for your customers.
|
||||
*
|
||||
* You may NOT:
|
||||
* a) Charge for the use of the original code or extensions, including in
|
||||
* electronic distribution models, such as ASP (Application Service
|
||||
* Provider).
|
||||
* b) Charge for the original source code or your extensions other than a
|
||||
* nominal fee to cover distribution costs where such distribution
|
||||
* involves PHYSICAL media.
|
||||
* c) Modify or delete any pre-existing copyright notices, change notices,
|
||||
* or License text in the Licensed Software
|
||||
* d) Assert any patent claims against the Licensor or Contributors, or
|
||||
* which would in any way restrict the ability of any third party to use the
|
||||
* Licensed Software.
|
||||
*
|
||||
* You must:
|
||||
* a) Document any modifications you make to this code including the nature of
|
||||
* the change, the authors of the change, and the date of the change.
|
||||
* b) Make the source code for any extensions you deploy available via an
|
||||
* Electronic Distribution Mechanism such as FTP or HTTP download.
|
||||
* c) Notify the licensor of the availability of source code to your extensions
|
||||
* and include instructions on how to acquire the source code and updates.
|
||||
* d) Grant Licensor a world-wide, non-exclusive, royalty-free license to use,
|
||||
* reproduce, perform, modify, sublicense, and distribute your extensions.
|
||||
*
|
||||
* The Original Code is: CommuniCore
|
||||
* Olavo Farias
|
||||
* 2006-04-7 olavo.farias@gmail.com
|
||||
*
|
||||
* The Initial Developer of the Original Code is CommuniCore.
|
||||
* Portions created by CommuniCore are Copyright (C) 2005 CommuniCore Ltda
|
||||
* All Rights Reserved.
|
||||
********************************************************************************/
|
||||
-->
|
||||
<!-- BEGIN: main -->
|
||||
|
||||
<script type="text/javascript" src="include/javascript/popup_parent_helper.js?s={SUGAR_VERSION}&c={JS_CUSTOM_VERSION}"></script>
|
||||
<table cellpadding="0" cellspacing="0" border="0" width="100%">
|
||||
<tr>
|
||||
<form name="EditView" method="POST" action="index.php">
|
||||
<input type="hidden" name="module" value="EcmDocuments">
|
||||
<input type="hidden" name="record" value="{ID}">
|
||||
<input type="hidden" name="action">
|
||||
<input type="hidden" name="return_module" value="{RETURN_MODULE}">
|
||||
<input type="hidden" name="return_id" value="{RETURN_ID}">
|
||||
<input type="hidden" name="return_action" value="{RETURN_ACTION}">
|
||||
<input type="hidden" name="contact_id" value="{CONTACT_ID}">
|
||||
<input type="hidden" name="email_id" value="{EMAIL_ID}">
|
||||
<input type="hidden" name="account_id" value="{ACCOUNT_ID}">
|
||||
<input type="hidden" name="case_id" value="{CASE_ID}">
|
||||
<!--// InboundEmail support //-->
|
||||
<input type="hidden" name="inbound_email_id" value="{INBOUND_EMAIL_ID}">
|
||||
<input type="hidden" name="start" value="{START}">
|
||||
<input type="hidden" name="type" value="{TYPE}">
|
||||
<td style="padding-bottom: 2px;">
|
||||
<input title="{APP.LBL_SAVE_BUTTON_TITLE}" accessKey="{APP.LBL_SAVE_BUTTON_KEY}" class="button"
|
||||
onclick="this.form.action.value='Save';return check_form('EditView');"
|
||||
type="submit" name="button" value=" {APP.LBL_SAVE_BUTTON_LABEL} " >
|
||||
<input title="{APP.LBL_CANCEL_BUTTON_TITLE}" accessKey="{APP.LBL_CANCEL_BUTTON_KEY}" class="button"
|
||||
onclick="this.form.action.value='{RETURN_ACTION}'; this.form.module.value='{RETURN_MODULE}'; this.form.record.value='{RETURN_ID}'"
|
||||
type="submit" name="button" value=" {APP.LBL_CANCEL_BUTTON_LABEL} ">
|
||||
</td>
|
||||
<td align="right" nowrap><span class="required">{APP.LBL_REQUIRED_SYMBOL}</span> {APP.NTC_REQUIRED}</td>
|
||||
<td align='right'>{ADMIN_EDIT}</td>
|
||||
</tr>
|
||||
</table>
|
||||
<p>
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="tabForm">
|
||||
<tr>
|
||||
<td>
|
||||
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
|
||||
<tr>
|
||||
<td width="15%" class="dataLabel"><span sugar='slot1'>{MOD.LBL_NAME} <span class="required">{APP.LBL_REQUIRED_SYMBOL}</span></span sugar='slot'></td>
|
||||
<td width="35%" class="dataField"><span sugar='slot1b'><input name='name' type="text" tabindex='1' size='35' maxlength='50' value="{NAME}"></span sugar='slot'></td>
|
||||
<td class="dataLabel" ><span sugar='slot2'>{APP.LBL_ASSIGNED_TO}</span sugar='slot'></td>
|
||||
<td class="dataField">
|
||||
<span sugar='slot2b'>
|
||||
<input class="sqsEnabled" tabindex="2" autocomplete="off" id="assigned_user_name" name='assigned_user_name' type="text" value="{ASSIGNED_USER_NAME}">
|
||||
<input id='assigned_user_id' name='assigned_user_id' type="hidden" value="{ASSIGNED_USER_ID}" />
|
||||
<input title="{APP.LBL_SELECT_BUTTON_TITLE}" accessKey="{APP.LBL_SELECT_BUTTON_KEY}" type="button" class="button" value='{APP.LBL_SELECT_BUTTON_LABEL}' name=btn1
|
||||
onclick='open_popup("Users", 600, 400, "", true, false, {encoded_users_popup_request_data});' /></span sugar='slot'>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<!-- BEGIN: pro -->
|
||||
<td width="15%" class="dataLabel">
|
||||
<span sugar='slot4'>{APP.LBL_TEAM} <span class="required">{APP.LBL_REQUIRED_SYMBOL}</span></span sugar='slot'>
|
||||
</td>
|
||||
<td class="dataField">
|
||||
<span sugar='slot4b'>
|
||||
<input class="sqsEnabled" tabindex="3" autocomplete="off" id="team_name" name='team_name' type="text" value="{TEAM_NAME}">
|
||||
<input id='team_id' name='team_id' type="hidden" value="{TEAM_ID}" />
|
||||
<input title="{APP.LBL_SELECT_BUTTON_TITLE}" accessKey="{APP.LBL_SELECT_BUTTON_KEY}" type="button" tabindex='4' class="button" value='{APP.LBL_SELECT_BUTTON_LABEL}' name=btn1
|
||||
onclick='open_popup("Teams", 600, 400, "", true, false, {encoded_team_popup_request_data});' />
|
||||
</span sugar='slot'>
|
||||
</td>
|
||||
<!-- END: pro -->
|
||||
|
||||
<!-- BEGIN: open_source -->
|
||||
<!-- END: open_source -->
|
||||
</tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<td width="15%" class="dataLabel" valign="top"><span sugar='slot3'>{MOD.LBL_EKMT_DESCRIPTION}</span sugar='slot'></td>
|
||||
<td width="35%" class="dataField">
|
||||
<span sugar='slot3b'>
|
||||
<textarea name='ekmt_description' title="Description" tabindex='3' cols="30" rows="8">{EKMT_DESCRIPTION}</textarea>
|
||||
</span sugar='slot'>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</p>
|
||||
<div style="padding-top: 2px">
|
||||
<input title="{APP.LBL_SAVE_BUTTON_TITLE}" accessKey="{APP.LBL_SAVE_BUTTON_KEY}" class="button" onclick="this.form.action.value='Save';return check_form('EditView');" type="submit" name="button" value=" {APP.LBL_SAVE_BUTTON_LABEL} " >
|
||||
<input title="{APP.LBL_CANCEL_BUTTON_TITLE}" accessKey="{APP.LBL_CANCEL_BUTTON_KEY}" class="button" onclick="this.form.action.value='{RETURN_ACTION}'; this.form.module.value='{RETURN_MODULE}'; this.form.record.value='{RETURN_ID}'" type="submit" name="button" value=" {APP.LBL_CANCEL_BUTTON_LABEL} ">
|
||||
</div>
|
||||
</form>
|
||||
{JAVASCRIPT}
|
||||
<!-- END: main -->
|
||||
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;
|
||||
}
|
||||
|
||||
?>
|
||||
98
modules/EcmDocuments/ListView.html
Executable file
98
modules/EcmDocuments/ListView.html
Executable file
@@ -0,0 +1,98 @@
|
||||
<!--
|
||||
|
||||
/*****************************************************************************
|
||||
* The contents of this file are subject to the RECIPROCAL PUBLIC LICENSE
|
||||
* Version 1.1 ("License"); You may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
* http://opensource.org/licenses/rpl.php. Software distributed under the
|
||||
* License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
|
||||
* either express or implied.
|
||||
*
|
||||
* You may:
|
||||
* a) Use and distribute this code exactly as you received without payment or
|
||||
* a royalty or other fee.
|
||||
* b) Create extensions for this code, provided that you make the extensions
|
||||
* publicly available and document your modifications clearly.
|
||||
* c) Charge for a fee for warranty or support or for accepting liability
|
||||
* obligations for your customers.
|
||||
*
|
||||
* You may NOT:
|
||||
* a) Charge for the use of the original code or extensions, including in
|
||||
* electronic distribution models, such as ASP (Application Service
|
||||
* Provider).
|
||||
* b) Charge for the original source code or your extensions other than a
|
||||
* nominal fee to cover distribution costs where such distribution
|
||||
* involves PHYSICAL media.
|
||||
* c) Modify or delete any pre-existing copyright notices, change notices,
|
||||
* or License text in the Licensed Software
|
||||
* d) Assert any patent claims against the Licensor or Contributors, or
|
||||
* which would in any way restrict the ability of any third party to use the
|
||||
* Licensed Software.
|
||||
*
|
||||
* You must:
|
||||
* a) Document any modifications you make to this code including the nature of
|
||||
* the change, the authors of the change, and the date of the change.
|
||||
* b) Make the source code for any extensions you deploy available via an
|
||||
* Electronic Distribution Mechanism such as FTP or HTTP download.
|
||||
* c) Notify the licensor of the availability of source code to your extensions
|
||||
* and include instructions on how to acquire the source code and updates.
|
||||
* d) Grant Licensor a world-wide, non-exclusive, royalty-free license to use,
|
||||
* reproduce, perform, modify, sublicense, and distribute your extensions.
|
||||
*
|
||||
* The Original Code is: CommuniCore
|
||||
* Olavo Farias
|
||||
* 2006-04-7 olavo.farias@gmail.com
|
||||
*
|
||||
* The Initial Developer of the Original Code is CommuniCore.
|
||||
* Portions created by CommuniCore are Copyright (C) 2005 CommuniCore Ltda
|
||||
* All Rights Reserved.
|
||||
********************************************************************************/
|
||||
-->
|
||||
<!-- BEGIN: main -->
|
||||
<table cellpadding="0" cellspacing="0" width="100%" border="0" class="listView">
|
||||
<!-- BEGIN: list_nav_row -->
|
||||
{PAGINATION}
|
||||
<!-- END: list_nav_row -->
|
||||
|
||||
<tr height="20">
|
||||
<td scope="col" class="listViewThS1" NOWRAP>{CHECKALL}</td>
|
||||
<td scope="col" width="32%" class="listViewThS1" NOWRAP><slot><a href="{ORDER_BY}name" class="listViewThLinkS1">{MOD.LBL_LIST_SUBJECT}{arrow_start}{name_arrow}{arrow_end}</a></slot></td>
|
||||
|
||||
<!-- BEGIN: pro_nav -->
|
||||
<td scope="col" width="9%" class="listViewThS1" NOWRAP><slot><a href="{ORDER_BY}teams.name" class="listViewThLinkS1">{APP.LBL_LIST_TEAM}{arrow_start}{teams_name_arrow}{arrow_end}</a></slot></td>
|
||||
<!-- END: pro_nav -->
|
||||
|
||||
<!-- BEGIN: open_source -->
|
||||
<!-- END: open_source -->
|
||||
<td scope="col" width="9%" class="listViewThS1" NOWRAP><slot><a href="{ORDER_BY}users.user_name" class="listViewThLinkS1">{APP.LBL_LIST_ASSIGNED_USER}{arrow_start}{users_user_name_arrow}{arrow_end}</a></slot></td>
|
||||
</tr>
|
||||
|
||||
|
||||
<!-- BEGIN: row -->
|
||||
<tr height="20"
|
||||
onmouseover="setPointer(this, '{ECMDOCUMENT.NAME}', 'over', '{BG_COLOR}', '{BG_HILITE}', '{BG_CLICK}');"
|
||||
onmouseout="setPointer(this, '{ECMDOCUMENT.NAME}', 'out', '{BG_COLOR}', '{BG_HILITE}', '{BG_CLICK}');"
|
||||
onmousedown="setPointer(this, '{ECMDOCUMENT.NAME}', 'click', '{BG_COLOR}', '{BG_HILITE}', '{BG_CLICK}');">
|
||||
|
||||
<td class="{ROW_COLOR}S1" bgcolor="{BG_COLOR}" valign='top'>{PREROW}</td>
|
||||
<td scope='row' valign=TOP class="{ROW_COLOR}S1" bgcolor="{BG_COLOR}">
|
||||
<slot>
|
||||
|
||||
<{TAG.MAIN} href="{URL_PREFIX}index.php?action=DetailView&module=EcmDocuments&record={ECMDOCUMENT.ID}&offset={ECMDOCUMENT.OFFSET}&stamp={ECMDOCUMENT.STAMP}" class="listViewTdLinkS1">{ECMDOCUMENT.NAME}</{TAG.MAIN}>
|
||||
</slot>
|
||||
</td>
|
||||
<!-- BEGIN: pro -->
|
||||
<td valign=TOP class="{ROW_COLOR}S1" bgcolor="{BG_COLOR}" nowrap><slot>{ECMDOCUMENT.TEAM_NAME}</slot></td>
|
||||
<!-- END: pro -->
|
||||
|
||||
<!-- BEGIN: open_source -->
|
||||
<!-- END: open_source -->
|
||||
<td valign=TOP class="{ROW_COLOR}S1" bgcolor="{BG_COLOR}" nowrap><slot>{ECMDOCUMENT.ASSIGNED_USER_NAME}</slot></td>
|
||||
|
||||
</tr>
|
||||
<tr><td colspan="20" class="listViewHRS1"></td></tr>
|
||||
<!-- END: row -->
|
||||
{PAGINATION}
|
||||
|
||||
</table>
|
||||
<!-- END: main -->
|
||||
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");
|
||||
?>
|
||||
122
modules/EcmDocuments/Popup.html
Executable file
122
modules/EcmDocuments/Popup.html
Executable file
@@ -0,0 +1,122 @@
|
||||
|
||||
<!--
|
||||
/*****************************************************************************
|
||||
* The contents of this file are subject to the RECIPROCAL PUBLIC LICENSE
|
||||
* Version 1.1 ("License"); You may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
* http://opensource.org/licenses/rpl.php. Software distributed under the
|
||||
* License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
|
||||
* either express or implied.
|
||||
*
|
||||
* You may:
|
||||
* a) Use and distribute this code exactly as you received without payment or
|
||||
* a royalty or other fee.
|
||||
* b) Create extensions for this code, provided that you make the extensions
|
||||
* publicly available and document your modifications clearly.
|
||||
* c) Charge for a fee for warranty or support or for accepting liability
|
||||
* obligations for your customers.
|
||||
*
|
||||
* You may NOT:
|
||||
* a) Charge for the use of the original code or extensions, including in
|
||||
* electronic distribution models, such as ASP (Application Service
|
||||
* Provider).
|
||||
* b) Charge for the original source code or your extensions other than a
|
||||
* nominal fee to cover distribution costs where such distribution
|
||||
* involves PHYSICAL media.
|
||||
* c) Modify or delete any pre-existing copyright notices, change notices,
|
||||
* or License text in the Licensed Software
|
||||
* d) Assert any patent claims against the Licensor or Contributors, or
|
||||
* which would in any way restrict the ability of any third party to use the
|
||||
* Licensed Software.
|
||||
*
|
||||
* You must:
|
||||
* a) Document any modifications you make to this code including the nature of
|
||||
* the change, the authors of the change, and the date of the change.
|
||||
* b) Make the source code for any extensions you deploy available via an
|
||||
* Electronic Distribution Mechanism such as FTP or HTTP download.
|
||||
* c) Notify the licensor of the availability of source code to your extensions
|
||||
* and include instructions on how to acquire the source code and updates.
|
||||
* d) Grant Licensor a world-wide, non-exclusive, royalty-free license to use,
|
||||
* reproduce, perform, modify, sublicense, and distribute your extensions.
|
||||
*
|
||||
* The Original Code is: CommuniCore
|
||||
* Olavo Farias
|
||||
* 2006-04-7 olavo.farias@gmail.com
|
||||
*
|
||||
* The Initial Developer of the Original Code is CommuniCore.
|
||||
* Portions created by CommuniCore are Copyright (C) 2005 CommuniCore Ltda
|
||||
* All Rights Reserved.
|
||||
********************************************************************************/
|
||||
-->
|
||||
<!-- BEGIN: main -->
|
||||
<!-- BEGIN: SearchHeader -->
|
||||
{SET_RETURN_JS}
|
||||
<script type="text/javascript">
|
||||
function toggleDisplay(id){
|
||||
if(this.document.getElementById( id).style.display=='none'){
|
||||
this.document.getElementById( id).style.display='inline'
|
||||
if(this.document.getElementById(id+"link") != undefined){
|
||||
this.document.getElementById(id+"link").style.display='none';
|
||||
}
|
||||
}else{
|
||||
this.document.getElementById( id).style.display='none'
|
||||
if(this.document.getElementById(id+"link") != undefined){
|
||||
this.document.getElementById(id+"link").style.display='inline';
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="tabForm">
|
||||
<tr>
|
||||
<td>
|
||||
<div id='divsearchform' style='display:inline'>
|
||||
<form>
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td class="dataLabel" nowrap="nowrap" width="40%">{MOD.LBL_NAME} <input type="text" size="20" name="name" class="dataField" value="{NAME}" /></td>
|
||||
<td width="10%" align="right">
|
||||
<input type="hidden" name="action" value="Popup" />
|
||||
<input type="hidden" name="query" value="true"/>
|
||||
<input type="hidden" name="module" value="{MODULE_NAME}" />
|
||||
<input type="hidden" name="parent_id" value="{parent_id}" />
|
||||
<input type="hidden" name="parent_name" value="{parent_name}" />
|
||||
<input type="submit" name="button" class="button"
|
||||
title="{APP.LBL_SEARCH_BUTTON_TITLE}"
|
||||
accesskey="{APP.LBL_SEARCH_BUTTON_KEY}"
|
||||
value="{APP.LBL_SEARCH_BUTTON_LABEL}" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<!-- END: SearchHeader -->
|
||||
|
||||
<!-- BEGIN: SearchHeaderEnd -->
|
||||
<!-- END: SearchHeaderEnd -->
|
||||
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="listView">
|
||||
<!-- BEGIN: list_nav_row -->
|
||||
{PAGINATION}
|
||||
<!-- END: list_nav_row -->
|
||||
<tr height="20">
|
||||
<td scope="col" width="65%" class="listViewThS1"><a href="{ORDER_BY}name" class="listViewThLinkS1">{MOD.LBL_LIST_NAME}{arrow_start}{name_arrow}{arrow_end}</a></td>
|
||||
<td scope="col" width="35%" class="listViewThS1"><a href="{ORDER_BY}assigned_user_name" class="listViewThLinkS1">{MOD.LBL_LIST_ASSIGNED_USER_ID}{arrow_start}{assigned_user_name_arrow}{arrow_end}</a></td>
|
||||
</tr>
|
||||
|
||||
<!-- BEGIN: row -->
|
||||
<tr height="20"
|
||||
onmouseover="setPointer(this, '{ecmdocuments.ID}', 'over', '{BG_COLOR}', '{BG_HILITE}', '{BG_CLICK}');"
|
||||
onmouseout ="setPointer(this, '{ecmdocuments.ID}', 'out', '{BG_COLOR}', '{BG_HILITE}', '{BG_CLICK}');"
|
||||
onmousedown="setPointer(this, '{ecmdocuments.ID}', 'click', '{BG_COLOR}', '{BG_HILITE}', '{BG_CLICK}');">
|
||||
<td scope='row' class="{ROW_COLOR}S1" bgcolor="{BG_COLOR}"><a href="#" onclick="set_return('{.ID}', '{ecmdocuments.NAME}'); window.close();" class="listViewTdLinkS1">{ecmdocuments.NAME}</a></td>
|
||||
<td class="{ROW_COLOR}S1" bgcolor="{BG_COLOR}">{ecmdocuments.ASSIGNED_USER_NAME}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="20" class="listViewHRS1"></td>
|
||||
</tr>
|
||||
<!-- END: row -->
|
||||
</table>
|
||||
<!-- END: main -->
|
||||
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();
|
||||
|
||||
?>
|
||||
131
modules/EcmDocuments/Popup_picker.html
Executable file
131
modules/EcmDocuments/Popup_picker.html
Executable file
@@ -0,0 +1,131 @@
|
||||
<!--
|
||||
/*****************************************************************************
|
||||
* The contents of this file are subject to the RECIPROCAL PUBLIC LICENSE
|
||||
* Version 1.1 ("License"); You may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
* http://opensource.org/licenses/rpl.php. Software distributed under the
|
||||
* License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
|
||||
* either express or implied.
|
||||
*
|
||||
* You may:
|
||||
* a) Use and distribute this code exactly as you received without payment or
|
||||
* a royalty or other fee.
|
||||
* b) Create extensions for this code, provided that you make the extensions
|
||||
* publicly available and document your modifications clearly.
|
||||
* c) Charge for a fee for warranty or support or for accepting liability
|
||||
* obligations for your customers.
|
||||
*
|
||||
* You may NOT:
|
||||
* a) Charge for the use of the original code or extensions, including in
|
||||
* electronic distribution models, such as ASP (Application Service
|
||||
* Provider).
|
||||
* b) Charge for the original source code or your extensions other than a
|
||||
* nominal fee to cover distribution costs where such distribution
|
||||
* involves PHYSICAL media.
|
||||
* c) Modify or delete any pre-existing copyright notices, change notices,
|
||||
* or License text in the Licensed Software
|
||||
* d) Assert any patent claims against the Licensor or Contributors, or
|
||||
* which would in any way restrict the ability of any third party to use the
|
||||
* Licensed Software.
|
||||
*
|
||||
* You must:
|
||||
* a) Document any modifications you make to this code including the nature of
|
||||
* the change, the authors of the change, and the date of the change.
|
||||
* b) Make the source code for any extensions you deploy available via an
|
||||
* Electronic Distribution Mechanism such as FTP or HTTP download.
|
||||
* c) Notify the licensor of the availability of source code to your extensions
|
||||
* and include instructions on how to acquire the source code and updates.
|
||||
* d) Grant Licensor a world-wide, non-exclusive, royalty-free license to use,
|
||||
* reproduce, perform, modify, sublicense, and distribute your extensions.
|
||||
*
|
||||
* The Original Code is: CommuniCore
|
||||
* Olavo Farias
|
||||
* 2006-04-7 olavo.farias@gmail.com
|
||||
*
|
||||
* The Initial Developer of the Original Code is CommuniCore.
|
||||
* Portions created by CommuniCore are Copyright (C) 2005 CommuniCore Ltda
|
||||
* All Rights Reserved.
|
||||
********************************************************************************/
|
||||
-->
|
||||
|
||||
<!-- BEGIN: main -->
|
||||
<!-- BEGIN: SearchHeader -->
|
||||
|
||||
<script type="text/javascript" src="include/JSON.js?s={SUGAR_VERSION}&c={JS_CUSTOM_VERSION}"></script>
|
||||
<script type="text/javascript" src="include/javascript/popup_helper.js?s={SUGAR_VERSION}&c={JS_CUSTOM_VERSION}"></script>
|
||||
|
||||
|
||||
<table cellpadding="0" cellspacing="0" border="0" width="100%" class="tabForm">
|
||||
<tr>
|
||||
<td>
|
||||
<form action="index.php" method="post" name="popup_query_form" id="the_form">
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td class="dataLabel" nowrap="nowrap">{MOD.LBL_NAME} <input type="text" name="name" size="20" class="dataField" value="{NAME}" /></td>
|
||||
|
||||
<td width="20%" align="right">
|
||||
<input type="hidden" name="module" value="{MODULE_NAME}" />
|
||||
<input type="hidden" name="action" value="Popup" />
|
||||
<input type="hidden" name="query" value="true" />
|
||||
<input type="hidden" name="request_data" value="{request_data}" />
|
||||
<input type="hidden" name="record_id" value="" />
|
||||
<input type="submit" name="button" class="button"
|
||||
title="{APP.LBL_SEARCH_BUTTON_TITLE}"
|
||||
accessKey="{APP.LBL_SEARCH_BUTTON_KEY}"
|
||||
value="{APP.LBL_SEARCH_BUTTON_LABEL}" />
|
||||
<input type="hidden" name="mode" value="{MULTI_SELECT}" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
<!--
|
||||
/* initialize the popup request from the parent */
|
||||
|
||||
if(window.document.forms['popup_query_form'].request_data.value == "")
|
||||
{
|
||||
window.document.forms['popup_query_form'].request_data.value
|
||||
= JSON.stringify(window.opener.get_popup_request_data());
|
||||
}
|
||||
-->
|
||||
</script>
|
||||
|
||||
<!-- END: SearchHeader -->
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="listView">
|
||||
<!-- BEGIN: list_nav_row -->
|
||||
{PAGINATION}
|
||||
<!-- END: list_nav_row -->
|
||||
<tr height="20" class="listViewThS1">
|
||||
<td scope="col" width="5%" class="listViewThS1" NOWRAP>{CHECKALL}</td>
|
||||
<td scope="col" scope="col" width="35%" class="listViewThS1" NOWRAP>
|
||||
<slot>
|
||||
<a href="{ORDER_BY}name" class="listViewThLinkS1">{MOD.LBL_NAME}{arrow_start}{name_arrow}{arrow_end}</a>
|
||||
</slot>
|
||||
</td>
|
||||
</tr>
|
||||
<!-- BEGIN: row -->
|
||||
<tr height="20"
|
||||
onmouseover="setPointer(this, '{ECMDOCUMENT.ID}', 'over', '{BG_COLOR}', '{BG_HILITE}', '{BG_CLICK}');"
|
||||
onmouseout="setPointer(this, '{ECMDOCUMENT.ID}', 'out', '{BG_COLOR}', '{BG_HILITE}', '{BG_CLICK}');"
|
||||
onmousedown="setPointer(this, '{ECMDOCUMENT.ID}', 'click', '{BG_COLOR}', '{BG_HILITE}', '{BG_CLICK}');">
|
||||
<td class="{ROW_COLOR}S1" bgcolor="{BG_COLOR}" valign='top'>{PREROW}</td>
|
||||
<td scope="row" valign="top" class="{ROW_COLOR}S1" bgcolor="{BG_COLOR}">
|
||||
<slot>
|
||||
<{TAG.MAIN} href="#"
|
||||
onclick="send_back('EcmDocument','{ECMDOCUMENT.ID}');"
|
||||
class="listViewTdLinkS1">{ECMDOCUMENT.NAME}</{TAG.MAIN}>
|
||||
</slot>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="20" class="listViewHRS1"></td>
|
||||
</tr>
|
||||
<!-- END: row -->
|
||||
</table>
|
||||
{ASSOCIATED_JAVASCRIPT_DATA}
|
||||
<!-- END: main -->
|
||||
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);
|
||||
?>
|
||||
99
modules/EcmDocuments/SearchForm.html
Executable file
99
modules/EcmDocuments/SearchForm.html
Executable file
@@ -0,0 +1,99 @@
|
||||
<!--
|
||||
/*****************************************************************************
|
||||
* The contents of this file are subject to the RECIPROCAL PUBLIC LICENSE
|
||||
* Version 1.1 ("License"); You may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
* http://opensource.org/licenses/rpl.php. Software distributed under the
|
||||
* License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
|
||||
* either express or implied.
|
||||
*
|
||||
* You may:
|
||||
* a) Use and distribute this code exactly as you received without payment or
|
||||
* a royalty or other fee.
|
||||
* b) Create extensions for this code, provided that you make the extensions
|
||||
* publicly available and document your modifications clearly.
|
||||
* c) Charge for a fee for warranty or support or for accepting liability
|
||||
* obligations for your customers.
|
||||
*
|
||||
* You may NOT:
|
||||
* a) Charge for the use of the original code or extensions, including in
|
||||
* electronic distribution models, such as ASP (Application Service
|
||||
* Provider).
|
||||
* b) Charge for the original source code or your extensions other than a
|
||||
* nominal fee to cover distribution costs where such distribution
|
||||
* involves PHYSICAL media.
|
||||
* c) Modify or delete any pre-existing copyright notices, change notices,
|
||||
* or License text in the Licensed Software
|
||||
* d) Assert any patent claims against the Licensor or Contributors, or
|
||||
* which would in any way restrict the ability of any third party to use the
|
||||
* Licensed Software.
|
||||
*
|
||||
* You must:
|
||||
* a) Document any modifications you make to this code including the nature of
|
||||
* the change, the authors of the change, and the date of the change.
|
||||
* b) Make the source code for any extensions you deploy available via an
|
||||
* Electronic Distribution Mechanism such as FTP or HTTP download.
|
||||
* c) Notify the licensor of the availability of source code to your extensions
|
||||
* and include instructions on how to acquire the source code and updates.
|
||||
* d) Grant Licensor a world-wide, non-exclusive, royalty-free license to use,
|
||||
* reproduce, perform, modify, sublicense, and distribute your extensions.
|
||||
*
|
||||
* The Original Code is: CommuniCore
|
||||
* Olavo Farias
|
||||
* 2006-04-7 olavo.farias@gmail.com
|
||||
*
|
||||
* The Initial Developer of the Original Code is CommuniCore.
|
||||
* Portions created by CommuniCore are Copyright (C) 2005 CommuniCore Ltda
|
||||
* All Rights Reserved.
|
||||
********************************************************************************/
|
||||
-->
|
||||
<!-- BEGIN: main -->
|
||||
<table cellpadding="0" cellspacing="0" border="0" width="100%" style="border-top: 0px none; margin-bottom: 4px" class="tabForm">
|
||||
<tr>
|
||||
<td>
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
||||
<tr>
|
||||
<td class="dataLabel" noWrap>
|
||||
<span sugar='slot1'>{MOD.LBL_NAME}</span sugar='slot'> </td>
|
||||
<td valign="top" class="dataField">
|
||||
<span sugar='slot1b'>
|
||||
<input type=text size="20" name="name_basic" class=dataField value="{NAME}" />
|
||||
</span sugar='slot'> </td>
|
||||
<td class="dataLabel">{APP.LBL_CURRENT_USER_FILTER}
|
||||
<input name='current_user_only_basic' onchange='this.form.submit();' onchange='this.form.submit();' class="checkbox" type="checkbox" {CURRENT_USER_ONLY}> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<!-- END: main -->
|
||||
|
||||
<!-- BEGIN: advanced -->
|
||||
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="0" style="border-top: 0px none; margin-bottom: 4px" class="tabForm">
|
||||
<tr>
|
||||
<td>
|
||||
<table width="100%" border="0" cellspacing="0" cellpadding="3">
|
||||
<tr>
|
||||
<td width="20%" class="dataLabel"><span sugar='slot1'>{MOD.LBL_NAME}</span sugar='slot'></td>
|
||||
<td width="25%" class="dataField"><span sugar='slot1b'><input name='name' type="text" tabindex='1' size='25' maxlength='50' value="{NAME}"></span sugar='slot'></td>
|
||||
<td class="dataLabel"><span sugar='slot2'>{APP.LBL_ASSIGNED_TO}</span sugar='slot'></td>
|
||||
<td class="dataField"><span sugar='slot2b'><select tabindex='1' style="width: 150px" size='3' name='assigned_user_id[]' multiple="multiple">{USER_FILTER}</select></span sugar='slot'></td>
|
||||
<tr>
|
||||
<td width="15%" class="dataLabel" valign="top"><span sugar='slot`3`'>{MOD.LBL_EKMT_DESCRIPTION}</span sugar='slot'></td>
|
||||
<td width="85%" class="dataField">
|
||||
<span sugar='slot`3`b'>
|
||||
<textarea name='ekmt_description' title="Description" tabindex='`3`' cols="30" rows="8">{EKMT_DESCRIPTION}</textarea>
|
||||
</span sugar='slot'>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<!-- END: advanced -->
|
||||
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 -->
|
||||
89
modules/EcmDocuments/SubPanelView.html
Executable file
89
modules/EcmDocuments/SubPanelView.html
Executable file
@@ -0,0 +1,89 @@
|
||||
<!--
|
||||
/*****************************************************************************
|
||||
* The contents of this file are subject to the RECIPROCAL PUBLIC LICENSE
|
||||
* Version 1.1 ("License"); You may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
* http://opensource.org/licenses/rpl.php. Software distributed under the
|
||||
* License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND,
|
||||
* either express or implied.
|
||||
*
|
||||
* You may:
|
||||
* a) Use and distribute this code exactly as you received without payment or
|
||||
* a royalty or other fee.
|
||||
* b) Create extensions for this code, provided that you make the extensions
|
||||
* publicly available and document your modifications clearly.
|
||||
* c) Charge for a fee for warranty or support or for accepting liability
|
||||
* obligations for your customers.
|
||||
*
|
||||
* You may NOT:
|
||||
* a) Charge for the use of the original code or extensions, including in
|
||||
* electronic distribution models, such as ASP (Application Service
|
||||
* Provider).
|
||||
* b) Charge for the original source code or your extensions other than a
|
||||
* nominal fee to cover distribution costs where such distribution
|
||||
* involves PHYSICAL media.
|
||||
* c) Modify or delete any pre-existing copyright notices, change notices,
|
||||
* or License text in the Licensed Software
|
||||
* d) Assert any patent claims against the Licensor or Contributors, or
|
||||
* which would in any way restrict the ability of any third party to use the
|
||||
* Licensed Software.
|
||||
*
|
||||
* You must:
|
||||
* a) Document any modifications you make to this code including the nature of
|
||||
* the change, the authors of the change, and the date of the change.
|
||||
* b) Make the source code for any extensions you deploy available via an
|
||||
* Electronic Distribution Mechanism such as FTP or HTTP download.
|
||||
* c) Notify the licensor of the availability of source code to your extensions
|
||||
* and include instructions on how to acquire the source code and updates.
|
||||
* d) Grant Licensor a world-wide, non-exclusive, royalty-free license to use,
|
||||
* reproduce, perform, modify, sublicense, and distribute your extensions.
|
||||
*
|
||||
* The Original Code is: CommuniCore
|
||||
* Olavo Farias
|
||||
* 2006-04-7 olavo.farias@gmail.com
|
||||
*
|
||||
* The Initial Developer of the Original Code is CommuniCore.
|
||||
* Portions created by CommuniCore are Copyright (C) 2005 CommuniCore Ltda
|
||||
* All Rights Reserved.
|
||||
********************************************************************************/
|
||||
-->
|
||||
<!-- BEGIN: main -->
|
||||
<table cellpadding="0" cellspacing="0" width="100%" border="0" class="listView">
|
||||
<tr height="20" >
|
||||
<td scope="col" width="5%" class="listViewThS1"><slot>{MOD.LBL_LIST_NUMBER}</slot></td>
|
||||
<td scope="col" width="50%" class="listViewThS1"><slot>{MOD.LBL_LIST_SUBJECT}</slot></td>
|
||||
<td scope="col" width="15%" class="listViewThS1"><slot>{MOD.LBL_LIST_STATUS}</slot></td>
|
||||
<td scope="col" width="5%" class="listViewThS1"><slot> </slot></td>
|
||||
<td scope="col" width="50%" class="listViewThS1"><slot>{MOD.LBL_LIST_NAME}</slot></td>
|
||||
</tr>
|
||||
|
||||
<!-- BEGIN: row -->
|
||||
<tr height="20" onmouseover="setPointer(this, '{ECMDOCUMENTS.ID}', 'over', '{BG_COLOR}', '{BG_HILITE}', '{BG_CLICK}');"
|
||||
onmouseout="setPointer(this, '{ECMDOCUMENTS.ID}', 'out', '{BG_COLOR}', '{BG_HILITE}', '{BG_CLICK}');"
|
||||
onmousedown="setPointer(this, '{ECMDOCUMENTS.ID}', 'click', '{BG_COLOR}', '{BG_HILITE}', '{BG_CLICK}');">
|
||||
<td scope='row' valign=TOP bgcolor="{BG_COLOR}" class="{ROW_COLOR}S1" ><slot>{ECMDOCUMENTS.NUMBER}</slot></td>
|
||||
<td valign=TOP bgcolor="{BG_COLOR}" class="{ROW_COLOR}S1" ><slot>
|
||||
<a href="{URL_PREFIX}index.php?action=DetailView&module=EcmDocuments&record={ECMDOCUMENTS.ID}" class="listViewTdLinkS1">{ECMDOCUMENTS.NAME}</a></slot>
|
||||
</td>
|
||||
<td valign=TOP bgcolor="{BG_COLOR}" class="{ROW_COLOR}S1" ><slot>{ECMDOCUMENTS.STATUS}</slot></td>
|
||||
<td nowrap align="center" valign=TOP bgcolor="{BG_COLOR}" class="{ROW_COLOR}S1" >
|
||||
<slot>
|
||||
<a class="listViewTdToolsS1" href="{URL_PREFIX}index.php?action=EditView&module=EcmDocuments&record={ECMDOCUMENTS.ID}{RETURN_URL}">{EDIT_INLINE_PNG}</a>
|
||||
<a class="listViewTdToolsS1" href="{URL_PREFIX}index.php?action=EditView&module=EcmDocuments&record={ECMDOCUMENTS.ID}{RETURN_URL}">{APP.LNK_EDIT}</a>
|
||||
</slot>
|
||||
</td>
|
||||
<td scope='row' valign=TOP bgcolor="{BG_COLOR}" class="{ROW_COLOR}S1" ><slot>{ECMDOCUMENTS.NAME}</slot></td>
|
||||
<td valign=TOP bgcolor="{BG_COLOR}" class="{ROW_COLOR}S1" >
|
||||
<slot>
|
||||
<a href="{URL_PREFIX}index.php?action=DetailView&module=EcmDocuments&record={ECMDOCUMENTS.ID}" class="listViewTdLinkS1">{ECMDOCUMENTS.NAME}</a>
|
||||
</slot>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="20" class="listViewHRS1"></td>
|
||||
</tr>
|
||||
<!-- END: row -->
|
||||
|
||||
</table>
|
||||
<!-- 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");
|
||||
?>
|
||||
480
modules/EcmDocuments/advajax.js
Executable file
480
modules/EcmDocuments/advajax.js
Executable file
@@ -0,0 +1,480 @@
|
||||
/*
|
||||
* AdvancedAJAX 1.1.2
|
||||
* (c) 2005-2006 Lukasz Lach
|
||||
* mail: anakin@php5.pl
|
||||
* www: http://advajax.anakin.us/
|
||||
* http://anakin.us/
|
||||
* http://creativecommons.org/licenses/LGPL/2.1/
|
||||
*
|
||||
*/
|
||||
|
||||
function advAJAX() {
|
||||
|
||||
var obj = new Object();
|
||||
|
||||
obj.url = window.location.href;
|
||||
obj.method = "GET";
|
||||
obj.parameters = new Object();
|
||||
obj.jsonParameters = new Object();
|
||||
obj.headers = new Object();
|
||||
obj.async = true;
|
||||
obj.mimeType = "text/xml";
|
||||
obj.username = null;
|
||||
obj.password = null;
|
||||
obj.form = null;
|
||||
obj.disableForm = true;
|
||||
|
||||
obj.unique = true;
|
||||
obj.uniqueParameter = "_uniqid";
|
||||
|
||||
obj.requestDone = false;
|
||||
obj.queryString = "";
|
||||
obj.responseText = null;
|
||||
obj.responseXML = null;
|
||||
obj.status = null;
|
||||
obj.statusText = null;
|
||||
obj.aborted = false;
|
||||
obj.timeout = 0;
|
||||
obj.retryCount = 0;
|
||||
obj.retryDelay = 1000;
|
||||
obj.tag = null;
|
||||
obj.group = null;
|
||||
obj.progressTimerInterval = 50;
|
||||
|
||||
obj.xmlHttpRequest = null;
|
||||
|
||||
obj.onInitialization = null;
|
||||
obj.onFinalization = null;
|
||||
obj.onReadyStateChange = null;
|
||||
obj.onLoading = null;
|
||||
obj.onLoaded = null;
|
||||
obj.onInteractive = null;
|
||||
obj.onComplete = null;
|
||||
obj.onProgress = null;
|
||||
obj.onSuccess = null;
|
||||
obj.onFatalError = null;
|
||||
obj.onError = null;
|
||||
obj.onTimeout = null;
|
||||
obj.onRetryDelay = null;
|
||||
obj.onRetry = null;
|
||||
obj.onGroupEnter = null;
|
||||
obj.onGroupLeave = null;
|
||||
|
||||
obj.createXmlHttpRequest = function() {
|
||||
|
||||
if (typeof XMLHttpRequest != "undefined")
|
||||
return new XMLHttpRequest();
|
||||
var xhrVersion = [ "MSXML2.XMLHttp.5.0", "MSXML2.XMLHttp.4.0","MSXML2.XMLHttp.3.0",
|
||||
"MSXML2.XMLHttp","Microsoft.XMLHttp" ];
|
||||
for (var i = 0; i < xhrVersion.length; i++) {
|
||||
try {
|
||||
var xhrObj = new ActiveXObject(xhrVersion[i]);
|
||||
return xhrObj;
|
||||
} catch (e) { }
|
||||
}
|
||||
obj.raiseEvent("FatalError");
|
||||
return null;
|
||||
};
|
||||
|
||||
obj._oldResponseLength = null;
|
||||
obj._progressTimer = null;
|
||||
obj._progressStarted = navigator.userAgent.indexOf('Opera') == -1;
|
||||
obj._onProgress = function() {
|
||||
|
||||
if (typeof obj.onProgress == "function" &&
|
||||
typeof obj.xmlHttpRequest.getResponseHeader == "function") {
|
||||
var contentLength = obj.xmlHttpRequest.getResponseHeader("Content-length");
|
||||
if (contentLength != null && contentLength != '') {
|
||||
var responseLength = obj.xmlHttpRequest.responseText.length;
|
||||
if (responseLength != obj._oldResponseLength) {
|
||||
obj.raiseEvent("Progress", obj, responseLength, contentLength);
|
||||
obj._oldResponseLength = obj.xmlHttpRequest.responseText.length;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (obj._progressStarted) return;
|
||||
obj._progressStarted = true;
|
||||
var _obj = this;
|
||||
this.__onProgress = function() {
|
||||
obj._onProgress();
|
||||
obj._progressTimer = window.setTimeout(_obj.__onProgress, obj.progressTimerInterval);
|
||||
}
|
||||
_obj.__onProgress();
|
||||
}
|
||||
|
||||
obj._onInitializationHandled = false;
|
||||
obj._initObject = function() {
|
||||
|
||||
if (obj.xmlHttpRequest != null) {
|
||||
delete obj.xmlHttpRequest["onreadystatechange"];
|
||||
obj.xmlHttpRequest = null;
|
||||
}
|
||||
if ((obj.xmlHttpRequest = obj.createXmlHttpRequest()) == null)
|
||||
return null;
|
||||
if (typeof obj.xmlHttpRequest.overrideMimeType != "undefined")
|
||||
obj.xmlHttpRequest.overrideMimeType(obj.mimeType);
|
||||
obj.xmlHttpRequest.onreadystatechange = function() {
|
||||
|
||||
if (obj == null || obj.xmlHttpRequest == null)
|
||||
return;
|
||||
obj.raiseEvent("ReadyStateChange", obj, obj.xmlHttpRequest.readyState);
|
||||
obj._onProgress();
|
||||
switch (obj.xmlHttpRequest.readyState) {
|
||||
case 1: obj._onLoading(); break;
|
||||
case 2: obj._onLoaded(); break;
|
||||
case 3: obj._onInteractive(); break;
|
||||
case 4: obj._onComplete(); break;
|
||||
}
|
||||
};
|
||||
obj._onLoadingHandled =
|
||||
obj._onLoadedHandled =
|
||||
obj._onInteractiveHandled =
|
||||
obj._onCompleteHandled = false;
|
||||
};
|
||||
|
||||
obj._onLoading = function() {
|
||||
|
||||
if (obj._onLoadingHandled)
|
||||
return;
|
||||
if (!obj._retry && obj.group != null) {
|
||||
if (typeof advAJAX._groupData[obj.group] == "undefined")
|
||||
advAJAX._groupData[obj.group] = 0;
|
||||
advAJAX._groupData[obj.group]++;
|
||||
if (typeof obj.onGroupEnter == "function" && advAJAX._groupData[obj.group] == 1)
|
||||
obj.onGroupEnter(obj);
|
||||
}
|
||||
obj.raiseEvent("Loading", obj);
|
||||
obj._onLoadingHandled = true;
|
||||
};
|
||||
obj._onLoaded = function() {
|
||||
|
||||
if (obj._onLoadedHandled)
|
||||
return;
|
||||
obj.raiseEvent("Loaded", obj);
|
||||
obj._onLoadedHandled = true;
|
||||
};
|
||||
obj._onInteractive = function() {
|
||||
|
||||
if (obj._onInteractiveHandled)
|
||||
return;
|
||||
obj.raiseEvent("Interactive", obj);
|
||||
obj._onInteractiveHandled = true;
|
||||
if (!obj._progressStarted)
|
||||
obj._onProgress();
|
||||
};
|
||||
obj._onComplete = function() {
|
||||
|
||||
if (obj._onCompleteHandled || obj.aborted)
|
||||
return;
|
||||
if (obj._progressStarted) {
|
||||
window.clearInterval(obj._progressTimer);
|
||||
obj._progressStarted = false;
|
||||
}
|
||||
obj.requestDone = true;
|
||||
with (obj.xmlHttpRequest) {
|
||||
obj.responseText = responseText;
|
||||
obj.responseXML = responseXML;
|
||||
if (typeof status != "undefined")
|
||||
obj.status = status;
|
||||
if (typeof statusText != "undefined")
|
||||
obj.statusText = statusText;
|
||||
}
|
||||
obj.raiseEvent("Complete", obj);
|
||||
obj._onCompleteHandled = true;
|
||||
if (obj.status == 200)
|
||||
obj.raiseEvent("Success", obj); else
|
||||
obj.raiseEvent("Error", obj);
|
||||
delete obj.xmlHttpRequest['onreadystatechange'];
|
||||
obj.xmlHttpRequest = null;
|
||||
if (obj.disableForm)
|
||||
obj.switchForm(true);
|
||||
obj._groupLeave();
|
||||
obj.raiseEvent("Finalization", obj);
|
||||
};
|
||||
|
||||
obj._groupLeave = function() {
|
||||
|
||||
if (obj.group != null) {
|
||||
advAJAX._groupData[obj.group]--;
|
||||
if (advAJAX._groupData[obj.group] == 0)
|
||||
obj.raiseEvent("GroupLeave", obj);
|
||||
}
|
||||
};
|
||||
|
||||
obj._retry = false;
|
||||
obj._retryNo = 0;
|
||||
obj._onTimeout = function() {
|
||||
|
||||
if (obj == null || obj.xmlHttpRequest == null || obj._onCompleteHandled)
|
||||
return;
|
||||
obj.aborted = true;
|
||||
obj.xmlHttpRequest.abort();
|
||||
obj.raiseEvent("Timeout", obj);
|
||||
obj._retry = true;
|
||||
if (obj._retryNo != obj.retryCount) {
|
||||
obj._initObject();
|
||||
if (obj.retryDelay > 0) {
|
||||
obj.raiseEvent("RetryDelay", obj);
|
||||
startTime = new Date().getTime();
|
||||
while (new Date().getTime() - startTime < obj.retryDelay);
|
||||
}
|
||||
obj._retryNo++;
|
||||
obj.raiseEvent("Retry", obj, obj._retryNo);
|
||||
obj.run();
|
||||
} else {
|
||||
delete obj.xmlHttpRequest["onreadystatechange"];
|
||||
obj.xmlHttpRequest = null;
|
||||
if (obj.disableForm)
|
||||
obj.switchForm(true);
|
||||
obj._groupLeave();
|
||||
obj.raiseEvent("Finalization", obj);
|
||||
}
|
||||
};
|
||||
|
||||
obj.run = function() {
|
||||
|
||||
obj._initObject();
|
||||
if (obj.xmlHttpRequest == null)
|
||||
return false;
|
||||
obj.aborted = false;
|
||||
if (!obj._onInitializationHandled) {
|
||||
obj.raiseEvent("Initialization", obj);
|
||||
obj._onInitializationHandled = true;
|
||||
}
|
||||
if (obj.method == "GET" && obj.unique)
|
||||
obj.parameters[encodeURIComponent(obj.uniqueParameter)] =
|
||||
new Date().getTime().toString().substr(5) + Math.floor(Math.random() * 100).toString();
|
||||
if (!obj._retry) {
|
||||
for (var a in obj.parameters) {
|
||||
if (obj.queryString.length > 0)
|
||||
obj.queryString += "&";
|
||||
if (typeof obj.parameters[a] != "object")
|
||||
obj.queryString += encodeURIComponent(a) + "=" + encodeURIComponent(obj.parameters[a]); else {
|
||||
for (var i = 0; i < obj.parameters[a].length; i++)
|
||||
obj.queryString += encodeURIComponent(a) + "=" + encodeURIComponent(obj.parameters[a][i]) + "&";
|
||||
obj.queryString = obj.queryString.slice(0, -1);
|
||||
}
|
||||
}
|
||||
for (var a in obj.jsonParameters) {
|
||||
var useJson = typeof [].toJSONString == 'function';
|
||||
if (obj.queryString.length > 0)
|
||||
obj.queryString += "&";
|
||||
obj.queryString += encodeURIComponent(a) + "=";
|
||||
if (useJson)
|
||||
obj.queryString += encodeURIComponent(obj.jsonParameters[a].toJSONString()); else
|
||||
obj.queryString += encodeURIComponent(obj.jsonParameters[a]);
|
||||
}
|
||||
if (obj.method == "GET" && obj.queryString.length > 0)
|
||||
obj.url += (obj.url.indexOf("?") != -1 ? "&" : "?") + obj.queryString;
|
||||
}
|
||||
if (obj.disableForm)
|
||||
obj.switchForm(false);
|
||||
try {
|
||||
obj.xmlHttpRequest.open(obj.method, obj.url, obj.async, obj.username || '', obj.password || '');
|
||||
} catch (e) {
|
||||
obj.raiseEvent("FatalError", obj, e);
|
||||
return;
|
||||
}
|
||||
if (obj.timeout > 0)
|
||||
setTimeout(obj._onTimeout, obj.timeout);
|
||||
if (typeof obj.xmlHttpRequest.setRequestHeader != "undefined")
|
||||
for (var a in obj.headers)
|
||||
obj.xmlHttpRequest.setRequestHeader(encodeURIComponent(a), encodeURIComponent(obj.headers[a]));
|
||||
if (obj.method == "POST" && typeof obj.xmlHttpRequest.setRequestHeader != "undefined") {
|
||||
obj.xmlHttpRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
|
||||
obj.xmlHttpRequest.send(obj.queryString);
|
||||
} else if (obj.method == "GET")
|
||||
obj.xmlHttpRequest.send('');
|
||||
};
|
||||
|
||||
obj.handleArguments = function(args) {
|
||||
|
||||
if (typeof args.form == "object" && args.form != null) {
|
||||
obj.form = args.form;
|
||||
obj.appendForm();
|
||||
}
|
||||
for (a in args) {
|
||||
if (typeof obj[a] == "undefined")
|
||||
obj.parameters[a] = args[a]; else {
|
||||
if (a != "parameters" && a != "headers")
|
||||
obj[a] = args[a]; else
|
||||
for (b in args[a])
|
||||
obj[a][b] = args[a][b];
|
||||
}
|
||||
}
|
||||
obj.method = obj.method.toUpperCase();
|
||||
};
|
||||
|
||||
obj.switchForm = function(enable) {
|
||||
|
||||
if (typeof obj.form != "object" || obj.form == null)
|
||||
return;
|
||||
with (obj.form)
|
||||
for (var nr = 0; nr < elements.length; nr++)
|
||||
if (!enable) {
|
||||
if (elements[nr]["disabled"])
|
||||
elements[nr]["_disabled"] = true; else
|
||||
elements[nr]["disabled"] = "disabled";
|
||||
} else
|
||||
if (typeof elements[nr]["_disabled"] == "undefined")
|
||||
elements[nr].removeAttribute("disabled");
|
||||
};
|
||||
|
||||
obj.appendForm = function() {
|
||||
|
||||
with (obj.form) {
|
||||
obj.method = getAttribute("method").toUpperCase();
|
||||
obj.url = getAttribute("action");
|
||||
for (var nr = 0; nr < elements.length; nr++) {
|
||||
var e = elements[nr];
|
||||
if (e.disabled)
|
||||
continue;
|
||||
switch (e.type) {
|
||||
case "text":
|
||||
case "password":
|
||||
case "hidden":
|
||||
case "textarea":
|
||||
obj.addParameter(e.name, e.value);
|
||||
break;
|
||||
case "select-one":
|
||||
if (e.selectedIndex >= 0)
|
||||
obj.addParameter(e.name, e.options[e.selectedIndex].value);
|
||||
break;
|
||||
case "select-multiple":
|
||||
for (var nr2 = 0; nr2 < e.options.length; nr2++)
|
||||
if (e.options[nr2].selected)
|
||||
obj.addParameter(e.name, e.options[nr2].value);
|
||||
break;
|
||||
case "checkbox":
|
||||
case "radio":
|
||||
if (e.checked)
|
||||
obj.addParameter(e.name, e.value);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
obj.addParameter = function(name, value) {
|
||||
if (typeof obj.parameters[name] == "undefined")
|
||||
obj.parameters[name] = value; else
|
||||
if (typeof obj.parameters[name] != "object")
|
||||
obj.parameters[name] = [ obj.parameters[name], value ]; else
|
||||
obj.parameters[name][obj.parameters[name].length] = value;
|
||||
};
|
||||
obj.delParameter = function(name) {
|
||||
|
||||
delete obj.parameters[name];
|
||||
};
|
||||
obj.raiseEvent = function(name) {
|
||||
var args = [];
|
||||
for (var i = 1; i < arguments.length; i++)
|
||||
args.push(arguments[i]);
|
||||
if (typeof obj["on" + name] == "function")
|
||||
obj["on" + name].apply(null, args);
|
||||
if (name == "FatalError")
|
||||
obj.raiseEvent("Finalization", obj);
|
||||
}
|
||||
|
||||
if (typeof advAJAX._defaultParameters != "undefined")
|
||||
obj.handleArguments(advAJAX._defaultParameters);
|
||||
return obj;
|
||||
}
|
||||
|
||||
advAJAX.get = function(args) {
|
||||
|
||||
return advAJAX.handleRequest("GET", args);
|
||||
};
|
||||
|
||||
advAJAX.post = function(args) {
|
||||
|
||||
return advAJAX.handleRequest("POST", args);
|
||||
};
|
||||
|
||||
advAJAX.head = function(args) {
|
||||
|
||||
return advAJAX.handleRequest("HEAD", args);
|
||||
};
|
||||
|
||||
advAJAX.submit = function(form, args) {
|
||||
|
||||
if (typeof args == "undefined" || args == null)
|
||||
return -1;
|
||||
if (typeof form != "object" || form == null)
|
||||
return -2;
|
||||
var request = new advAJAX();
|
||||
args["form"] = form;
|
||||
request.handleArguments(args);
|
||||
return request.run();
|
||||
};
|
||||
|
||||
advAJAX.assign = function(form, args) {
|
||||
|
||||
if (typeof args == "undefined" || args == null)
|
||||
return -1;
|
||||
if (typeof form != "object" || form == null)
|
||||
return -2;
|
||||
if (typeof form["onsubmit"] == "function")
|
||||
form["_onsubmit"] = form["onsubmit"];
|
||||
form["advajax_args"] = args;
|
||||
form["onsubmit"] = function() {
|
||||
if (typeof this["_onsubmit"] != "undefined" && this["_onsubmit"]() === false)
|
||||
return false;
|
||||
if (advAJAX.submit(this, this["advajax_args"]) == false)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
};
|
||||
|
||||
advAJAX.download = function(targetObj, url) {
|
||||
|
||||
if (typeof targetObj == "string")
|
||||
targetObj = document.getElementById(targetObj);
|
||||
if (!targetObj)
|
||||
return -1;
|
||||
advAJAX.get({
|
||||
url: url,
|
||||
onSuccess : function(obj) {
|
||||
targetObj.innerHTML = obj.responseText;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
advAJAX.scan = function() {
|
||||
|
||||
var obj = document.getElementsByTagName("a");
|
||||
for (var i = 0; i < obj.length;) {
|
||||
if (obj[i].getAttribute("rel") == "advancedajax" && obj[i].getAttribute("href") !== null) {
|
||||
var url = obj[i].getAttribute("href");
|
||||
var div = document.createElement("div");
|
||||
div.innerHTML = obj[i].innerHTML;
|
||||
div.className = obj[i].className;
|
||||
var parent = obj[i].parentNode;
|
||||
parent.insertBefore(div, obj[i]);
|
||||
parent.removeChild(obj[i]);
|
||||
advAJAX.download(div, url);
|
||||
} else i++;
|
||||
}
|
||||
};
|
||||
|
||||
advAJAX.handleRequest = function(requestType, args) {
|
||||
|
||||
if (typeof args == "undefined" || args == null)
|
||||
return -1;
|
||||
var request = new advAJAX();
|
||||
window.advajax_obj = request;
|
||||
request.method = requestType;
|
||||
request.handleArguments(args);
|
||||
return request.run();
|
||||
};
|
||||
|
||||
advAJAX._defaultParameters = new Object();
|
||||
advAJAX.setDefaultParameters = function(args) {
|
||||
|
||||
advAJAX._defaultParameters = new Object();
|
||||
for (a in args)
|
||||
advAJAX._defaultParameters[a] = args[a];
|
||||
};
|
||||
|
||||
advAJAX._groupData = new Object();
|
||||
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);
|
||||
?>
|
||||
655
modules/EcmDocuments/dimensions.js
Executable file
655
modules/EcmDocuments/dimensions.js
Executable file
@@ -0,0 +1,655 @@
|
||||
/* Copyright (c) 2007 Paul Bakaus (paul.bakaus@googlemail.com) and Brandon Aaron (brandon.aaron@gmail.com || http://brandonaaron.net)
|
||||
* Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
|
||||
* and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
|
||||
*
|
||||
* $LastChangedDate$
|
||||
* $Rev$
|
||||
*
|
||||
* Version: 1.1.2
|
||||
*
|
||||
* Requires: jQuery 1.1.3+
|
||||
*/
|
||||
|
||||
(function($){
|
||||
|
||||
// store a copy of the core height and width methods
|
||||
var height = $.fn.height,
|
||||
width = $.fn.width;
|
||||
|
||||
$.fn.extend({
|
||||
/**
|
||||
* If used on document, returns the document's height (innerHeight).
|
||||
* If used on window, returns the viewport's (window) height.
|
||||
* See core docs on height() to see what happens when used on an element.
|
||||
*
|
||||
* @example $("#testdiv").height()
|
||||
* @result 200
|
||||
*
|
||||
* @example $(document).height()
|
||||
* @result 800
|
||||
*
|
||||
* @example $(window).height()
|
||||
* @result 400
|
||||
*
|
||||
* @name height
|
||||
* @type Number
|
||||
* @cat Plugins/Dimensions
|
||||
*/
|
||||
height: function() {
|
||||
if ( !this[0] ) error();
|
||||
if ( this[0] == window )
|
||||
if ( $.browser.opera || ($.browser.safari && parseInt($.browser.version) > 520) )
|
||||
return self.innerHeight - (($(document).height() > self.innerHeight) ? getScrollbarWidth() : 0);
|
||||
else if ( $.browser.safari )
|
||||
return self.innerHeight;
|
||||
else
|
||||
return $.boxModel && document.documentElement.clientHeight || document.body.clientHeight;
|
||||
|
||||
if ( this[0] == document )
|
||||
return Math.max( ($.boxModel && document.documentElement.scrollHeight || document.body.scrollHeight), document.body.offsetHeight );
|
||||
|
||||
return height.apply(this, arguments);
|
||||
},
|
||||
|
||||
/**
|
||||
* If used on document, returns the document's width (innerWidth).
|
||||
* If used on window, returns the viewport's (window) width.
|
||||
* See core docs on width() to see what happens when used on an element.
|
||||
*
|
||||
* @example $("#testdiv").width()
|
||||
* @result 200
|
||||
*
|
||||
* @example $(document).width()
|
||||
* @result 800
|
||||
*
|
||||
* @example $(window).width()
|
||||
* @result 400
|
||||
*
|
||||
* @name width
|
||||
* @type Number
|
||||
* @cat Plugins/Dimensions
|
||||
*/
|
||||
width: function() {
|
||||
if (!this[0]) error();
|
||||
if ( this[0] == window )
|
||||
if ( $.browser.opera || ($.browser.safari && parseInt($.browser.version) > 520) )
|
||||
return self.innerWidth - (($(document).width() > self.innerWidth) ? getScrollbarWidth() : 0);
|
||||
else if ( $.browser.safari )
|
||||
return self.innerWidth;
|
||||
else
|
||||
return $.boxModel && document.documentElement.clientWidth || document.body.clientWidth;
|
||||
|
||||
if ( this[0] == document )
|
||||
if ($.browser.mozilla) {
|
||||
// mozilla reports scrollWidth and offsetWidth as the same
|
||||
var scrollLeft = self.pageXOffset;
|
||||
self.scrollTo(99999999, self.pageYOffset);
|
||||
var scrollWidth = self.pageXOffset;
|
||||
self.scrollTo(scrollLeft, self.pageYOffset);
|
||||
return document.body.offsetWidth + scrollWidth;
|
||||
}
|
||||
else
|
||||
return Math.max( (($.boxModel && !$.browser.safari) && document.documentElement.scrollWidth || document.body.scrollWidth), document.body.offsetWidth );
|
||||
|
||||
return width.apply(this, arguments);
|
||||
},
|
||||
|
||||
/**
|
||||
* Gets the inner height (excludes the border and includes the padding) for the first matched element.
|
||||
* If used on document, returns the document's height (innerHeight).
|
||||
* If used on window, returns the viewport's (window) height.
|
||||
*
|
||||
* @example $("#testdiv").innerHeight()
|
||||
* @result 210
|
||||
*
|
||||
* @name innerHeight
|
||||
* @type Number
|
||||
* @cat Plugins/Dimensions
|
||||
*/
|
||||
innerHeight: function() {
|
||||
if (!this[0]) error();
|
||||
return this[0] == window || this[0] == document ?
|
||||
this.height() :
|
||||
this.is(':visible') ?
|
||||
this[0].offsetHeight - num(this, 'borderTopWidth') - num(this, 'borderBottomWidth') :
|
||||
this.height() + num(this, 'paddingTop') + num(this, 'paddingBottom');
|
||||
},
|
||||
|
||||
/**
|
||||
* Gets the inner width (excludes the border and includes the padding) for the first matched element.
|
||||
* If used on document, returns the document's width (innerWidth).
|
||||
* If used on window, returns the viewport's (window) width.
|
||||
*
|
||||
* @example $("#testdiv").innerWidth()
|
||||
* @result 210
|
||||
*
|
||||
* @name innerWidth
|
||||
* @type Number
|
||||
* @cat Plugins/Dimensions
|
||||
*/
|
||||
innerWidth: function() {
|
||||
if (!this[0]) error();
|
||||
return this[0] == window || this[0] == document ?
|
||||
this.width() :
|
||||
this.is(':visible') ?
|
||||
this[0].offsetWidth - num(this, 'borderLeftWidth') - num(this, 'borderRightWidth') :
|
||||
this.width() + num(this, 'paddingLeft') + num(this, 'paddingRight');
|
||||
},
|
||||
|
||||
/**
|
||||
* Gets the outer height (includes the border and padding) for the first matched element.
|
||||
* If used on document, returns the document's height (innerHeight).
|
||||
* If used on window, returns the viewport's (window) height.
|
||||
*
|
||||
* The margin can be included in the calculation by passing an options map with margin
|
||||
* set to true.
|
||||
*
|
||||
* @example $("#testdiv").outerHeight()
|
||||
* @result 220
|
||||
*
|
||||
* @example $("#testdiv").outerHeight({ margin: true })
|
||||
* @result 240
|
||||
*
|
||||
* @name outerHeight
|
||||
* @type Number
|
||||
* @param Map options Optional settings to configure the way the outer height is calculated.
|
||||
* @cat Plugins/Dimensions
|
||||
*/
|
||||
outerHeight: function(options) {
|
||||
if (!this[0]) error();
|
||||
options = $.extend({ margin: false }, options || {});
|
||||
return this[0] == window || this[0] == document ?
|
||||
this.height() :
|
||||
this.is(':visible') ?
|
||||
this[0].offsetHeight + (options.margin ? (num(this, 'marginTop') + num(this, 'marginBottom')) : 0) :
|
||||
this.height()
|
||||
+ num(this,'borderTopWidth') + num(this, 'borderBottomWidth')
|
||||
+ num(this, 'paddingTop') + num(this, 'paddingBottom')
|
||||
+ (options.margin ? (num(this, 'marginTop') + num(this, 'marginBottom')) : 0);
|
||||
},
|
||||
|
||||
/**
|
||||
* Gets the outer width (including the border and padding) for the first matched element.
|
||||
* If used on document, returns the document's width (innerWidth).
|
||||
* If used on window, returns the viewport's (window) width.
|
||||
*
|
||||
* The margin can be included in the calculation by passing an options map with margin
|
||||
* set to true.
|
||||
*
|
||||
* @example $("#testdiv").outerWidth()
|
||||
* @result 1000
|
||||
*
|
||||
* @example $("#testdiv").outerWidth({ margin: true })
|
||||
* @result 1020
|
||||
*
|
||||
* @name outerHeight
|
||||
* @type Number
|
||||
* @param Map options Optional settings to configure the way the outer width is calculated.
|
||||
* @cat Plugins/Dimensions
|
||||
*/
|
||||
outerWidth: function(options) {
|
||||
if (!this[0]) error();
|
||||
options = $.extend({ margin: false }, options || {});
|
||||
return this[0] == window || this[0] == document ?
|
||||
this.width() :
|
||||
this.is(':visible') ?
|
||||
this[0].offsetWidth + (options.margin ? (num(this, 'marginLeft') + num(this, 'marginRight')) : 0) :
|
||||
this.width()
|
||||
+ num(this, 'borderLeftWidth') + num(this, 'borderRightWidth')
|
||||
+ num(this, 'paddingLeft') + num(this, 'paddingRight')
|
||||
+ (options.margin ? (num(this, 'marginLeft') + num(this, 'marginRight')) : 0);
|
||||
},
|
||||
|
||||
/**
|
||||
* Gets how many pixels the user has scrolled to the right (scrollLeft).
|
||||
* Works on containers with overflow: auto and window/document.
|
||||
*
|
||||
* @example $(window).scrollLeft()
|
||||
* @result 100
|
||||
*
|
||||
* @example $(document).scrollLeft()
|
||||
* @result 100
|
||||
*
|
||||
* @example $("#testdiv").scrollLeft()
|
||||
* @result 100
|
||||
*
|
||||
* @name scrollLeft
|
||||
* @type Number
|
||||
* @cat Plugins/Dimensions
|
||||
*/
|
||||
/**
|
||||
* Sets the scrollLeft property for each element and continues the chain.
|
||||
* Works on containers with overflow: auto and window/document.
|
||||
*
|
||||
* @example $(window).scrollLeft(100).scrollLeft()
|
||||
* @result 100
|
||||
*
|
||||
* @example $(document).scrollLeft(100).scrollLeft()
|
||||
* @result 100
|
||||
*
|
||||
* @example $("#testdiv").scrollLeft(100).scrollLeft()
|
||||
* @result 100
|
||||
*
|
||||
* @name scrollLeft
|
||||
* @param Number value A positive number representing the desired scrollLeft.
|
||||
* @type jQuery
|
||||
* @cat Plugins/Dimensions
|
||||
*/
|
||||
scrollLeft: function(val) {
|
||||
if (!this[0]) error();
|
||||
if ( val != undefined )
|
||||
// set the scroll left
|
||||
return this.each(function() {
|
||||
if (this == window || this == document)
|
||||
window.scrollTo( val, $(window).scrollTop() );
|
||||
else
|
||||
this.scrollLeft = val;
|
||||
});
|
||||
|
||||
// return the scroll left offest in pixels
|
||||
if ( this[0] == window || this[0] == document )
|
||||
return self.pageXOffset ||
|
||||
$.boxModel && document.documentElement.scrollLeft ||
|
||||
document.body.scrollLeft;
|
||||
|
||||
return this[0].scrollLeft;
|
||||
},
|
||||
|
||||
/**
|
||||
* Gets how many pixels the user has scrolled to the bottom (scrollTop).
|
||||
* Works on containers with overflow: auto and window/document.
|
||||
*
|
||||
* @example $(window).scrollTop()
|
||||
* @result 100
|
||||
*
|
||||
* @example $(document).scrollTop()
|
||||
* @result 100
|
||||
*
|
||||
* @example $("#testdiv").scrollTop()
|
||||
* @result 100
|
||||
*
|
||||
* @name scrollTop
|
||||
* @type Number
|
||||
* @cat Plugins/Dimensions
|
||||
*/
|
||||
/**
|
||||
* Sets the scrollTop property for each element and continues the chain.
|
||||
* Works on containers with overflow: auto and window/document.
|
||||
*
|
||||
* @example $(window).scrollTop(100).scrollTop()
|
||||
* @result 100
|
||||
*
|
||||
* @example $(document).scrollTop(100).scrollTop()
|
||||
* @result 100
|
||||
*
|
||||
* @example $("#testdiv").scrollTop(100).scrollTop()
|
||||
* @result 100
|
||||
*
|
||||
* @name scrollTop
|
||||
* @param Number value A positive number representing the desired scrollTop.
|
||||
* @type jQuery
|
||||
* @cat Plugins/Dimensions
|
||||
*/
|
||||
scrollTop: function(val) {
|
||||
if (!this[0]) error();
|
||||
if ( val != undefined )
|
||||
// set the scroll top
|
||||
return this.each(function() {
|
||||
if (this == window || this == document)
|
||||
window.scrollTo( $(window).scrollLeft(), val );
|
||||
else
|
||||
this.scrollTop = val;
|
||||
});
|
||||
|
||||
// return the scroll top offset in pixels
|
||||
if ( this[0] == window || this[0] == document )
|
||||
return self.pageYOffset ||
|
||||
$.boxModel && document.documentElement.scrollTop ||
|
||||
document.body.scrollTop;
|
||||
|
||||
return this[0].scrollTop;
|
||||
},
|
||||
|
||||
/**
|
||||
* Gets the top and left positioned offset in pixels.
|
||||
* The positioned offset is the offset between a positioned
|
||||
* parent and the element itself.
|
||||
*
|
||||
* For accurate calculations make sure to use pixel values for margins, borders and padding.
|
||||
*
|
||||
* @example $("#testdiv").position()
|
||||
* @result { top: 100, left: 100 }
|
||||
*
|
||||
* @example var position = {};
|
||||
* $("#testdiv").position(position)
|
||||
* @result position = { top: 100, left: 100 }
|
||||
*
|
||||
* @name position
|
||||
* @param Object returnObject Optional An object to store the return value in, so as not to break the chain. If passed in the
|
||||
* chain will not be broken and the result will be assigned to this object.
|
||||
* @type Object
|
||||
* @cat Plugins/Dimensions
|
||||
*/
|
||||
position: function(returnObject) {
|
||||
return this.offset({ margin: false, scroll: false, relativeTo: this.offsetParent() }, returnObject);
|
||||
},
|
||||
|
||||
/**
|
||||
* Gets the location of the element in pixels from the top left corner of the viewport.
|
||||
* The offset method takes an optional map of key value pairs to configure the way
|
||||
* the offset is calculated. Here are the different options.
|
||||
*
|
||||
* (Boolean) margin - Should the margin of the element be included in the calculations? True by default.
|
||||
* (Boolean) border - Should the border of the element be included in the calculations? False by default.
|
||||
* (Boolean) padding - Should the padding of the element be included in the calculations? False by default.
|
||||
* (Boolean) scroll - Should the scroll offsets of the parent elements be included in the calculations? True by default.
|
||||
* When true it adds the total scroll offsets of all parents to the total offset and also adds two
|
||||
* properties to the returned object, scrollTop and scrollLeft.
|
||||
* (Boolean) lite - When true it will use the offsetLite method instead of the full-blown, slower offset method. False by default.
|
||||
* Only use this when margins, borders and padding calculations don't matter.
|
||||
* (HTML Element) relativeTo - This should be a parent of the element and should have position (like absolute or relative).
|
||||
* It will retreive the offset relative to this parent element. By default it is the body element.
|
||||
*
|
||||
* Also an object can be passed as the second paramater to
|
||||
* catch the value of the return and continue the chain.
|
||||
*
|
||||
* For accurate calculations make sure to use pixel values for margins, borders and padding.
|
||||
*
|
||||
* Known issues:
|
||||
* - Issue: A div positioned relative or static without any content before it and its parent will report an offsetTop of 0 in Safari
|
||||
* Workaround: Place content before the relative div ... and set height and width to 0 and overflow to hidden
|
||||
*
|
||||
* @example $("#testdiv").offset()
|
||||
* @result { top: 100, left: 100, scrollTop: 10, scrollLeft: 10 }
|
||||
*
|
||||
* @example $("#testdiv").offset({ scroll: false })
|
||||
* @result { top: 90, left: 90 }
|
||||
*
|
||||
* @example var offset = {}
|
||||
* $("#testdiv").offset({ scroll: false }, offset)
|
||||
* @result offset = { top: 90, left: 90 }
|
||||
*
|
||||
* @name offset
|
||||
* @param Map options Optional settings to configure the way the offset is calculated.
|
||||
* @param Object returnObject An object to store the return value in, so as not to break the chain. If passed in the
|
||||
* chain will not be broken and the result will be assigned to this object.
|
||||
* @type Object
|
||||
* @cat Plugins/Dimensions
|
||||
*/
|
||||
offset: function(options, returnObject) {
|
||||
if (!this[0]) error();
|
||||
var x = 0, y = 0, sl = 0, st = 0,
|
||||
elem = this[0], parent = this[0], op, parPos, elemPos = $.css(elem, 'position'),
|
||||
mo = $.browser.mozilla, ie = $.browser.msie, oa = $.browser.opera,
|
||||
sf = $.browser.safari, sf3 = $.browser.safari && parseInt($.browser.version) > 520,
|
||||
absparent = false, relparent = false,
|
||||
options = $.extend({ margin: true, border: false, padding: false, scroll: true, lite: false, relativeTo: document.body }, options || {});
|
||||
|
||||
// Use offsetLite if lite option is true
|
||||
if (options.lite) return this.offsetLite(options, returnObject);
|
||||
// Get the HTMLElement if relativeTo is a jquery collection
|
||||
if (options.relativeTo.jquery) options.relativeTo = options.relativeTo[0];
|
||||
|
||||
if (elem.tagName == 'BODY') {
|
||||
// Safari 2 is the only one to get offsetLeft and offsetTop properties of the body "correct"
|
||||
// Except they all mess up when the body is positioned absolute or relative
|
||||
x = elem.offsetLeft;
|
||||
y = elem.offsetTop;
|
||||
// Mozilla ignores margin and subtracts border from body element
|
||||
if (mo) {
|
||||
x += num(elem, 'marginLeft') + (num(elem, 'borderLeftWidth')*2);
|
||||
y += num(elem, 'marginTop') + (num(elem, 'borderTopWidth') *2);
|
||||
} else
|
||||
// Opera ignores margin
|
||||
if (oa) {
|
||||
x += num(elem, 'marginLeft');
|
||||
y += num(elem, 'marginTop');
|
||||
} else
|
||||
// IE does not add the border in Standards Mode
|
||||
if ((ie && jQuery.boxModel)) {
|
||||
x += num(elem, 'borderLeftWidth');
|
||||
y += num(elem, 'borderTopWidth');
|
||||
} else
|
||||
// Safari 3 doesn't not include border or margin
|
||||
if (sf3) {
|
||||
x += num(elem, 'marginLeft') + num(elem, 'borderLeftWidth');
|
||||
y += num(elem, 'marginTop') + num(elem, 'borderTopWidth');
|
||||
}
|
||||
} else {
|
||||
do {
|
||||
parPos = $.css(parent, 'position');
|
||||
|
||||
x += parent.offsetLeft;
|
||||
y += parent.offsetTop;
|
||||
|
||||
// Mozilla and IE do not add the border
|
||||
// Mozilla adds the border for table cells
|
||||
if ((mo && !parent.tagName.match(/^t[d|h]$/i)) || ie || sf3) {
|
||||
// add borders to offset
|
||||
x += num(parent, 'borderLeftWidth');
|
||||
y += num(parent, 'borderTopWidth');
|
||||
|
||||
// Mozilla does not include the border on body if an element isn't positioned absolute and is without an absolute parent
|
||||
if (mo && parPos == 'absolute') absparent = true;
|
||||
// IE does not include the border on the body if an element is position static and without an absolute or relative parent
|
||||
if (ie && parPos == 'relative') relparent = true;
|
||||
}
|
||||
|
||||
op = parent.offsetParent || document.body;
|
||||
if (options.scroll || mo) {
|
||||
do {
|
||||
if (options.scroll) {
|
||||
// get scroll offsets
|
||||
sl += parent.scrollLeft;
|
||||
st += parent.scrollTop;
|
||||
}
|
||||
|
||||
// Opera sometimes incorrectly reports scroll offset for elements with display set to table-row or inline
|
||||
if (oa && ($.css(parent, 'display') || '').match(/table-row|inline/)) {
|
||||
sl = sl - ((parent.scrollLeft == parent.offsetLeft) ? parent.scrollLeft : 0);
|
||||
st = st - ((parent.scrollTop == parent.offsetTop) ? parent.scrollTop : 0);
|
||||
}
|
||||
|
||||
// Mozilla does not add the border for a parent that has overflow set to anything but visible
|
||||
if (mo && parent != elem && $.css(parent, 'overflow') != 'visible') {
|
||||
x += num(parent, 'borderLeftWidth');
|
||||
y += num(parent, 'borderTopWidth');
|
||||
}
|
||||
|
||||
parent = parent.parentNode;
|
||||
} while (parent != op);
|
||||
}
|
||||
parent = op;
|
||||
|
||||
// exit the loop if we are at the relativeTo option but not if it is the body or html tag
|
||||
if (parent == options.relativeTo && !(parent.tagName == 'BODY' || parent.tagName == 'HTML')) {
|
||||
// Mozilla does not add the border for a parent that has overflow set to anything but visible
|
||||
if (mo && parent != elem && $.css(parent, 'overflow') != 'visible') {
|
||||
x += num(parent, 'borderLeftWidth');
|
||||
y += num(parent, 'borderTopWidth');
|
||||
}
|
||||
// Safari 2 and opera includes border on positioned parents
|
||||
if ( ((sf && !sf3) || oa) && parPos != 'static' ) {
|
||||
x -= num(op, 'borderLeftWidth');
|
||||
y -= num(op, 'borderTopWidth');
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (parent.tagName == 'BODY' || parent.tagName == 'HTML') {
|
||||
// Safari 2 and IE Standards Mode doesn't add the body margin for elments positioned with static or relative
|
||||
if (((sf && !sf3) || (ie && $.boxModel)) && elemPos != 'absolute' && elemPos != 'fixed') {
|
||||
x += num(parent, 'marginLeft');
|
||||
y += num(parent, 'marginTop');
|
||||
}
|
||||
// Safari 3 does not include the border on body
|
||||
// Mozilla does not include the border on body if an element isn't positioned absolute and is without an absolute parent
|
||||
// IE does not include the border on the body if an element is positioned static and without an absolute or relative parent
|
||||
if ( sf3 || (mo && !absparent && elemPos != 'fixed') ||
|
||||
(ie && elemPos == 'static' && !relparent) ) {
|
||||
x += num(parent, 'borderLeftWidth');
|
||||
y += num(parent, 'borderTopWidth');
|
||||
}
|
||||
break; // Exit the loop
|
||||
}
|
||||
} while (parent);
|
||||
}
|
||||
|
||||
var returnValue = handleOffsetReturn(elem, options, x, y, sl, st);
|
||||
|
||||
if (returnObject) { $.extend(returnObject, returnValue); return this; }
|
||||
else { return returnValue; }
|
||||
},
|
||||
|
||||
/**
|
||||
* Gets the location of the element in pixels from the top left corner of the viewport.
|
||||
* This method is much faster than offset but not as accurate when borders and margins are
|
||||
* on the element and/or its parents. This method can be invoked
|
||||
* by setting the lite option to true in the offset method.
|
||||
* The offsetLite method takes an optional map of key value pairs to configure the way
|
||||
* the offset is calculated. Here are the different options.
|
||||
*
|
||||
* (Boolean) margin - Should the margin of the element be included in the calculations? True by default.
|
||||
* (Boolean) border - Should the border of the element be included in the calculations? False by default.
|
||||
* (Boolean) padding - Should the padding of the element be included in the calcuations? False by default.
|
||||
* (Boolean) scroll - Sould the scroll offsets of the parent elements be included int he calculations? True by default.
|
||||
* When true it adds the total scroll offsets of all parents to the total offset and also adds two
|
||||
* properties to the returned object, scrollTop and scrollLeft.
|
||||
* (HTML Element) relativeTo - This should be a parent of the element and should have position (like absolute or relative).
|
||||
* It will retreive the offset relative to this parent element. By default it is the body element.
|
||||
*
|
||||
* @name offsetLite
|
||||
* @param Map options Optional settings to configure the way the offset is calculated.
|
||||
* @param Object returnObject An object to store the return value in, so as not to break the chain. If passed in the
|
||||
* chain will not be broken and the result will be assigned to this object.
|
||||
* @type Object
|
||||
* @cat Plugins/Dimensions
|
||||
*/
|
||||
offsetLite: function(options, returnObject) {
|
||||
if (!this[0]) error();
|
||||
var x = 0, y = 0, sl = 0, st = 0, parent = this[0], offsetParent,
|
||||
options = $.extend({ margin: true, border: false, padding: false, scroll: true, relativeTo: document.body }, options || {});
|
||||
|
||||
// Get the HTMLElement if relativeTo is a jquery collection
|
||||
if (options.relativeTo.jquery) options.relativeTo = options.relativeTo[0];
|
||||
|
||||
do {
|
||||
x += parent.offsetLeft;
|
||||
y += parent.offsetTop;
|
||||
|
||||
offsetParent = parent.offsetParent || document.body;
|
||||
if (options.scroll) {
|
||||
// get scroll offsets
|
||||
do {
|
||||
sl += parent.scrollLeft;
|
||||
st += parent.scrollTop;
|
||||
parent = parent.parentNode;
|
||||
} while(parent != offsetParent);
|
||||
}
|
||||
parent = offsetParent;
|
||||
} while (parent && parent.tagName != 'BODY' && parent.tagName != 'HTML' && parent != options.relativeTo);
|
||||
|
||||
var returnValue = handleOffsetReturn(this[0], options, x, y, sl, st);
|
||||
|
||||
if (returnObject) { $.extend(returnObject, returnValue); return this; }
|
||||
else { return returnValue; }
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns a jQuery collection with the positioned parent of
|
||||
* the first matched element. This is the first parent of
|
||||
* the element that has position (as in relative or absolute).
|
||||
*
|
||||
* @name offsetParent
|
||||
* @type jQuery
|
||||
* @cat Plugins/Dimensions
|
||||
*/
|
||||
offsetParent: function() {
|
||||
if (!this[0]) error();
|
||||
var offsetParent = this[0].offsetParent;
|
||||
while ( offsetParent && (offsetParent.tagName != 'BODY' && $.css(offsetParent, 'position') == 'static') )
|
||||
offsetParent = offsetParent.offsetParent;
|
||||
return $(offsetParent);
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Throws an error message when no elements are in the jQuery collection
|
||||
* @private
|
||||
*/
|
||||
var error = function() {
|
||||
throw "Dimensions: jQuery collection is empty";
|
||||
};
|
||||
|
||||
/**
|
||||
* Handles converting a CSS Style into an Integer.
|
||||
* @private
|
||||
*/
|
||||
var num = function(el, prop) {
|
||||
return parseInt($.css(el.jquery?el[0]:el,prop))||0;
|
||||
};
|
||||
|
||||
/**
|
||||
* Handles the return value of the offset and offsetLite methods.
|
||||
* @private
|
||||
*/
|
||||
var handleOffsetReturn = function(elem, options, x, y, sl, st) {
|
||||
if ( !options.margin ) {
|
||||
x -= num(elem, 'marginLeft');
|
||||
y -= num(elem, 'marginTop');
|
||||
}
|
||||
|
||||
// Safari and Opera do not add the border for the element
|
||||
if ( options.border && (($.browser.safari && parseInt($.browser.version) < 520) || $.browser.opera) ) {
|
||||
x += num(elem, 'borderLeftWidth');
|
||||
y += num(elem, 'borderTopWidth');
|
||||
} else if ( !options.border && !(($.browser.safari && parseInt($.browser.version) < 520) || $.browser.opera) ) {
|
||||
x -= num(elem, 'borderLeftWidth');
|
||||
y -= num(elem, 'borderTopWidth');
|
||||
}
|
||||
|
||||
if ( options.padding ) {
|
||||
x += num(elem, 'paddingLeft');
|
||||
y += num(elem, 'paddingTop');
|
||||
}
|
||||
|
||||
// do not include scroll offset on the element ... opera sometimes reports scroll offset as actual offset
|
||||
if ( options.scroll && (!$.browser.opera || elem.offsetLeft != elem.scrollLeft && elem.offsetTop != elem.scrollLeft) ) {
|
||||
sl -= elem.scrollLeft;
|
||||
st -= elem.scrollTop;
|
||||
}
|
||||
|
||||
return options.scroll ? { top: y - st, left: x - sl, scrollTop: st, scrollLeft: sl }
|
||||
: { top: y, left: x };
|
||||
};
|
||||
|
||||
/**
|
||||
* Gets the width of the OS scrollbar
|
||||
* @private
|
||||
*/
|
||||
var scrollbarWidth = 0;
|
||||
var getScrollbarWidth = function() {
|
||||
if (!scrollbarWidth) {
|
||||
var testEl = $('<div>')
|
||||
.css({
|
||||
width: 100,
|
||||
height: 100,
|
||||
overflow: 'auto',
|
||||
position: 'absolute',
|
||||
top: -1000,
|
||||
left: -1000
|
||||
})
|
||||
.appendTo('body');
|
||||
scrollbarWidth = 100 - testEl
|
||||
.append('<div>')
|
||||
.find('div')
|
||||
.css({
|
||||
width: '100%',
|
||||
height: 200
|
||||
})
|
||||
.width();
|
||||
testEl.remove();
|
||||
}
|
||||
return scrollbarWidth;
|
||||
};
|
||||
|
||||
})(jQuery);
|
||||
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'];
|
||||
?>
|
||||
|
||||
|
||||
234
modules/EcmDocuments/dragresize.html
Executable file
234
modules/EcmDocuments/dragresize.html
Executable file
@@ -0,0 +1,234 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
|
||||
<head>
|
||||
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
|
||||
<title>Div Drag/Resize Demo</title>
|
||||
<script type="text/javascript" src="dragresize.js"></script>
|
||||
|
||||
<style type="text/css">
|
||||
|
||||
/* Required CSS classes: must be included in all pages using this script */
|
||||
|
||||
/* Apply the element you want to drag/resize */
|
||||
.drsElement {
|
||||
position: absolute;
|
||||
border: 1px solid #333;
|
||||
}
|
||||
|
||||
/*
|
||||
The main mouse handle that moves the whole element.
|
||||
You can apply to the same tag as drsElement if you want.
|
||||
*/
|
||||
.drsMoveHandle {
|
||||
height: 20px;
|
||||
background-color: #CCC;
|
||||
border-bottom: 1px solid #666;
|
||||
cursor: move;
|
||||
}
|
||||
|
||||
/*
|
||||
The DragResize object name is automatically applied to all generated
|
||||
corner resize handles, as well as one of the individual classes below.
|
||||
*/
|
||||
.dragresize {
|
||||
position: absolute;
|
||||
width: 5px;
|
||||
height: 5px;
|
||||
font-size: 1px;
|
||||
background: #EEE;
|
||||
border: 1px solid #333;
|
||||
}
|
||||
|
||||
/*
|
||||
Individual corner classes - required for resize support.
|
||||
These are based on the object name plus the handle ID.
|
||||
*/
|
||||
.dragresize-tl {
|
||||
top: -8px;
|
||||
left: -8px;
|
||||
cursor: nw-resize;
|
||||
}
|
||||
.dragresize-tm {
|
||||
top: -8px;
|
||||
left: 50%;
|
||||
margin-left: -4px;
|
||||
cursor: n-resize;
|
||||
}
|
||||
.dragresize-tr {
|
||||
top: -8px;
|
||||
right: -8px;
|
||||
cursor: ne-resize;
|
||||
}
|
||||
|
||||
.dragresize-ml {
|
||||
top: 50%;
|
||||
margin-top: -4px;
|
||||
left: -8px;
|
||||
cursor: w-resize;
|
||||
}
|
||||
.dragresize-mr {
|
||||
top: 50%;
|
||||
margin-top: -4px;
|
||||
right: -8px;
|
||||
cursor: e-resize;
|
||||
}
|
||||
|
||||
.dragresize-bl {
|
||||
bottom: -8px;
|
||||
left: -8px;
|
||||
cursor: sw-resize;
|
||||
}
|
||||
.dragresize-bm {
|
||||
bottom: -8px;
|
||||
left: 50%;
|
||||
margin-left: -4px;
|
||||
cursor: s-resize;
|
||||
}
|
||||
.dragresize-br {
|
||||
bottom: -8px;
|
||||
right: -8px;
|
||||
cursor: se-resize;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
<script type="text/javascript">
|
||||
//<![CDATA[
|
||||
|
||||
// Using DragResize is simple!
|
||||
// You first declare a new DragResize() object, passing its own name and an object
|
||||
// whose keys constitute optional parameters/settings:
|
||||
|
||||
var dragresize = new DragResize('dragresize',
|
||||
{ minWidth: 50, minHeight: 50, minLeft: 20, minTop: 20, maxLeft: 600, maxTop: 600 });
|
||||
|
||||
// Optional settings/properties of the DragResize object are:
|
||||
// enabled: Toggle whether the object is active.
|
||||
// handles[]: An array of drag handles to use (see the .JS file).
|
||||
// minWidth, minHeight: Minimum size to which elements are resized (in pixels).
|
||||
// minLeft, maxLeft, minTop, maxTop: Bounding box (in pixels).
|
||||
|
||||
// Next, you must define two functions, isElement and isHandle. These are passed
|
||||
// a given DOM element, and must "return true" if the element in question is a
|
||||
// draggable element or draggable handle. Here, I'm checking for the CSS classname
|
||||
// of the elements, but you have have any combination of conditions you like:
|
||||
|
||||
dragresize.isElement = function(elm)
|
||||
{
|
||||
if (elm.className && elm.className.indexOf('drsElement') > -1) return true;
|
||||
};
|
||||
dragresize.isHandle = function(elm)
|
||||
{
|
||||
if (elm.className && elm.className.indexOf('drsMoveHandle') > -1) return true;
|
||||
};
|
||||
|
||||
// You can define optional functions that are called as elements are dragged/resized.
|
||||
// Some are passed true if the source event was a resize, or false if it's a drag.
|
||||
// The focus/blur events are called as handles are added/removed from an object,
|
||||
// and the others are called as users drag, move and release the object's handles.
|
||||
// You might use these to examine the properties of the DragResize object to sync
|
||||
// other page elements, etc.
|
||||
|
||||
dragresize.ondragfocus = function() { };
|
||||
dragresize.ondragstart = function(isResize) { };
|
||||
dragresize.ondragmove = function(isResize) { };
|
||||
dragresize.ondragend = function(isResize) { };
|
||||
dragresize.ondragblur = function() { };
|
||||
|
||||
// Finally, you must apply() your DragResize object to a DOM node; all children of this
|
||||
// node will then be made draggable. Here, I'm applying to the entire document.
|
||||
dragresize.apply(document);
|
||||
|
||||
//]]>
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body style="font: 13px/20px sans-serif; background-color: #FFF">
|
||||
|
||||
<div style="text-align: center">
|
||||
<h1 style="font: 32px/48px sans-serif">DragResize v1.0</h1>
|
||||
by Angus Turnbull - <a href="http://www.twinhelix.com">http://www.twinhelix.com</a>.
|
||||
Updated: 27 June 2006.
|
||||
<hr />
|
||||
</div>
|
||||
|
||||
|
||||
<!--
|
||||
Here's our draggable elements.
|
||||
All that's required is that they have a relative or absolute CSS 'position',
|
||||
and are matched by the isElement/isHandle methods of a DragResize object.
|
||||
Easy!
|
||||
-->
|
||||
|
||||
<div class="drsElement"
|
||||
style="left: 50px; top: 150px; width: 250px; height: 120px;
|
||||
background: #CDF; text-align: center">
|
||||
<div class="drsMoveHandle">Div 0</div>
|
||||
Content
|
||||
</div>
|
||||
|
||||
<div class="drsElement"
|
||||
style="left: 20px; top: 300px; width: 150px; height: 200px;
|
||||
background: #FDC; text-align: center">
|
||||
<div class="drsMoveHandle">Div 1</div>
|
||||
Content
|
||||
</div>
|
||||
|
||||
<div class="drsElement drsMoveHandle"
|
||||
style="left: 150px; top: 280px; width: 50px; height: 100px;
|
||||
background: #DFC; text-align: center">
|
||||
Div 2
|
||||
Content
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div style="margin-top: 400px"><!-- spacer --></div>
|
||||
|
||||
<p>This is a JavaScript library that lets you easily implement user-friendly
|
||||
and customisable dragging and resizing of your page elements. You might want to
|
||||
use it as part of a web application -- it contains all you need for a
|
||||
lightweight "windowing" system. Features include:</p>
|
||||
|
||||
<ul>
|
||||
<li><strong>Can both drag and resize</strong> page elements.</li>
|
||||
<li><strong>Works with absolute and relatively positioned</strong> elements
|
||||
in your page.</li>
|
||||
<li><strong>Customisable appearance</strong> as it makes extensive use of CSS
|
||||
classes for layout of its resisze handles.</li>
|
||||
<li><strong>Unobtrusive, Object-Orientated JavaScript</strong> means it's easy
|
||||
to add to your pages.</li>
|
||||
<li><strong>Bounding boxes and minimum sizes</strong> can be set and
|
||||
automatically enforced.</li>
|
||||
<li><strong>Cross-browser compatible</strong> so it works for everyone.</li>
|
||||
<li><strong>Small code size</strong> so your visitors don't have to wait!</li>
|
||||
</ul>
|
||||
|
||||
<div style="border: 2px solid red; background: #FFF0F0; padding: 0pt 10pt 0pt 10pt">
|
||||
|
||||
<h4>Script License Agreement</h4>
|
||||
|
||||
<p>DragResize © 2005-2006 Angus Turnbull, TwinHelix Designs
|
||||
<a href="http://www.twinhelix.com">http://www.twinhelix.com</a></p>
|
||||
<p>Licensed under the
|
||||
<a href="http://creativecommons.org/licenses/LGPL/2.1/">CC-GNU LGPL,
|
||||
version 2.1 or later</a>.</p>
|
||||
<p>This is distributed WITHOUT ANY WARRANTY; without even the implied
|
||||
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.</p>
|
||||
|
||||
</div>
|
||||
|
||||
<p>I hope you find it handy!
|
||||
It's free for you to use and distribute, as long as you retain the license and
|
||||
copyright as per the LGPL.
|
||||
If you like this and/or my other scripts, you're more than welcome to
|
||||
<a href="http://www.twinhelix.com/donate/">make a donation</a>.
|
||||
See the source for more details and instructions.</p>
|
||||
|
||||
<p>Note: DragResize was conceived initially as part of my work on the
|
||||
<a href="http://www.fotonotes.net">Fotonotes DHTML Client</a>.</p>
|
||||
|
||||
<p><em>Good luck - Angus.</em></p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
14
modules/EcmDocuments/dragresize.js
Executable file
14
modules/EcmDocuments/dragresize.js
Executable file
File diff suppressed because one or more lines are too long
352
modules/EcmDocuments/dragresize_commented.js
Executable file
352
modules/EcmDocuments/dragresize_commented.js
Executable file
@@ -0,0 +1,352 @@
|
||||
/*
|
||||
|
||||
DragResize v1.0
|
||||
(c) 2005-2006 Angus Turnbull, TwinHelix Designs http://www.twinhelix.com
|
||||
|
||||
Licensed under the CC-GNU LGPL, version 2.1 or later:
|
||||
http://creativecommons.org/licenses/LGPL/2.1/
|
||||
This is distributed WITHOUT ANY WARRANTY; without even the implied
|
||||
warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
*/
|
||||
|
||||
|
||||
// Common API code.
|
||||
|
||||
if (typeof addEvent != 'function')
|
||||
{
|
||||
var addEvent = function(o, t, f, l)
|
||||
{
|
||||
var d = 'addEventListener', n = 'on' + t, rO = o, rT = t, rF = f, rL = l;
|
||||
if (o[d] && !l) return o[d](t, f, false);
|
||||
if (!o._evts) o._evts = {};
|
||||
if (!o._evts[t])
|
||||
{
|
||||
o._evts[t] = o[n] ? { b: o[n] } : {};
|
||||
o[n] = new Function('e',
|
||||
'var r = true, o = this, a = o._evts["' + t + '"], i; for (i in a) {' +
|
||||
'o._f = a[i]; r = o._f(e||window.event) != false && r; o._f = null;' +
|
||||
'} return r');
|
||||
if (t != 'unload') addEvent(window, 'unload', function() {
|
||||
removeEvent(rO, rT, rF, rL);
|
||||
});
|
||||
}
|
||||
if (!f._i) f._i = addEvent._i++;
|
||||
o._evts[t][f._i] = f;
|
||||
};
|
||||
addEvent._i = 1;
|
||||
var removeEvent = function(o, t, f, l)
|
||||
{
|
||||
var d = 'removeEventListener';
|
||||
if (o[d] && !l) return o[d](t, f, false);
|
||||
if (o._evts && o._evts[t] && f._i) delete o._evts[t][f._i];
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
function cancelEvent(e, c)
|
||||
{
|
||||
e.returnValue = false;
|
||||
if (e.preventDefault) e.preventDefault();
|
||||
if (c)
|
||||
{
|
||||
e.cancelBubble = true;
|
||||
if (e.stopPropagation) e.stopPropagation();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// *** DRAG/RESIZE CODE ***
|
||||
|
||||
function DragResize(myName, config)
|
||||
{
|
||||
var props = {
|
||||
myName: myName, // Name of the object.
|
||||
enabled: true, // Global toggle of drag/resize.
|
||||
handles: ['tl', 'tm', 'tr',
|
||||
'ml', 'mr', 'bl', 'bm', 'br'], // Array of drag handles: top/mid/bot/right.
|
||||
isElement: null, // Function ref to test for an element.
|
||||
isHandle: null, // Function ref to test for move handle.
|
||||
element: null, // The currently selected element.
|
||||
handle: null, // Active handle reference of the element.
|
||||
minWidth: 10, minHeight: 10, // Minimum pixel size of elements.
|
||||
minLeft: 0, maxLeft: 9999, // Bounding box area, in pixels.
|
||||
minTop: 0, maxTop: 9999,
|
||||
zIndex: 1, // The highest Z-Index yet allocated.
|
||||
mouseX: 0, mouseY: 0, // Current mouse position, recorded live.
|
||||
lastMouseX: 0, lastMouseY: 0, // Last processed mouse positions.
|
||||
mOffX: 0, mOffY: 0, // A known offset between position & mouse.
|
||||
elmX: 0, elmY: 0, // Element position.
|
||||
elmW: 0, elmH: 0, // Element size.
|
||||
allowBlur: true, // Whether to allow automatic blur onclick.
|
||||
ondragfocus: null, // Event handler functions.
|
||||
ondragstart: null,
|
||||
ondragmove: null,
|
||||
ondragend: null,
|
||||
ondragblur: null
|
||||
};
|
||||
|
||||
for (var p in props)
|
||||
this[p] = (typeof config[p] == 'undefined') ? props[p] : config[p];
|
||||
};
|
||||
|
||||
|
||||
DragResize.prototype.apply = function(node)
|
||||
{
|
||||
// Adds object event handlers to the specified DOM node.
|
||||
|
||||
var obj = this;
|
||||
addEvent(node, 'mousedown', function(e) { obj.mouseDown(e) } );
|
||||
addEvent(node, 'mousemove', function(e) { obj.mouseMove(e) } );
|
||||
addEvent(node, 'mouseup', function(e) { obj.mouseUp(e) } );
|
||||
};
|
||||
|
||||
|
||||
DragResize.prototype.select = function(newElement) { with (this)
|
||||
{
|
||||
// Selects an element for dragging.
|
||||
|
||||
if (!document.getElementById || !enabled) return;
|
||||
|
||||
// Activate and record our new dragging element.
|
||||
if (newElement && (newElement != element) && enabled)
|
||||
{
|
||||
element = newElement;
|
||||
// Elevate it and give it resize handles.
|
||||
element.style.zIndex = ++zIndex;
|
||||
if (this.resizeHandleSet) this.resizeHandleSet(element, true);
|
||||
// Record element attributes for mouseMove().
|
||||
elmX = parseInt(element.style.left);
|
||||
elmY = parseInt(element.style.top);
|
||||
elmW = element.offsetWidth;
|
||||
elmH = element.offsetHeight;
|
||||
if (ondragfocus) this.ondragfocus();
|
||||
}
|
||||
}};
|
||||
|
||||
|
||||
DragResize.prototype.deselect = function(delHandles) { with (this)
|
||||
{
|
||||
// Immediately stops dragging an element. If 'delHandles' is true, this
|
||||
// remove the handles from the element and clears the element flag,
|
||||
// completely resetting the .
|
||||
|
||||
if (!document.getElementById || !enabled) return;
|
||||
|
||||
if (delHandles)
|
||||
{
|
||||
if (ondragblur) this.ondragblur();
|
||||
if (this.resizeHandleSet) this.resizeHandleSet(element, false);
|
||||
element = null;
|
||||
}
|
||||
|
||||
handle = null;
|
||||
mOffX = 0;
|
||||
mOffY = 0;
|
||||
}};
|
||||
|
||||
|
||||
DragResize.prototype.mouseDown = function(e) { with (this)
|
||||
{
|
||||
// Suitable elements are selected for drag/resize on mousedown.
|
||||
// We also initialise the resize boxes, and drag parameters like mouse position etc.
|
||||
if (!document.getElementById || !enabled) return true;
|
||||
|
||||
var elm = e.target || e.srcElement,
|
||||
newElement = null,
|
||||
newHandle = null,
|
||||
hRE = new RegExp(myName + '-([trmbl]{2})', '');
|
||||
|
||||
while (elm)
|
||||
{
|
||||
// Loop up the DOM looking for matching elements. Remember one if found.
|
||||
if (elm.className)
|
||||
{
|
||||
if (!newHandle && (hRE.test(elm.className) || isHandle(elm))) newHandle = elm;
|
||||
if (isElement(elm)) { newElement = elm; break }
|
||||
}
|
||||
elm = elm.parentNode;
|
||||
}
|
||||
|
||||
// If this isn't on the last dragged element, call deselect(),
|
||||
// which will hide its handles and clear element.
|
||||
if (element && (element != newElement) && allowBlur) deselect(true);
|
||||
|
||||
// If we have a new matching element, call select().
|
||||
if (newElement && (!element || (newElement == element)))
|
||||
{
|
||||
// Stop mouse selections if we're dragging a handle.
|
||||
if (newHandle) cancelEvent(e);
|
||||
select(newElement, newHandle);
|
||||
handle = newHandle;
|
||||
if (handle && ondragstart) this.ondragstart(hRE.test(handle.className));
|
||||
}
|
||||
}};
|
||||
|
||||
|
||||
DragResize.prototype.mouseMove = function(e) { with (this)
|
||||
{
|
||||
// This continually offsets the dragged element by the difference between the
|
||||
// last recorded mouse position (mouseX/Y) and the current mouse position.
|
||||
if (!document.getElementById || !enabled) return true;
|
||||
|
||||
// We always record the current mouse position.
|
||||
mouseX = e.pageX || e.clientX + document.documentElement.scrollLeft;
|
||||
mouseY = e.pageY || e.clientY + document.documentElement.scrollTop;
|
||||
// Record the relative mouse movement, in case we're dragging.
|
||||
// Add any previously stored & ignored offset to the calculations.
|
||||
var diffX = mouseX - lastMouseX + mOffX;
|
||||
var diffY = mouseY - lastMouseY + mOffY;
|
||||
mOffX = mOffY = 0;
|
||||
// Update last processed mouse positions.
|
||||
lastMouseX = mouseX;
|
||||
lastMouseY = mouseY;
|
||||
|
||||
// That's all we do if we're not dragging anything.
|
||||
if (!handle) return true;
|
||||
|
||||
// If included in the script, run the resize handle drag routine.
|
||||
// Let it create an object representing the drag offsets.
|
||||
var isResize = false;
|
||||
if (this.resizeHandleDrag && this.resizeHandleDrag(diffX, diffY))
|
||||
{
|
||||
isResize = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// If the resize drag handler isn't set or returns fase (to indicate the drag was
|
||||
// not on a resize handle), we must be dragging the whole element, so move that.
|
||||
// Bounds check left-right...
|
||||
var dX = diffX, dY = diffY;
|
||||
if (elmX + dX < minLeft) mOffX = (dX - (diffX = minLeft - elmX));
|
||||
else if (elmX + elmW + dX > maxLeft) mOffX = (dX - (diffX = maxLeft - elmX - elmW));
|
||||
// ...and up-down.
|
||||
if (elmY + dY < minTop) mOffY = (dY - (diffY = minTop - elmY));
|
||||
else if (elmY + elmH + dY > maxTop) mOffY = (dY - (diffY = maxTop - elmY - elmH));
|
||||
elmX += diffX;
|
||||
elmY += diffY;
|
||||
}
|
||||
|
||||
// Assign new info back to the element, with minimum dimensions.
|
||||
with (element.style)
|
||||
{
|
||||
left = elmX + 'px';
|
||||
width = elmW + 'px';
|
||||
top = elmY + 'px';
|
||||
height = elmH + 'px';
|
||||
}
|
||||
|
||||
// Evil, dirty, hackish Opera select-as-you-drag fix.
|
||||
if (window.opera && document.documentElement)
|
||||
{
|
||||
var oDF = document.getElementById('op-drag-fix');
|
||||
if (!oDF)
|
||||
{
|
||||
var oDF = document.createElement('input');
|
||||
oDF.id = 'op-drag-fix';
|
||||
oDF.style.display = 'none';
|
||||
document.body.appendChild(oDF);
|
||||
}
|
||||
oDF.focus();
|
||||
}
|
||||
|
||||
if (ondragmove) this.ondragmove(isResize);
|
||||
|
||||
// Stop a normal drag event.
|
||||
cancelEvent(e);
|
||||
}};
|
||||
|
||||
|
||||
DragResize.prototype.mouseUp = function(e) { with (this)
|
||||
{
|
||||
// On mouseup, stop dragging, but don't reset handler visibility.
|
||||
if (!document.getElementById || !enabled) return;
|
||||
|
||||
var hRE = new RegExp(myName + '-([trmbl]{2})', '');
|
||||
if (handle && ondragend) this.ondragend(hRE.test(handle.className));
|
||||
deselect(false);
|
||||
}};
|
||||
|
||||
|
||||
|
||||
/* Resize Code -- can be deleted if you're not using it. */
|
||||
|
||||
DragResize.prototype.resizeHandleSet = function(elm, show) { with (this)
|
||||
{
|
||||
// Either creates, shows or hides the resize handles within an element.
|
||||
|
||||
// If we're showing them, and no handles have been created, create 4 new ones.
|
||||
if (!elm._handle_tr)
|
||||
{
|
||||
for (var h = 0; h < handles.length; h++)
|
||||
{
|
||||
// Create 4 news divs, assign each a generic + specific class.
|
||||
var hDiv = document.createElement('div');
|
||||
hDiv.className = myName + ' ' + myName + '-' + handles[h];
|
||||
elm['_handle_' + handles[h]] = elm.appendChild(hDiv);
|
||||
}
|
||||
}
|
||||
|
||||
// We now have handles. Find them all and show/hide.
|
||||
for (var h = 0; h < handles.length; h++)
|
||||
{
|
||||
elm['_handle_' + handles[h]].style.visibility = show ? 'inherit' : 'hidden';
|
||||
}
|
||||
}};
|
||||
|
||||
|
||||
DragResize.prototype.resizeHandleDrag = function(diffX, diffY) { with (this)
|
||||
{
|
||||
// Passed the mouse movement amounts. This function checks to see whether the
|
||||
// drag is from a resize handle created above; if so, it changes the stored
|
||||
// elm* dimensions and mOffX/Y.
|
||||
|
||||
var hClass = handle && handle.className &&
|
||||
handle.className.match(new RegExp(myName + '-([tmblr]{2})')) ? RegExp.$1 : '';
|
||||
|
||||
// If the hClass is one of the resize handles, resize one or two dimensions.
|
||||
// Bounds checking is the hard bit -- basically for each edge, check that the
|
||||
// element doesn't go under minimum size, and doesn't go beyond its boundary.
|
||||
var dY = diffY, dX = diffX, processed = false;
|
||||
if (hClass.indexOf('t') >= 0)
|
||||
{
|
||||
rs = 1;
|
||||
if (elmH - dY < minHeight) mOffY = (dY - (diffY = elmH - minHeight));
|
||||
else if (elmY + dY < minTop) mOffY = (dY - (diffY = minTop - elmY));
|
||||
elmY += diffY;
|
||||
elmH -= diffY;
|
||||
processed = true;
|
||||
}
|
||||
if (hClass.indexOf('b') >= 0)
|
||||
{
|
||||
rs = 1;
|
||||
if (elmH + dY < minHeight) mOffY = (dY - (diffY = minHeight - elmH));
|
||||
else if (elmY + elmH + dY > maxTop) mOffY = (dY - (diffY = maxTop - elmY - elmH));
|
||||
elmH += diffY;
|
||||
processed = true;
|
||||
}
|
||||
if (hClass.indexOf('l') >= 0)
|
||||
{
|
||||
rs = 1;
|
||||
if (elmW - dX < minWidth) mOffX = (dX - (diffX = elmW - minWidth));
|
||||
else if (elmX + dX < minLeft) mOffX = (dX - (diffX = minLeft - elmX));
|
||||
elmX += diffX;
|
||||
elmW -= diffX;
|
||||
processed = true;
|
||||
}
|
||||
if (hClass.indexOf('r') >= 0)
|
||||
{
|
||||
rs = 1;
|
||||
if (elmW + dX < minWidth) mOffX = (dX - (diffX = minWidth - elmW));
|
||||
else if (elmX + elmW + dX > maxLeft) mOffX = (dX - (diffX = maxLeft - elmX - elmW));
|
||||
elmW += diffX;
|
||||
processed = true;
|
||||
}
|
||||
|
||||
return processed;
|
||||
}};
|
||||
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;
|
||||
}
|
||||
?>
|
||||
70
modules/EcmDocuments/j123.drag.js
Executable file
70
modules/EcmDocuments/j123.drag.js
Executable file
@@ -0,0 +1,70 @@
|
||||
/*
|
||||
j123 -- JavaScript common library
|
||||
mail: sebastian.hanula@gmail.com
|
||||
www: http://www.hanula.com/lab/j123
|
||||
|
||||
j123 drag library
|
||||
*/
|
||||
|
||||
j123.drag = {
|
||||
object : null,
|
||||
|
||||
init : function(el,root) {
|
||||
j123.events.add(el,'mousedown',j123.drag.start);
|
||||
el.root = root;
|
||||
if(isNaN(parseInt(el.root.style.left))) el.root.style.left="0px";
|
||||
if(isNaN(parseInt(el.root.style.top))) el.root.style.top="0px";
|
||||
|
||||
if(!el.root.onDragStart) el.root.onDragStart = function(x,y,cx,cy) {};
|
||||
if(!el.root.onDragEnd)el.root.onDragEnd = function(x,y) {};
|
||||
if(!el.root.onDrag)el.root.onDrag = function(x,y,cx,cy,e) {return {x:x,y:y}};
|
||||
|
||||
|
||||
},
|
||||
|
||||
start : function(e) {
|
||||
var b = j123.drag.object = this;
|
||||
e=j123.events.fix(e);
|
||||
var x=parseInt(b.root.style.top);
|
||||
var y=parseInt(b.root.style.left);
|
||||
|
||||
b.root.onDragStart(x,y,e.clientX,e.clientY);
|
||||
b.lastMouseX=e.clientX;
|
||||
b.lastMouseY=e.clientY;
|
||||
j123.events.add(document,'mousemove',j123.drag.drag);
|
||||
j123.events.add(document,'mouseup',j123.drag.end);
|
||||
},
|
||||
|
||||
drag : function(a) {
|
||||
a = j123.events.fix(a);
|
||||
|
||||
if(typeof a=="undefined")a=window.event;
|
||||
if(typeof a.layerX=="undefined")a.layerX=a.offsetX;
|
||||
if(typeof a.layerY=="undefined")a.layerY=a.offsetY;
|
||||
|
||||
|
||||
var b=j123.drag.object;
|
||||
var c=a.clientY;
|
||||
var d=a.clientX;
|
||||
var e=parseInt(b.root.style.top);
|
||||
var f=parseInt(b.root.style.left);
|
||||
var h,g;
|
||||
h=f+d-b.lastMouseX;
|
||||
g=e+c-b.lastMouseY;
|
||||
|
||||
var point = b.root.onDrag(h,g,a.clientX,a.clientY,a);
|
||||
if(point.x) b.root.style.left=point.x+"px";
|
||||
if(point.y) b.root.style.top=point.y+"px";
|
||||
b.lastMouseX=d;
|
||||
b.lastMouseY=c;
|
||||
|
||||
|
||||
},
|
||||
|
||||
end : function(e) {
|
||||
|
||||
j123.events.remove(document,'mousemove',j123.drag.drag);
|
||||
j123.events.remove(document,'mouseup',j123.drag.end);
|
||||
j123.drag.object.root.onDragEnd(parseInt(j123.drag.object.root.style.left),parseInt(j123.drag.object.root.style.top));
|
||||
}
|
||||
};
|
||||
79
modules/EcmDocuments/j123.drag.sortablelist.js
Executable file
79
modules/EcmDocuments/j123.drag.sortablelist.js
Executable file
@@ -0,0 +1,79 @@
|
||||
/*
|
||||
j123 -- JavaScript common library
|
||||
mail: sebastian.hanula@gmail.com
|
||||
www: http://www.hanula.com/lab/j123
|
||||
|
||||
j123 sortable HTML list library (using drag & drop)
|
||||
*/
|
||||
|
||||
|
||||
j123.drag.SortableList = {
|
||||
list_handle:null,
|
||||
items:null,
|
||||
temp_item:null,
|
||||
onChangeOrder:null,
|
||||
init: function(args) {
|
||||
var list = $(args['list']);
|
||||
this.onChangeOrder = args['onChangeOrder'];
|
||||
this.list_handle = list;
|
||||
this.items = list.getElementsByTagName('li');
|
||||
for(var i=0;i<this.items.length;i++) {
|
||||
|
||||
this.items[i].setAttribute('orig_order',i);
|
||||
this.items[i].setAttribute('list_order',i);
|
||||
this.items[i].onDragStart = this.onItemDragStart;
|
||||
this.items[i].onDrag = this.onItemDrag;
|
||||
this.items[i].onDragEnd = this.onItemDragEnd;
|
||||
|
||||
j123.drag.init(this.items[i],this.items[i]);
|
||||
}
|
||||
},
|
||||
|
||||
sortItems : function(item_top) {
|
||||
|
||||
var item = j123.drag.object;
|
||||
|
||||
var items = j123.drag.SortableList.items;
|
||||
var y = parseInt(item.style.top);
|
||||
var height = parseInt(item.offsetHeight);
|
||||
var item_index = parseInt(item.getAttribute('list_order'));
|
||||
y += item_index*height;
|
||||
|
||||
var index = Math.floor(y / height); if(index < 0) index=-1;
|
||||
else if(index > items.length-1) index = items.length-1;
|
||||
|
||||
if(!isNaN(index)) {
|
||||
|
||||
if(index > item_index) {
|
||||
j123.drag.SortableList.list_handle.insertBefore(items[index] ? items[index]:null,item);
|
||||
item_top -= height;
|
||||
} else if(index < item_index -1 && (item.prev_index!=index)) {
|
||||
j123.drag.SortableList.list_handle.insertBefore(items[index+1],item ? item.nextSibling:null);
|
||||
item.prev_index = item_index;
|
||||
item_top += height;
|
||||
}
|
||||
}
|
||||
|
||||
for(var i=0;i<items.length;i++) {
|
||||
items[i].setAttribute('list_order',i);
|
||||
}
|
||||
|
||||
return item_top;
|
||||
},
|
||||
onItemDragStart : function(x,y) {
|
||||
j123.drag.object.style.top=0;
|
||||
j123.drag.object.style.position='relative';
|
||||
},
|
||||
onItemDrag : function(x,y,cx,cy,event) {
|
||||
y = j123.drag.SortableList.sortItems(y);
|
||||
return {y:y};
|
||||
},
|
||||
|
||||
onItemDragEnd: function(x,y,cx,cy) {
|
||||
j123.drag.object.style.position='static';
|
||||
|
||||
if(j123.drag.SortableList.onChangeOrder) {
|
||||
j123.drag.SortableList.onChangeOrder(j123.drag.SortableList.items);
|
||||
}
|
||||
}
|
||||
};
|
||||
63
modules/EcmDocuments/j123.events.js
Executable file
63
modules/EcmDocuments/j123.events.js
Executable file
@@ -0,0 +1,63 @@
|
||||
/*
|
||||
j123 -- JavaScript common library
|
||||
mail: sebastian.hanula@gmail.com
|
||||
www: http://www.hanula.com/lab/j123
|
||||
|
||||
j123 events library
|
||||
*/
|
||||
|
||||
j123.events = {
|
||||
Key : {
|
||||
MB_LEFT: 1,
|
||||
MB_RIGHT: 2,
|
||||
KEY_ESC: 27,
|
||||
KEY_RETURN: 13
|
||||
},
|
||||
__events : false,
|
||||
fix : function(e) {
|
||||
if (!e) e = window.event;
|
||||
if (e.target) {
|
||||
if (e.target.nodeType == 3) e.target = e.target.parentNode
|
||||
} else if (e.srcElement) {
|
||||
e.target = e.srcElement
|
||||
}
|
||||
if(j123.browser.isIE) e.button = e.button-1;
|
||||
|
||||
return e
|
||||
},
|
||||
|
||||
add: function(el,type,fn ) {
|
||||
if(!this.__events) this.__events = [];
|
||||
this.__events.push([el,type,fn]);
|
||||
|
||||
if(el.addEventListener) {
|
||||
el.addEventListener(type, fn,false);
|
||||
} else if(el.attachEvent) {
|
||||
if (!el._listeners) el._listeners = new Array();
|
||||
if (!el._listeners[type]) el._listeners[type] = new Array();
|
||||
|
||||
var applyFunc = function() {
|
||||
fn.apply(el, new Array());
|
||||
}
|
||||
el._listeners[type][fn] = applyFunc;
|
||||
el.attachEvent('on' + type, applyFunc);
|
||||
}
|
||||
},
|
||||
|
||||
remove:function(el,type, fn) {
|
||||
if(el.removeEventListener) {
|
||||
el.removeEventListener(type,fn,false);
|
||||
} else if(el.detachEvent) {
|
||||
if (el._listeners && el._listeners[type] && el._listeners[type][fn]) {
|
||||
el.detachEvent('on' + type, el._listeners[type][fn]);
|
||||
}
|
||||
}
|
||||
},
|
||||
unload : function(e) {
|
||||
if(j123.events.__events)
|
||||
for(var i=0;i<j123.events.__events;i++)
|
||||
j123.events.remove(j123.events.__events[i][0],j123.events.__events[i][1],j123.events.__events[i][2]);
|
||||
}
|
||||
};
|
||||
|
||||
j123.events.add(window,'unload',j123.events.unload);
|
||||
129
modules/EcmDocuments/j123.js
Executable file
129
modules/EcmDocuments/j123.js
Executable file
@@ -0,0 +1,129 @@
|
||||
/*
|
||||
j123 -- JavaScript common library
|
||||
mail: sebastian.hanula@gmail.com
|
||||
www: http://www.hanula.com/lab/j123
|
||||
|
||||
j123 core library
|
||||
*/
|
||||
|
||||
|
||||
j123 = {
|
||||
ver : { major:0,minor:1},
|
||||
|
||||
onInitFunctions:[],
|
||||
registerOnInit : function(fn) {
|
||||
this.onInitFunctions.push(fn);
|
||||
},
|
||||
|
||||
init: function() {
|
||||
for(var i=0;i<this.onInitFunctions.length;i++) {
|
||||
this.onInitFunctions[i]();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
j123.browser = {
|
||||
isIE : null,
|
||||
isOpera:null,
|
||||
|
||||
init : function() {
|
||||
var ua = navigator.userAgent.toLowerCase();
|
||||
j123.browser.isIE = (ua.indexOf('msie') != -1);
|
||||
j123.browser.isOpera = (ua.indexOf('opera') != -1);
|
||||
}
|
||||
};
|
||||
j123.registerOnInit(j123.browser.init);
|
||||
|
||||
|
||||
j123.common = {
|
||||
each : function(arr,fn) {
|
||||
for(var i=0;i<arr.length;i++) fn(arr[i]);
|
||||
},
|
||||
init: function() {
|
||||
|
||||
}
|
||||
};
|
||||
j123.registerOnInit(j123.common.init);
|
||||
|
||||
|
||||
/////////// HTML
|
||||
|
||||
function $(x){ return document.getElementById(x);}
|
||||
|
||||
function findPosX(obj) {
|
||||
var curleft = 0;
|
||||
if (obj.offsetParent)
|
||||
{
|
||||
while (obj.offsetParent)
|
||||
{
|
||||
curleft += obj.offsetLeft
|
||||
obj = obj.offsetParent;
|
||||
}
|
||||
}
|
||||
else if (obj.x)
|
||||
curleft += obj.x;
|
||||
return curleft;
|
||||
};
|
||||
|
||||
j123.HTML = {
|
||||
showElement : function(el) {
|
||||
if(j123.browser.isIE) {
|
||||
|
||||
}
|
||||
el.style.visibility.display = 'visible';
|
||||
},
|
||||
hideElement: function(el) {
|
||||
el.style.visiblity = 'hidden';
|
||||
},
|
||||
|
||||
removeElement: function(el) {
|
||||
if(el.parentNode) el.parentNode.removeChild(el);
|
||||
},
|
||||
|
||||
// a przed b
|
||||
moveBefore: function(a,b) {
|
||||
b.parentNode.insertBefore(a,b);
|
||||
j123.HTML.removeElement(a);
|
||||
},
|
||||
|
||||
// a za b
|
||||
moveAfter : function(a,b) {
|
||||
a.parentNode.insertBefore(a, a ? b.nextSibling :null);
|
||||
ji123.HTML.removeElement(a);
|
||||
},
|
||||
|
||||
findPosY : function(el) {
|
||||
var curtop = 0;
|
||||
if (el.offsetParent) {
|
||||
while (el.offsetParent) {
|
||||
curtop += el.offsetTop
|
||||
el = el.offsetParent;
|
||||
}
|
||||
}
|
||||
else if (el.y)
|
||||
curtop += el.y;
|
||||
return curtop;
|
||||
},
|
||||
findPosX : function(el) {
|
||||
var curleft = 0;
|
||||
if (el.offsetParent) {
|
||||
while (el.offsetParent) {
|
||||
curleft += el.offsetLeft
|
||||
el = el.offsetParent;
|
||||
}
|
||||
}
|
||||
else if (el.x)
|
||||
curleft += el.x;
|
||||
return curleft;
|
||||
},
|
||||
setTextContent :function(el,content) {
|
||||
if(j123.browser.isIE || j123.browser.isOpera) el.innerText = content;
|
||||
else el.textContent = content;
|
||||
},
|
||||
getTextContent :function(el) {
|
||||
if(j123.browser.isIE || j123.browser.isOpera) return el.innerText;
|
||||
else return el.textContent;
|
||||
}
|
||||
|
||||
// TODO CSS
|
||||
};
|
||||
32
modules/EcmDocuments/jqDnR.js
Executable file
32
modules/EcmDocuments/jqDnR.js
Executable file
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* jqDnR - Minimalistic Drag'n'Resize for jQuery.
|
||||
*
|
||||
* Copyright (c) 2007 Brice Burgess <bhb@iceburg.net>, http://www.iceburg.net
|
||||
* Licensed under the MIT License:
|
||||
* http://www.opensource.org/licenses/mit-license.php
|
||||
*
|
||||
* $Version: 2007.08.19 +r2
|
||||
*/
|
||||
|
||||
(function($){
|
||||
$.fn.jqDrag=function(h){return i(this,h,'d');};
|
||||
$.fn.jqResize=function(h){return i(this,h,'r');};
|
||||
$.jqDnR={dnr:{},e:0,
|
||||
drag:function(v){
|
||||
if(M.k == 'd')E.css({left:M.X+v.pageX-M.pX,top:M.Y+v.pageY-M.pY});
|
||||
else E.css({width:Math.max(v.pageX-M.pX+M.W,0),height:Math.max(v.pageY-M.pY+M.H,0)});
|
||||
return false;},
|
||||
stop:function(){E.css('opacity',M.o);$().unbind('mousemove',J.drag).unbind('mouseup',J.stop);}
|
||||
};
|
||||
var J=$.jqDnR,M=J.dnr,E=J.e,
|
||||
i=function(e,h,k){return e.each(function(){h=(h)?$(h,e):e;
|
||||
h.bind('mousedown',{e:e,k:k},function(v){var d=v.data,p={};E=d.e;
|
||||
// attempt utilization of dimensions plugin to fix IE issues
|
||||
if(E.css('position') != 'relative'){try{E.position(p);}catch(e){}}
|
||||
M={X:p.left||f('left')||0,Y:p.top||f('top')||0,W:f('width')||E[0].scrollWidth||0,H:f('height')||E[0].scrollHeight||0,pX:v.pageX,pY:v.pageY,k:d.k,o:E.css('opacity')};
|
||||
E.css({opacity:0.8});$().mousemove($.jqDnR.drag).mouseup($.jqDnR.stop);
|
||||
return false;
|
||||
});
|
||||
});},
|
||||
f=function(k){return parseInt(E.css(k))||false;};
|
||||
})(jQuery);
|
||||
32
modules/EcmDocuments/jquery.js
vendored
Executable file
32
modules/EcmDocuments/jquery.js
vendored
Executable file
File diff suppressed because one or more lines are too long
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"
|
||||
);
|
||||
}
|
||||
}
|
||||
?>
|
||||
2
modules/EcmDocuments/mintajax.js
Executable file
2
modules/EcmDocuments/mintajax.js
Executable file
File diff suppressed because one or more lines are too long
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
72
modules/EcmDocuments/phpmailer/codeworxtech.html
Executable file
72
modules/EcmDocuments/phpmailer/codeworxtech.html
Executable file
@@ -0,0 +1,72 @@
|
||||
<html>
|
||||
<head>
|
||||
<style>
|
||||
body, p {
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
font-size: 12px;
|
||||
}
|
||||
div.width {
|
||||
width: 500px;
|
||||
text-align: left;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<center>
|
||||
<div class="width">
|
||||
<p><b>My name is Andy Prevost, AKA "codeworxtech".</b><br>
|
||||
<a href="http://www.codeworxtech.com">www.codeworxtech.com</a> for more information.<br>
|
||||
<a href="http://www.worxhost.com">www.worxhost.com</a> our webhosting division.</p>
|
||||
<p>Before I introduce myself, our company and our developer tools to you, let me answer a huge question you likely have:</p>
|
||||
<p><strong>WHY USE OUR TOOLS & WHAT'S IN IT FOR YOU?</strong></p>
|
||||
<p>A valid question. We're developers too. We've been writing software, primarily for the internet, for more than 15 years. Along the way, there are two major things that had tremendous impact of our company: PHP and Open Source. PHP is without doubt the most popular platform for the internet. There has been more progress in this area of technology because of Open Source software than in any other IT segment. We have used many open source tools, some as learning tools, some as components in projects we were working on. To us, it's not about popularity ... we're committed to robust, stable, and efficient tools you can use to get your projects in your user's hands quickly. So the shorter answer: what's in it for you? rapid development and rapid deployment without fuss and with straight forward open source licensing.</p>
|
||||
<p>Now, the introductions:</p>
|
||||
<p>Our company, <strong>Codeworx Technologies</strong>, is the publisher of several Open Source applications and developer tools as well as several commercial PHP applications. The Open Source applications are ttCMS and DCP Portal. The Open Source developer tools include QuickComponents (QuickSkin, QuickCache, and QuickTabs) and now PHPMailer.
|
||||
We have staff and offices in the United States, Canada, Caribbean, the Middle
|
||||
East, and our primary development center in India. Our company is represented by
|
||||
agents and resellers globally.</p>
|
||||
<p><strong>Codeworx Technologies</strong> is at the forefront of developing PHP applications. Our staff are all Zend Certified university educated and experts at object oriented programming. While <strong>Codeworx Technologies</strong> can handle any project from trouble shooting programs written by others all the way to finished mission-critical applications, we specialize in taking projects from inception all the way through to implementation - on budget, and on time. If you need help with your projects, we're the team to get it done right at a reasonable price.</p>
|
||||
<p>Over the years, there have been a number of tools that have been constant favorites in all of our projects. We have become the project administrators for most of these tools.</p>
|
||||
<p>Our developer tools are all Open Source. Here's a brief description:</p>
|
||||
<ul>
|
||||
<li><strong>PHPMailer</strong>. Originally authored by Brent Matzelle, PHPMailer is the leading "email transfer class" for PHP. PHPMailer is downloaded more than 18000 times each and every month by developers looking for a stable, simple email solution. We used it ourselves for years as our favorite tool. It's always been small (the entire footprint is around 100 Kb), stable, and as complete a solution as you can find. Other tools are nowhere near as simple. And more importantly, most of our applications (including PHPMailer) is implemented in a smaller footprint than one competing email class. Our thanks to Brent Matzelle for this superb tool - our commitment is to keep it lean, keep it focused, and compliant with standards. Visit the PHPMailer website at
|
||||
<a href="http://phpmailer.codeworxtech.com/">http://phpmailer.codeworxtech.com/</a>.<br>
|
||||
<br>
|
||||
</li>
|
||||
<li><strong>QuickCache</strong>. Originally authored by Jean Pierre Deckers as jpCache, QuickCache is an HTTP OpCode caching strategy that works on your entire site with only one line of code at the top of your script. The cached pages can be stored as files or as database objects. The benefits are absolutely astounding: bandwidth savings of up to 80% and screen display times increased by 8 - 10x. Visit the QuickCache website at
|
||||
<a href="http://quickcache.codeworxtech.com/">http://quickcache.codeworxtech.com/</a>.<br>
|
||||
<br>
|
||||
</li>
|
||||
<li><strong>QuickSkin</strong>. Originally authored by Philipp v. Criegern and named "SmartTemplate". The project was taken over by Manuel 'EndelWar' Dalla Lana and now by "codeworxtech". QuickSkin is one of the truly outstanding templating engines available, but has always been confused with Smarty Templating Engine. QuickSkin is even more relevant today than when it was launched. It's a small footprint with big impact on your projects. It features a built in caching technology, token based substitution, and works on the concept of one single HTML file as the template. The HTML template file can contain variable information making it one small powerful tool for your developer tool kit. Visit the QuickSkin website at
|
||||
<a href="http://quickskin.codeworxtech.com/">http://quickskin.codeworxtech.com/</a>.<br>
|
||||
<br>
|
||||
</li>
|
||||
<li><strong>QuickTabs</strong>. If you read about the projects above, you'll get the sense that we are minimalists and that's pretty accurate. We prefer using tools that are small, efficient, and effective. We have no use for software bloat. QuickTabs came to life in several of our projects where we needed to display complex information in a simplified manner to users. It had to function something like a "wizard" interface, but with more flexibility to float from one item to another. We looked at various Ajax-based solutions, but found one annoying problem with Ajax - page reloads if switching between items (with corresponding data loss if changed by the customer). QuickTabs is our solution to this by presenting complex data in a Javascript show/hide div set. It's not a complex architecture, but it works! Visit the QuickTabs website at <a href="http://quicktabs.codeworxtech.com/">http://quicktabs.codeworxtech.com/</a>.</li>
|
||||
</ul>
|
||||
<p>We're committed to PHP and to the Open Source community.</p>
|
||||
<p>Opportunities with <strong>Codeworx Technologies</strong>:</p>
|
||||
<ul>
|
||||
<li>Resellers/Agents: We're always interested in talking with companies that
|
||||
want to represent
|
||||
<strong>Codeworx Technologies</strong> in their markets. We also have private label programs for our commercial products (in certain circumstances).</li>
|
||||
<li>Programmers/Developers: We are usually fully staffed, however, if you would like to be considered for a career with
|
||||
<strong>Codeworx Technologies</strong>, we would be pleased to hear from you.<br>
|
||||
A few things to note:<br>
|
||||
<ul>
|
||||
<li>we do not hire contractors and we do not outsource (these are services we offer)</li>
|
||||
<li>experience level does not matter: from fresh out of college to multi-year experience - it's your
|
||||
creative mind and a positive attitude we want</li>
|
||||
<li>if you contact us looking for employment, include a cover letter, indicate what type of work/career you are looking for and expected compensation</li>
|
||||
<li>if you are representing someone else looking for work, do not contact us. We have an exclusive relationship with a recruiting partner already and not interested in altering the arrangement. We will not hire your candidate under any circumstances unless they wish to approach us individually.</li>
|
||||
<li>any contact that ignores any of these points will be discarded</li>
|
||||
</ul></li>
|
||||
<li>Affiliates/Partnerships: We are interested in partnering with other firms who are leaders in their field. We clearly understand that successful companies are built on successful relationships in all industries world-wide. We currently have innovative relationships throughout the world that are mutually beneficial. Drop us a line and let's talk.</li>
|
||||
</ul>
|
||||
Regards,<br>
|
||||
Andy Prevost (aka, codeworxtech)<br>
|
||||
<a href="mailto:codeworxtech@users.sourceforge.net">codeworxtech@users.sourceforge.net</a><br>
|
||||
<br>
|
||||
</div>
|
||||
</center>
|
||||
</body>
|
||||
</html>
|
||||
148
modules/EcmDocuments/phpmailer/docs/extending.html
Executable file
148
modules/EcmDocuments/phpmailer/docs/extending.html
Executable file
@@ -0,0 +1,148 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>Examples using phpmailer</title>
|
||||
</head>
|
||||
|
||||
<body bgcolor="#FFFFFF">
|
||||
|
||||
<h2>Examples using phpmailer</h2>
|
||||
|
||||
<h3>1. Advanced Example</h3>
|
||||
<p>
|
||||
|
||||
This demonstrates sending out multiple email messages with binary attachments
|
||||
from a MySQL database with multipart/alternative support.<p>
|
||||
<table cellpadding="4" border="1" width="80%">
|
||||
<tr>
|
||||
<td bgcolor="#CCCCCC">
|
||||
<pre>
|
||||
require("class.phpmailer.php");
|
||||
|
||||
$mail = new phpmailer();
|
||||
|
||||
$mail->From = "list@example.com";
|
||||
$mail->FromName = "List manager";
|
||||
$mail->Host = "smtp1.example.com;smtp2.example.com";
|
||||
$mail->Mailer = "smtp";
|
||||
|
||||
@MYSQL_CONNECT("localhost","root","password");
|
||||
@mysql_select_db("my_company");
|
||||
$query<72> =<3D>"SELECT full_name, email,<2C>photo<74>FROM employee<65>WHERE<52>id=$id";
|
||||
$result<6C>=<3D>@MYSQL_QUERY($query);
|
||||
|
||||
while ($row = mysql_fetch_array ($result))
|
||||
{
|
||||
// HTML body
|
||||
$body = "Hello <font size=\"4\">" . $row["full_name"] . "</font>, <p>";
|
||||
$body .= "<i>Your</i> personal photograph to this message.<p>";
|
||||
$body .= "Sincerely, <br>";
|
||||
$body .= "phpmailer List manager";
|
||||
|
||||
// Plain text body (for mail clients that cannot read HTML)
|
||||
$text_body = "Hello " . $row["full_name"] . ", \n\n";
|
||||
$text_body .= "Your personal photograph to this message.\n\n";
|
||||
$text_body .= "Sincerely, \n";
|
||||
$text_body .= "phpmailer List manager";
|
||||
|
||||
$mail->Body = $body;
|
||||
$mail->AltBody = $text_body;
|
||||
$mail->AddAddress($row["email"], $row["full_name"]);
|
||||
$mail->AddStringAttachment($row["photo"], "YourPhoto.jpg");
|
||||
|
||||
if(!$mail->Send())
|
||||
echo "There has been a mail error sending to " . $row["email"] . "<br>";
|
||||
|
||||
// Clear all addresses and attachments for next loop
|
||||
$mail->ClearAddresses();
|
||||
$mail->ClearAttachments();
|
||||
}
|
||||
</pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<p>
|
||||
|
||||
<h3>2. Extending phpmailer</h3>
|
||||
<p>
|
||||
|
||||
Extending classes with inheritance is one of the most
|
||||
powerful features of object-oriented
|
||||
programming. It allows you to make changes to the
|
||||
original class for your
|
||||
own personal use without hacking the original
|
||||
classes. Plus, it is very
|
||||
easy to do. I've provided an example:
|
||||
|
||||
<p>
|
||||
Here's a class that extends the phpmailer class and sets the defaults
|
||||
for the particular site:<br>
|
||||
PHP include file: <b>mail.inc.php</b>
|
||||
<p>
|
||||
|
||||
<table cellpadding="4" border="1" width="80%">
|
||||
<tr>
|
||||
<td bgcolor="#CCCCCC">
|
||||
<pre>
|
||||
require("class.phpmailer.php");
|
||||
|
||||
class my_phpmailer extends phpmailer {
|
||||
// Set default variables for all new objects
|
||||
var $From = "from@example.com";
|
||||
var $FromName = "Mailer";
|
||||
var $Host = "smtp1.example.com;smtp2.example.com";
|
||||
var $Mailer = "smtp"; // Alternative to IsSMTP()
|
||||
var $WordWrap = 75;
|
||||
|
||||
// Replace the default error_handler
|
||||
function error_handler($msg) {
|
||||
print("My Site Error");
|
||||
print("Description:");
|
||||
printf("%s", $msg);
|
||||
exit;
|
||||
}
|
||||
|
||||
// Create an additional function
|
||||
function do_something($something) {
|
||||
// Place your new code here
|
||||
}
|
||||
}
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<br>
|
||||
|
||||
Now here's a normal PHP page in the site, which will have all the defaults set
|
||||
above:<br>
|
||||
Normal PHP file: <b>mail_test.php</b>
|
||||
<p>
|
||||
|
||||
<table cellpadding="4" border="1" width="80%">
|
||||
<tr>
|
||||
<td bgcolor="#CCCCCC">
|
||||
<pre>
|
||||
require("mail.inc.php");
|
||||
|
||||
// Instantiate your new class
|
||||
$mail = new my_phpmailer;
|
||||
|
||||
// Now you only need to add the necessary stuff
|
||||
$mail->AddAddress("josh@example.com", "Josh Adams");
|
||||
$mail->Subject = "Here is the subject";
|
||||
$mail->Body = "This is the message body";
|
||||
$mail->AddAttachment("c:/temp/11-10-00.zip", "new_name.zip"); // optional name
|
||||
|
||||
if(!$mail->Send())
|
||||
{
|
||||
echo "There was an error sending the message";
|
||||
exit;
|
||||
}
|
||||
|
||||
echo "Message was sent successfully";
|
||||
</pre>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
66
modules/EcmDocuments/phpmailer/docs/faq.html
Executable file
66
modules/EcmDocuments/phpmailer/docs/faq.html
Executable file
@@ -0,0 +1,66 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>phpmailer FAQ</title>
|
||||
</head>
|
||||
|
||||
<body bgcolor="#FFFFFF">
|
||||
|
||||
<h2>phpmailer FAQ</h2>
|
||||
|
||||
<p>
|
||||
<b>I'm using the SMTP mailer and I keep on getting a timeout message
|
||||
well before the X seconds I set it for. What gives?</b>
|
||||
<br>
|
||||
PHP versions 4.0.4pl1 and earlier have a bug in which sockets timeout
|
||||
early. You can fix this by re-compiling PHP 4.0.4pl1 with this fix:
|
||||
<a href="timeoutfix.diff">timeoutfix.diff</a>. Otherwise you can wait
|
||||
for the new PHP release.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>I am concerned that using include files will take up too much
|
||||
processing time on my computer. How can I make it run faster?</b>
|
||||
<br>
|
||||
PHP by itself is very fast. Much faster than ASP or JSP running on
|
||||
the same type of server. This is because it has very little overhead compared
|
||||
to its competitors and it pre-compiles all of
|
||||
its code before it runs each script (in PHP4). However, all of
|
||||
this compiling and re-compiling can take up a lot of valuable
|
||||
computer resources. However, there are programs out there that compile
|
||||
PHP code and store it in memory (or on mmaped files) to reduce the
|
||||
processing immensely. Two of these: <a href="http://apc.communityconnect.com">APC
|
||||
(Alternative PHP Cache)</a> and <a href="http://bwcache.bware.it/index.htm">Afterburner</a>
|
||||
(<a href="http://www.mm4.de/php4win/mod_php4_win32/">Win32 download</a>)
|
||||
are excellent free tools that do just this. If you have the money
|
||||
you might also try <a href="http://www.zend.com">Zend Cache</a>, it is
|
||||
even faster than the open source varieties. All of these tools make your
|
||||
scripts run faster while also reducing the load on your server. I have tried
|
||||
them myself and they are quite stable too.
|
||||
</p>
|
||||
|
||||
|
||||
<p>
|
||||
<b>What mailer gives me the best performance?</b>
|
||||
<br>
|
||||
On a single machine the mail() or sendmail mailers give you the best
|
||||
performance because they do not have the added overhead of SMTP.
|
||||
If you have you have your mail server on a another machine then
|
||||
SMTP is your only option, but you do get the benefit of redundant
|
||||
mail servers.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>When I try to attach a file with on my server I get a
|
||||
"Could not find {file} on filesystem error". Why is this?</b>
|
||||
<br>
|
||||
If you are using a Unix machine this is probably because the user
|
||||
running your web server does not have read access to the directory
|
||||
in question. If you are using Windows, then the problem probably is
|
||||
that you have used single backslashes to denote directories ("\").
|
||||
A single backslash has a special meaning to PHP so these are not
|
||||
valid. Instead use double backslashes ("\\") or a single forward
|
||||
slash ("/").
|
||||
</p>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
12
modules/EcmDocuments/phpmailer/examples/contents.html
Executable file
12
modules/EcmDocuments/phpmailer/examples/contents.html
Executable file
@@ -0,0 +1,12 @@
|
||||
<body background="images/bkgrnd.gif" style="margin: 0px;">
|
||||
<div style="width: 640px; font-family: Arial, Helvetica, sans-serif; font-size: 11px;">
|
||||
<div align="center"><img src="images/phpmailer.gif" style="height: 90px; width: 340px"></div><br>
|
||||
<br>
|
||||
This is a test of PHPMailer v2.0.0 rc1.<br>
|
||||
<br>
|
||||
This particular example uses <strong>HTML</strong>, with a <div> tag and inline<br>
|
||||
styles.<br>
|
||||
<br>
|
||||
Also note the use of the PHPMailer at the top with no specific code to handle
|
||||
including it in the body of the email.</div>
|
||||
</body>
|
||||
73
modules/EcmDocuments/phpmailer/examples/index.html
Executable file
73
modules/EcmDocuments/phpmailer/examples/index.html
Executable file
@@ -0,0 +1,73 @@
|
||||
<p>The example file "test1.php" contents include:</p>
|
||||
<div style="width: 600px; background-color: #CCCCCC;">
|
||||
<code>
|
||||
<?php<br>
|
||||
<br>
|
||||
include_once('../class.phpmailer.php');<br>
|
||||
<br>
|
||||
$mail = new PHPMailer();<br>
|
||||
<br>
|
||||
$body = $mail->getFile('contents.html');<br>
|
||||
<br>
|
||||
$body = eregi_replace("[\]",'',$body);<br>
|
||||
$subject = eregi_replace("[\]",'',$subject);<br>
|
||||
<br>
|
||||
$mail->From = "name@yourdomain.com";<br>
|
||||
$mail->FromName = "First Last";<br>
|
||||
<br>
|
||||
$mail->Subject = "PHPMailer Test Subject";<br>
|
||||
<br>
|
||||
$mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test<br>
|
||||
<br>
|
||||
$mail->MsgHTML($body);<br>
|
||||
<br>
|
||||
$mail->AddAddress("whoto@otherdomain.com", "John Doe");<br>
|
||||
<br>
|
||||
if(!$mail->Send()) {<br>
|
||||
echo 'Failed to send mail';<br>
|
||||
} else {<br>
|
||||
echo 'Mail sent';<br>
|
||||
}<br>
|
||||
<br>
|
||||
?>
|
||||
</code>
|
||||
</div>
|
||||
<br>
|
||||
Although you could use full compabitility with PHPMailer 1.7.3, this example
|
||||
shows how to use the new features. If you view 'contents.html', you will note
|
||||
that there is a background image used in the <body tag as well as an image used
|
||||
with a regular <img tag. Here's what the HTML file looks like:<br>
|
||||
<br>
|
||||
<div style="width: 600px; background-color: #CCCCCC;">
|
||||
<code>
|
||||
<body background="images/bkgrnd.gif" style="margin: 0px;"><br>
|
||||
<div style="width: 640px; font-family: Arial, Helvetica, sans-serif; font-size: 11px;"><br>
|
||||
<div align="center"><img src="images/phpmailer.gif" style="height: 90px; width: 340px"></div><br><br>
|
||||
<br><br>
|
||||
This is a test of PHPMailer v2.0.0 rc1.<br><br>
|
||||
<br><br>
|
||||
This particular example uses <strong>HTML</strong>, with a <div> tag and inline<br><br>
|
||||
styles.<br><br>
|
||||
<br><br>
|
||||
Also note the use of the PHPMailer at the top with no specific code to handle<br>
|
||||
including it in the body of the email.</div><br>
|
||||
</body><br>
|
||||
</code>
|
||||
</div>
|
||||
<br>
|
||||
A few things to notice in the PHP script that generates the email:
|
||||
<ul>
|
||||
<li>the use of $mail->AltBody is completely optional. If not used, PHPMailer
|
||||
will use the HTML text with htmlentities().</li>
|
||||
<li>the background= and <img src= images were processed without any directives
|
||||
or methods from the PHP script</li>
|
||||
<li>there is no specific code to define the image type ... that is handled
|
||||
automatically by PHPMailer when it parses the images</li>
|
||||
<li>we are using a new class method '$mail->MsgHTML($body)' ... that is what will handle the parsing of the images and creating the AltBody text</li>
|
||||
</ul>
|
||||
<p>Of course, you can still use PHPMailer the same way you have in the past.
|
||||
That provides full compatibility with all existing scripts, while new scripts
|
||||
can take advantage of the new features.</p>
|
||||
<p>Modify test1.php now with your own email address and try it out.</p>
|
||||
To see what the email SHOULD look like in your HTML compatible email viewer: <a href="contents.html">click here</a><br>
|
||||
|
||||
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: ';
|
||||
?>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user