[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Phpgroupware-cvs] [19111] fix: indentation
From: |
Pascal Vilarem |
Subject: |
[Phpgroupware-cvs] [19111] fix: indentation |
Date: |
Tue, 21 Apr 2009 15:22:44 +0000 |
Revision: 19111
http://svn.sv.gnu.org/viewvc/?view=rev&root=phpgroupware&revision=19111
Author: maat
Date: 2009-04-21 15:22:43 +0000 (Tue, 21 Apr 2009)
Log Message:
-----------
fix: indentation
improve : print of error messages
Modified Paths:
--------------
modules/ged/trunk/inc/class.ged_ui.inc.php
Modified: modules/ged/trunk/inc/class.ged_ui.inc.php
===================================================================
--- modules/ged/trunk/inc/class.ged_ui.inc.php 2009-04-21 12:49:37 UTC (rev
19110)
+++ modules/ged/trunk/inc/class.ged_ui.inc.php 2009-04-21 15:22:43 UTC (rev
19111)
@@ -175,11 +175,13 @@
$this->t->set_var('file_field', 'file');
$this->t->set_var('referenceq_field', 'referenceq');
$this->t->set_var('description_field', 'description');
+ $this->t->set_var('descriptionv_field', 'descriptionv');
$this->t->set_var('lang_file', lang('file'));
$this->t->set_var('lang_folder', lang('folder'));
$this->t->set_var('description_label', 'description');
+ $this->t->set_var('descriptionv_label', 'description version');
$this->t->set_var('referenceq_label', 'Reference');
$this->t->set_var('lang_subfolders', lang('Sub folders'));
@@ -202,7 +204,9 @@
$this->t->set_var('major_field', 'major');
$this->t->set_var('minor_field','minor');
$this->t->set_var('draft_field','draft');
+ $this->t->set_var('lang_Required',lang('Required field'));
+
$this->t->set_var('project_name_field', 'project_name');
@@ -501,7 +505,7 @@
$this->t->set_var('imgdot',
$GLOBALS['phpgw']->common->image('ged', 'right_in'));
if ($element_info['element_id']==$focused_id)
- $this->t->set_var('label',
"<b>".$this->truncate($element_info['name'])."</b>");
+ $this->t->set_var('label',
"<b>".$this->truncate($element_info['name']));
else
$this->t->set_var('label',
$this->truncate($element_info['name']));
@@ -1141,7 +1145,14 @@
function add_file()
{
$parent_id=$this->get_var('parent_id',array('GET','POST'));
-
+ $errormessage='';
+ if(isset($GLOBALS['php_errormsg']))
+ {
+ if( strpos($GLOBALS['php_errormsg'], "exceeds the
limit"))
+ $errormessage="<p><b>".lang("error")." :
<br/>"." - ".lang("exceeds the limit of 8 MB")."</b></p>";
+ else
+ $errormessage ="<p><b>".lang("error")." : <br/>
- ".$GLOBALS['php_errormsg']."<br/>".lang("return the error to your ISIS
administrator")."</b></p>";
+ }
$link_data=null;
$link_data['menuaction']='ged.ged_ui.browse';
$link_data['focused_id']=$parent_id;
@@ -1162,6 +1173,7 @@
$minor=addslashes($this->get_var('minor',array('GET','POST')));
$draft=addslashes($this->get_var('draft',array('GET','POST')));
$description=addslashes($this->get_var('description',
array('GET', 'POST')));
+ $descriptionv=addslashes($this->get_var('descriptionv',
array('GET', 'POST')));
$doc_type=addslashes($this->get_var('document_type',
array('GET', 'POST')));
$validity_period=$this->get_var('validity_period', array('GET',
'POST'));
@@ -1172,31 +1184,51 @@
if ($add_file==lang('Add file'))
{
+ $file_added='false';
+ if( $name!='' && $_FILES['file']['name']!='')
+ {
+ $new_file['file_name']=$_FILES['file']['name'];
+ $new_file['file_size']=$_FILES['file']['size'];
+
$new_file['file_tmp_name']=$_FILES['file']['tmp_name'];
+
$new_file['file_mime_type']=$_FILES['file']['type'];
+ $new_file['parent_id']=$parent_id;
+ $new_file['name']=$name;
+ $new_file['reference']=$referenceq;
+ $new_file['major']=$major;
+ $new_file['minor']=$minor;
+ $new_file['draft']=$draft;
+ $new_file['description']=$description;
+ $new_file['descriptionv']=$descriptionv;
+ $new_file['doc_type']=$doc_type;
+ $new_file['validity_period']=$validity_period;
+
+
+
+ if($this->ged_dm->add_file($new_file)=='NOK')
+ $errormessage="<p><b>".lang("error")."
: <br/>"." - ".lang("upload failed")."</b></p>";
+ else
+ $file_added='done';
+ }
+ else
+ {
+ $errormessage="<p><b>".lang("error")." : <br/>";
+
+ if($name=='')
+ $errormessage=$errormessage." -
".lang("no name")."<br/>";
+ if($_FILES['file']['name']=='')
+ $errormessage=$errormessage." -
".lang("no file")."<br/>";
+ $errormessage=$errormessage."</b></p>";
+ }
+
+
- $new_file['file_name']=$_FILES['file']['name'];
- $new_file['file_size']=$_FILES['file']['size'];
- $new_file['file_tmp_name']=$_FILES['file']['tmp_name'];
- $new_file['file_mime_type']=$_FILES['file']['type'];
- $new_file['parent_id']=$parent_id;
- $new_file['name']=$name;
- $new_file['reference']=$referenceq;
- $new_file['major']=$major;
- $new_file['minor']=$minor;
- $new_file['draft']=$draft;
- $new_file['description']=$description;
- $new_file['doc_type']=$doc_type;
- $new_file['validity_period']=$validity_period;
-
- $this->ged_dm->add_file($new_file);
- $file_added='done';
-
if ($file_added=='done')
{
$GLOBALS['phpgw']->redirect_link('/index.php',
$link_data);
}
}
-
+ $this->t->set_var('errormessage',$errormessage);
$this->t->set_file(array('add_file_tpl'=>'add_file.tpl'));
$this->set_template_defaults();
@@ -1991,26 +2023,32 @@
$this->set_template_defaults();
$this->display_app_header();
+// $link_data=null;
+// $link_data['menuaction']='ged.ged_ui.search';
+// $link_data['kp3']=$GLOBALS['phpgw_info']['user']['kp3'];
+// $link_data['sessionid']=$GLOBALS['sessionid'];
+// $link_data['click_history']=$_GET['click_history'];
+// $search_url=$GLOBALS['phpgw_info']['server']['webserver_url'];
+//
+// $this->t->set_var('menuaction', $link_data['menuaction']);
+// $this->t->set_var('kp3', $link_data['kp3']);
+// $this->t->set_var('sessionid', $link_data['sessionid']);
+// $this->t->set_var('click_history', $link_data['click_history']);
+// $this->t->set_var('action_search', $search_url);
+
$link_data=null;
$link_data['menuaction']='ged.ged_ui.search';
- $link_data['kp3']=$GLOBALS['phpgw_info']['user']['kp3'];
- $link_data['sessionid']=$GLOBALS['sessionid'];
- $link_data['click_history']=$_GET['click_history'];
- $search_url=$GLOBALS['phpgw_info']['server']['webserver_url'];
+ $link_data['focused_id']=$result_query['element_id'];
+ $this->t->set_var('action_search',
$GLOBALS['phpgw']->link('/index.php', $link_data));
- $this->t->set_var('menuaction', $link_data['menuaction']);
- $this->t->set_var('kp3', $link_data['kp3']);
- $this->t->set_var('sessionid', $link_data['sessionid']);
- $this->t->set_var('click_history', $link_data['click_history']);
- $this->t->set_var('action_search', $search_url);
-
// Search
$results_query= $this->ged_dm->search($search_query);
$this->t->set_file(array('search_tpl'=>'search.tpl'));
$this->t->set_block('search_tpl', 'search_results_block',
'search_results_block_handle');
-
+ $this->t->set_var('nbresult',"");
+ $Cpt = 0;
// Set block
if ( $search == lang("Search") && $search_query != '' &&
is_array($results_query))
{
@@ -2034,11 +2072,23 @@
$this->t->set_var('search_link',
$GLOBALS['phpgw']->link('/index.php', $link_data));
$this->t->fp('search_results_block_handle',
'search_results_block', True);
-
+ ++$Cpt;
}
}
+ if($Cpt > 1)
+ {
+ $this->t->set_var('nbresult',$Cpt.lang(" matches
").date("H:i:s"));
+ }
+ elseif($Cpt == 1)
+ {
+ $this->t->set_var('nbresult',$Cpt.lang(" match
").date("H:i:s"));
+ }
+ elseif( $search == lang("Search"))
+ {
+ $this->t->set_var('nbresult',lang("No result
").date("H:i:s"));
+ }
// Display result
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Phpgroupware-cvs] [19111] fix: indentation,
Pascal Vilarem <=