[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [7551] property: handle local company network path as
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [7551] property: handle local company network path as url |
Date: |
Fri, 02 Sep 2011 13:02:05 +0000 |
Revision: 7551
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=7551
Author: sigurdne
Date: 2011-09-02 13:02:05 +0000 (Fri, 02 Sep 2011)
Log Message:
-----------
property: handle local company network path as url
Modified Paths:
--------------
trunk/property/inc/class.sodocument.inc.php
trunk/property/inc/class.sogeneric.inc.php
trunk/property/inc/class.uidocument.inc.php
Modified: trunk/property/inc/class.sodocument.inc.php
===================================================================
--- trunk/property/inc/class.sodocument.inc.php 2011-09-02 09:01:16 UTC (rev
7550)
+++ trunk/property/inc/class.sodocument.inc.php 2011-09-02 13:02:05 UTC (rev
7551)
@@ -399,6 +399,11 @@
function add($document)
{
+ if(isset($document['link']) && $document['link'])
+ {
+ $document['link'] = str_replace('\\' , '/',
$document['link']);
+ }
+
while (is_array($document['location']) &&
list($input_name,$value) = each($document['location']))
{
if($value)
@@ -441,7 +446,7 @@
$values= array(
$this->db->db_addslashes($document['document_name']),
- $document['link'],
+ $this->db->db_addslashes($document['link']),
$document['title'],
'public',
$document['doc_type'],
@@ -486,6 +491,12 @@
function edit($document)
{
+
+ if(isset($document['link']) && $document['link'])
+ {
+ $document['link'] = str_replace('\\' , '/',
$document['link']);
+ }
+
$receipt = array();
$value_set=array();
if (isset($document['location']) &&
is_array($document['location']))
@@ -523,7 +534,7 @@
$old_doc_type = $this->db->f('category');
$old_coordinator = $this->db->f('coordinator');
$old_document_name = $this->db->f('document_name');
- $old_link = $this->db->f('link');
+ $old_link =
$this->db->f('link',true);
$old_location_code = $this->db->f('location_code');
$old_p_entity_id = $this->db->f('p_entity_id');
$old_p_cat_id = $this->db->f('p_cat_id');
@@ -560,9 +571,9 @@
$document['document_name'] =
$document['document_name_orig'];
}
- if($old_link !=$document['link'] )
+ if($old_link != $document['link'] )
{
-
$this->historylog->add('L',$document['document_id'],$document['link'],$old_link);
+
$this->historylog->add('L',$document['document_id'],$this->db->db_addslashes($document['link']),$old_link);
$alter_link=true;
}
@@ -598,7 +609,7 @@
}
$value_set['document_name'] =
$this->db->db_addslashes($document['document_name']);
- $value_set['link'] =
$document['link'];
+ $value_set['link'] =
$this->db->db_addslashes($document['link']);
$value_set['title'] =
$this->db->db_addslashes($document['title']);
$value_set['branch_id'] =
$document['branch_id'];
$value_set['status'] = $document['status'];
Modified: trunk/property/inc/class.sogeneric.inc.php
===================================================================
--- trunk/property/inc/class.sogeneric.inc.php 2011-09-02 09:01:16 UTC (rev
7550)
+++ trunk/property/inc/class.sogeneric.inc.php 2011-09-02 13:02:05 UTC (rev
7551)
@@ -2244,7 +2244,16 @@
{
unset($data['apply']);
}
+
+ // in case of backslash characters - as in
path-references
+ foreach($data as $_key => &$_value)
+ {
+ $_value = str_replace('\\' , '/', $_value);
+ }
+ unset($_key);
+ unset($_value);
+
foreach ( $this->location_info['fields'] as $field )
{
if (isset($field['filter']) && $field['filter'])
@@ -2351,6 +2360,7 @@
function edit($data,$values_attribute)
{
+
$receipt = array();
if (!isset($this->location_info['table']) || !$table =
$this->location_info['table'])
@@ -2359,6 +2369,14 @@
return $receipt;
}
+ // in case of backslash characters - as in
path-references
+ foreach($data as $_key => &$_value)
+ {
+ $_value = str_replace('\\' , '/', $_value);
+ }
+ unset($_key);
+ unset($_value);
+
$value_set = array();
if(isset($data['extra']))
Modified: trunk/property/inc/class.uidocument.inc.php
===================================================================
--- trunk/property/inc/class.uidocument.inc.php 2011-09-02 09:01:16 UTC (rev
7550)
+++ trunk/property/inc/class.uidocument.inc.php 2011-09-02 13:02:05 UTC (rev
7551)
@@ -763,6 +763,11 @@
{
if($document_entry['link'])
{
+ if(!preg_match('/^HTTP/i',
$document_entry['link']))
+ {
+ $document_entry['link']
= 'file:///' . str_replace(':','|',$document_entry['link']);
+ }
+
$link_view_file=$document_entry['link'];
$document_entry['document_name']='link';
unset($link_to_files);
@@ -788,8 +793,8 @@
if(isset($uicols['datatype'])
&& isset($uicols['datatype'][$k]) && $uicols['datatype'][$k]=='link' &&
$document_entry[$uicols['name'][$k]])
{
$datatable['rows']['row'][$j]['column'][$k]['format'] = 'link';
+
$datatable['rows']['row'][$j]['column'][$k]['link'] =
$link_view_file;
$datatable['rows']['row'][$j]['column'][$k]['value'] =
$document_entry[$uicols['name'][$k]];
-
$datatable['rows']['row'][$j]['column'][$k]['link'] =
$link_view_file;
$datatable['rows']['row'][$j]['column'][$k]['target'] = '_blank';
}
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [7551] property: handle local company network path as url,
Sigurd Nes <=