525 lines
24 KiB
PHP
Executable File
525 lines
24 KiB
PHP
Executable File
<?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";
|
|
?>
|