[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [7018] Merge 6981:7017 from trunk
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [7018] Merge 6981:7017 from trunk |
Date: |
Thu, 17 Feb 2011 12:03:50 +0000 |
Revision: 7018
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=7018
Author: sigurdne
Date: 2011-02-17 12:03:48 +0000 (Thu, 17 Feb 2011)
Log Message:
-----------
Merge 6981:7017 from trunk
Modified Paths:
--------------
branches/Version-1_0-branch/admin/inc/class.menu.inc.php
branches/Version-1_0-branch/admin/templates/base/confirm_delete.xsl
branches/Version-1_0-branch/frontend/inc/class.uicontract.inc.php
branches/Version-1_0-branch/frontend/inc/class.uidelegates.inc.php
branches/Version-1_0-branch/frontend/inc/class.uifrontend.inc.php
branches/Version-1_0-branch/phpgwapi/inc/class.db.inc.php
branches/Version-1_0-branch/phpgwapi/inc/class.db_adodb.inc.php
branches/Version-1_0-branch/phpgwapi/inc/class.db_pdo.inc.php
branches/Version-1_0-branch/phpgwapi/inc/class.schema_proc_pgsql.inc.php
branches/Version-1_0-branch/phpgwapi/inc/class.vfs_shared.inc.php
branches/Version-1_0-branch/phpgwapi/inc/class.vfs_sql.inc.php
branches/Version-1_0-branch/phpgwapi/inc/class.xslttemplates.inc.php
branches/Version-1_0-branch/property/inc/class.uigeneric.inc.php
branches/Version-1_0-branch/rental/inc/class.uidelegate.inc.php
branches/Version-1_0-branch/rental/inc/class.uiparty.inc.php
branches/Version-1_0-branch/rental/inc/class.uiresultunit.inc.php
branches/Version-1_0-branch/rental/inc/plugins/fellesdata/party.edit.php
branches/Version-1_0-branch/rental/setup/phpgw_no.lang
Added Paths:
-----------
branches/Version-1_0-branch/bim/
Property Changed:
----------------
branches/Version-1_0-branch/
Property changes on: branches/Version-1_0-branch
___________________________________________________________________
Modified: svn:mergeinfo
-
/trunk:6439-6441,6443,6445-6447,6449-6464,6466-6468,6470-6474,6476-6477,6479-6480,6483-6488,6490-6491,6493-6494,6496-6501,6503-6504,6506,6508,6510-6511,6513,6515-6516,6518,6520-6524,6526-6528,6533-6534,6536-6541,6543-6565,6567,6569,6571-6576,6578,6580-6586,6588-6596,6598-6600,6602-6604,6606-6607,6609-6611,6613-6625,6629-6639,6641-6643,6645-6646,6648,6650-6654,6656-6659,6661-6663,6665-6666,6668-6669,6672-6673,6675,6677-6678,6680,6682-6686,6688-6717,6719,6721-6722,6724-6728,6730,6732-6734,6736-6739,6741,6743,6745-6746,6748-6756,6758-6762,6764,6766-6788,6790,6792-6798,6800-6814,6816-6819,6821-6822,6824-6826,6828-6837,6839,6841,6843-6849,6851,6853-6869,6871-6874,6876-6877,6879,6881,6883,6885-6886,6888-6893,6895-6897,6899-6901,6903,6905-6907,6909,6911-6929,6931-6936,6938-6947,6949,6951,6953,6955-6956,6958-6959,6961-6968,6970-6971,6973-6974,6976-6978,6980
+
/trunk:6439-6441,6443,6445-6447,6449-6464,6466-6468,6470-6474,6476-6477,6479-6480,6483-6488,6490-6491,6493-6494,6496-6501,6503-6504,6506,6508,6510-6511,6513,6515-6516,6518,6520-6524,6526-6528,6533-6534,6536-6541,6543-6565,6567,6569,6571-6576,6578,6580-6586,6588-6596,6598-6600,6602-6604,6606-6607,6609-6611,6613-6625,6629-6639,6641-6643,6645-6646,6648,6650-6654,6656-6659,6661-6663,6665-6666,6668-6669,6672-6673,6675,6677-6678,6680,6682-6686,6688-6717,6719,6721-6722,6724-6728,6730,6732-6734,6736-6739,6741,6743,6745-6746,6748-6756,6758-6762,6764,6766-6788,6790,6792-6798,6800-6814,6816-6819,6821-6822,6824-6826,6828-6837,6839,6841,6843-6849,6851,6853-6869,6871-6874,6876-6877,6879,6881,6883,6885-6886,6888-6893,6895-6897,6899-6901,6903,6905-6907,6909,6911-6929,6931-6936,6938-6947,6949,6951,6953,6955-6956,6958-6959,6961-6968,6970-6971,6973-6974,6976-6978,6980,6982-7017
Modified: branches/Version-1_0-branch/admin/inc/class.menu.inc.php
===================================================================
--- branches/Version-1_0-branch/admin/inc/class.menu.inc.php 2011-02-17
08:37:43 UTC (rev 7017)
+++ branches/Version-1_0-branch/admin/inc/class.menu.inc.php 2011-02-17
12:03:48 UTC (rev 7018)
@@ -96,6 +96,7 @@
);
}
+/*
if ( $GLOBALS['phpgw']->acl->check('run',
phpgwapi_acl::READ, 'admin'))
{
$menus['admin']['clear_user_cache'] = array
@@ -104,7 +105,7 @@
'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'admin.uiaccounts.clear_user_cache') )
);
}
-
+*/
if ( $GLOBALS['phpgw']->acl->check('run',
phpgwapi_acl::READ, 'admin'))
{
$menus['admin']['clear_cache'] = array
Modified: branches/Version-1_0-branch/admin/templates/base/confirm_delete.xsl
===================================================================
--- branches/Version-1_0-branch/admin/templates/base/confirm_delete.xsl
2011-02-17 08:37:43 UTC (rev 7017)
+++ branches/Version-1_0-branch/admin/templates/base/confirm_delete.xsl
2011-02-17 12:03:48 UTC (rev 7018)
@@ -34,14 +34,18 @@
</xsl:when>
</xsl:choose>
<input type="submit" name="cancel"
value="{lang_no}" title="{lang_no_statustext}"/>
-
<xsl:choose>
- <xsl:when test="show_done = ''">
+ <xsl:when test="show_done">
+ <xsl:choose>
+ <xsl:when
test="show_done = ''">
+ <input
type="submit" name="confirm" value="{lang_yes}" title="{lang_yes_statustext}"/>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
<input type="submit"
name="confirm" value="{lang_yes}" title="{lang_yes_statustext}"/>
- </xsl:when>
+ </xsl:otherwise>
</xsl:choose>
-
-
</form>
</div>
</xsl:template>
Modified: branches/Version-1_0-branch/frontend/inc/class.uicontract.inc.php
===================================================================
--- branches/Version-1_0-branch/frontend/inc/class.uicontract.inc.php
2011-02-17 08:37:43 UTC (rev 7017)
+++ branches/Version-1_0-branch/frontend/inc/class.uicontract.inc.php
2011-02-17 12:03:48 UTC (rev 7018)
@@ -55,32 +55,38 @@
{
$contract_id = phpgw::get_var('contract_id');
$contract_message = phpgw::get_var('contract_message');
-
- $user_data =
frontend_bofellesdata::get_instance()->get_user($GLOBALS['phpgw_info']['user']['account_lid']);
-
- if($user_data['email'])
- {
- if(isset($contract_message) &&
$contract_message != '')
+ $use_fellesdata =
$config->config_data['use_fellesdata'];
+ if($use_fellesdata){
+ $user_data =
frontend_bofellesdata::get_instance()->get_user($GLOBALS['phpgw_info']['user']['account_lid']);
+
+ if($user_data['email'])
{
- $from_address = $user_data['email'];
- $result =
frontend_borental::send_contract_message($contract_id, $contract_message,
$from_address);
- if($result)
+ if(isset($contract_message) &&
$contract_message != '')
{
- $msglog['message'] =
lang('message_sent');
+ $from_address =
$user_data['email'];
+ $result =
frontend_borental::send_contract_message($contract_id, $contract_message,
$from_address);
+ if($result)
+ {
+ $msglog['message'] =
lang('message_sent');
+ }
+ else
+ {
+ $msglog['error'] =
lang('message_not_sent');
+ }
}
else
{
- $msglog['error'] =
lang('message_not_sent');
+ $msglog['error'] =
lang('message_empty');
}
}
else
{
- $msglog['error'] =
lang('message_empty');
+ $msglog['error'] =
lang('user_not_in_fellesdata');
}
}
else
{
- $msglog['error'] =
lang('user_not_in_fellesdata');
+ $msglog['error'] =
lang('fellesdata_not_in_use');
}
}
Modified: branches/Version-1_0-branch/frontend/inc/class.uidelegates.inc.php
===================================================================
--- branches/Version-1_0-branch/frontend/inc/class.uidelegates.inc.php
2011-02-17 08:37:43 UTC (rev 7017)
+++ branches/Version-1_0-branch/frontend/inc/class.uidelegates.inc.php
2011-02-17 12:03:48 UTC (rev 7018)
@@ -18,7 +18,8 @@
public function index()
- {
+ {
+ $use_fellesdata =
$config->config_data['use_fellesdata'];
if(isset($_POST['search']))
{
$username = phpgw::get_var('username');
@@ -40,11 +41,14 @@
}
else
{
- $fellesdata_user =
frontend_bofellesdata::get_instance()->get_user($username);
- if($fellesdata_user)
- {
- $search =
$fellesdata_user;
- $msglog['message'][] =
array('msg' => lang('user_found_in_Fellesdata'));
+ if($use_fellesdata){
+ $fellesdata_user =
frontend_bofellesdata::get_instance()->get_user($username);
+
+ if($fellesdata_user)
+ {
+ $search =
$fellesdata_user;
+
$msglog['message'][] = array('msg' => lang('user_found_in_Fellesdata'));
+ }
}
else
{
@@ -56,33 +60,34 @@
else if(isset($_POST['add']))
{
$account_id = phpgw::get_var('account_id');
-
- $org_units =
frontend_bofellesdata::get_instance()->get_result_units($GLOBALS['phpgw_info']['user']['account_lid']);
-
- //Parameter to delegate access to only a single
organisational unit
- $org_unit_id =
$this->header_state['selected_org_unit'];
- $success = true;
-
- foreach($org_units as $org_unit)
- {
- if($org_unit_id == 'all' ||
$org_unit['ORG_UNIT_ID'] == $org_unit_id)
+ $success = false;
+ if($use_fellesdata){
+ $org_units =
frontend_bofellesdata::get_instance()->get_result_units($GLOBALS['phpgw_info']['user']['account_lid']);
+
+ //Parameter to delegate access to only
a single organisational unit
+ $org_unit_id =
$this->header_state['selected_org_unit'];
+ $success = true;
+
+ foreach($org_units as $org_unit)
{
- //$curr_success = true;
- $res =
$this->add_delegate($account_id,$org_unit['ORG_UNIT_ID'],$org_unit['ORG_NAME']);
- if($res)
+ if($org_unit_id == 'all' ||
$org_unit['ORG_UNIT_ID'] == $org_unit_id)
{
- //$mail_contents[] =
$res;
- $org_unit_names[] =
$org_unit['ORG_NAME'];
+ //$curr_success = true;
+ $res =
$this->add_delegate($account_id,$org_unit['ORG_UNIT_ID'],$org_unit['ORG_NAME']);
+ if($res)
+ {
+
//$mail_contents[] = $res;
+
$org_unit_names[] = $org_unit['ORG_NAME'];
+ }
+ else
+ {
+
$msglog['error'][] = array('msg' =>
lang('error_delegating_unit',$org_unit['ORG_NAME']));
+ }
+
+ $success = $success &&
$res;
}
- else
- {
- $msglog['error'][] =
array('msg' => lang('error_delegating_unit',$org_unit['ORG_NAME']));
- }
-
- $success = $success && $res;
}
}
-
if($success)
{
//Retrieve the usernames
@@ -199,6 +204,11 @@
public function add_delegate(int $account_id, $org_unit_id,
$org_name)
{
+ $use_fellesdata =
$config->config_data['use_fellesdata'];
+ if(!$use_fellesdata)
+ {
+ return;
+ }
if(!isset($account_id) || $account_id == '')
{
//User is only registered in Fellesdata
Modified: branches/Version-1_0-branch/frontend/inc/class.uifrontend.inc.php
===================================================================
--- branches/Version-1_0-branch/frontend/inc/class.uifrontend.inc.php
2011-02-17 08:37:43 UTC (rev 7017)
+++ branches/Version-1_0-branch/frontend/inc/class.uifrontend.inc.php
2011-02-17 12:03:48 UTC (rev 7018)
@@ -125,32 +125,33 @@
else if(isset($param_only_org_unit))
{
//TODO: check permissions
-
- $name_and_result_number =
frontend_bofellesdata::get_instance()->get_organisational_unit_info($param_only_org_unit);
-
- //Specify unit
- $org_unit_ids = array(
- array(
- "ORG_UNIT_ID" =>
$param_only_org_unit,
- "ORG_NAME" =>
$name_and_result_number['UNIT_NAME'],
- "UNIT_ID" =>
$name_and_result_number['UNIT_NUMBER']
- )
- );
-
- //Update header state
- $this->header_state['org_unit'] = $org_unit_ids;
- $this->header_state['number_of_org_units'] =
'1';
- //$this->header_state['selected_org_unit'] =
$name_and_result_number['UNIT_NUMBER'];
- $this->header_state['selected_org_unit'] =
$param_only_org_unit;
-
- //Update locations
- $property_locations =
frontend_borental::get_property_locations($org_unit_ids);
- $property_locations_update = true;
-
- $noframework = false; // In regular frames
- phpgwapi_cache::session_set('frontend',
'noframework', $noframework); // Store mode on session
-
$GLOBALS['phpgw_info']['flags']['menu_selection'] = "frontend::{$selected}";
- $this->insert_links_on_header_state();
+ if($use_fellesdata){
+ $name_and_result_number =
frontend_bofellesdata::get_instance()->get_organisational_unit_info($param_only_org_unit);
+
+ //Specify unit
+ $org_unit_ids = array(
+ array(
+ "ORG_UNIT_ID" =>
$param_only_org_unit,
+ "ORG_NAME" =>
$name_and_result_number['UNIT_NAME'],
+ "UNIT_ID" =>
$name_and_result_number['UNIT_NUMBER']
+ )
+ );
+
+ //Update header state
+ $this->header_state['org_unit'] =
$org_unit_ids;
+
$this->header_state['number_of_org_units'] = '1';
+
//$this->header_state['selected_org_unit'] =
$name_and_result_number['UNIT_NUMBER'];
+
$this->header_state['selected_org_unit'] = $param_only_org_unit;
+
+ //Update locations
+ $property_locations =
frontend_borental::get_property_locations($org_unit_ids);
+ $property_locations_update = true;
+
+ $noframework = false; // In regular
frames
+ phpgwapi_cache::session_set('frontend',
'noframework', $noframework); // Store mode on session
+
$GLOBALS['phpgw_info']['flags']['menu_selection'] = "frontend::{$selected}";
+ $this->insert_links_on_header_state();
+ }
}
/* No state, first visit after login, or refresh
request*/
else if(!isset($this->header_state) || isset($refresh)
|| !isset($this->header_state['locations']))
Modified: branches/Version-1_0-branch/phpgwapi/inc/class.db.inc.php
===================================================================
--- branches/Version-1_0-branch/phpgwapi/inc/class.db.inc.php 2011-02-17
08:37:43 UTC (rev 7017)
+++ branches/Version-1_0-branch/phpgwapi/inc/class.db.inc.php 2011-02-17
12:03:48 UTC (rev 7018)
@@ -93,6 +93,10 @@
*/
var $Halt_On_Error = 'yes'; // should be true or false
+ /*
+ * @var boolean $Exception_On_Error should SQL throw exception
on error ?
+ */
+ var $Exception_On_Error = false;
/**
* @var bool $auto_stripslashes automagically remove slashes
from field values returned?
*/
Modified: branches/Version-1_0-branch/phpgwapi/inc/class.db_adodb.inc.php
===================================================================
--- branches/Version-1_0-branch/phpgwapi/inc/class.db_adodb.inc.php
2011-02-17 08:37:43 UTC (rev 7017)
+++ branches/Version-1_0-branch/phpgwapi/inc/class.db_adodb.inc.php
2011-02-17 12:03:48 UTC (rev 7018)
@@ -245,6 +245,10 @@
$this->transaction_abort();
exit;
}
+ else if($this->Exception_On_Error)
+ {
+ throw $e;
+ }
}
$this->delayPointer = true;
@@ -293,6 +297,10 @@
$this->transaction_abort();
exit;
}
+ else if($this->Exception_On_Error)
+ {
+ throw $e;
+ }
}
$this->delayPointer = true;
Modified: branches/Version-1_0-branch/phpgwapi/inc/class.db_pdo.inc.php
===================================================================
--- branches/Version-1_0-branch/phpgwapi/inc/class.db_pdo.inc.php
2011-02-17 08:37:43 UTC (rev 7017)
+++ branches/Version-1_0-branch/phpgwapi/inc/class.db_pdo.inc.php
2011-02-17 12:03:48 UTC (rev 7018)
@@ -371,8 +371,11 @@
$this->transaction_abort();
exit;
}
+ else if($this->Exception_On_Error)
+ {
+ throw $e;
+ }
}
-
$this->delayPointer = true;
return true;
}
@@ -453,6 +456,10 @@
$this->transaction_abort();
exit;
}
+ else if($this->Exception_On_Error)
+ {
+ throw $e;
+ }
}
$this->delayPointer = true;
Modified:
branches/Version-1_0-branch/phpgwapi/inc/class.schema_proc_pgsql.inc.php
===================================================================
--- branches/Version-1_0-branch/phpgwapi/inc/class.schema_proc_pgsql.inc.php
2011-02-17 08:37:43 UTC (rev 7017)
+++ branches/Version-1_0-branch/phpgwapi/inc/class.schema_proc_pgsql.inc.php
2011-02-17 12:03:48 UTC (rev 7018)
@@ -103,6 +103,9 @@
case 'bool':
$sTranslated = 'boolean';
break;
+ case 'xml':
+ $sTranslated = 'xml';
+ break;
}
return $sTranslated;
}
Modified: branches/Version-1_0-branch/phpgwapi/inc/class.vfs_shared.inc.php
===================================================================
--- branches/Version-1_0-branch/phpgwapi/inc/class.vfs_shared.inc.php
2011-02-17 08:37:43 UTC (rev 7017)
+++ branches/Version-1_0-branch/phpgwapi/inc/class.vfs_shared.inc.php
2011-02-17 12:03:48 UTC (rev 7018)
@@ -214,6 +214,10 @@
{
$this->basedir =
$GLOBALS['phpgw_info']['server']['files_dir'];
$this->working_id =
$GLOBALS['phpgw_info']['user']['account_id'];
+ if(empty($this->working_id))
+ {
+ throw new Exception("VFS error! Missing user
id!");
+ }
$this->working_lid =
$GLOBALS['phpgw_info']['user']['account_lid'];
$this->now = date ('Y-m-d');
/* These are stored in the MIME-type field and should
normally
Modified: branches/Version-1_0-branch/phpgwapi/inc/class.vfs_sql.inc.php
===================================================================
--- branches/Version-1_0-branch/phpgwapi/inc/class.vfs_sql.inc.php
2011-02-17 08:37:43 UTC (rev 7017)
+++ branches/Version-1_0-branch/phpgwapi/inc/class.vfs_sql.inc.php
2011-02-17 12:03:48 UTC (rev 7018)
@@ -1334,7 +1334,269 @@
return True;
}
+ /*
+ * Same as cp function, except an exception is thrown if there
is a failure
+ * errors have also been expanded
+ */
+ function cp2 ($data)
+ {
+ if (!is_array ($data))
+ {
+ $data = array ();
+ }
+ $default_values = array
+ (
+ 'relatives' => array
(RELATIVE_CURRENT, RELATIVE_CURRENT)
+ );
+
+ $data = array_merge ($this->default_values ($data,
$default_values), $data);
+
+ $account_id =
$GLOBALS['phpgw_info']['user']['account_id'];
+
+ $f = $this->path_parts (array(
+ 'string' => $data['from'],
+ 'relatives' => array
($data['relatives'][0])
+ )
+ );
+
+ $t = $this->path_parts (array(
+ 'string' => $data['to'],
+ 'relatives' => array
($data['relatives'][1])
+ )
+ );
+
+ if (!$this->acl_check (array(
+ 'string' => $f->fake_full_path,
+ 'relatives' => array ($f->mask),
+ 'operation' => PHPGW_ACL_READ
+ ))
+ )
+ {
+ throw new Exception('ACL (READ) check failed!');
+ }
+
+ if ($this->file_exists (array(
+ 'string' => $t->fake_full_path,
+ 'relatives' => array ($t->mask)
+ ))
+ )
+ {
+ if (!$this->acl_check (array(
+ 'string' =>
$t->fake_full_path,
+ 'relatives' => array
($t->mask),
+ 'operation' =>
PHPGW_ACL_EDIT
+ ))
+ )
+ {
+ throw new Exception('ACL (EDII) check
failed!');
+ }
+ }
+ else
+ {
+ if (!$this->acl_check (array(
+ 'string' =>
$t->fake_full_path,
+ 'relatives' => array
($t->mask),
+ 'operation' => PHPGW_ACL_ADD
+ ))
+ )
+ {
+ throw new Exception('ACL (ADD) check
failed!');
+ }
+
+ }
+
+ umask(000);
+
+ if ($this->file_type (array(
+ 'string' => $f->fake_full_path,
+ 'relatives' => array ($f->mask)
+ )) != 'Directory'
+ )
+ {
+ if ($this->file_actions)
+ {
+ if (!copy ($f->real_full_path,
$t->real_full_path))
+ {
+ $error = "Copy failed!\n";
+ $error = $error.
"f->real_full_path: $f->real_full_path \n";
+ $error = $error.
"t->real_full_path: $t->real_full_path \n";
+ throw new Exception($error);
+ }
+
+ $size = filesize ($t->real_full_path);
+ }
+ else
+ {
+ $content = $this->read (array(
+ 'string' =>
$f->fake_full_path,
+ 'relatives' =>
array ($f->mask)
+ )
+ );
+
+ $size = strlen ($content);
+ }
+
+ if ($t->outside)
+ {
+ return True;
+ }
+
+ $ls_array = $this->ls (array(
+ 'string' =>
$f->real_full_path, // Sigurd: seems to work better with real - old: 'string'
=> $f->fake_full_path,
+ 'relatives' => array
($f->mask),
+ 'checksubdirs' => False,
+ 'mime_type' => False,
+ 'nofiles' => True
+ )
+ );
+ $record = $ls_array[0];
+
+ if ($this->file_exists (array(
+ 'string' => $data['to'],
+ 'relatives' => array
($data['relatives'][1])
+ ))
+ )
+ {
+ $query = $GLOBALS['phpgw']->db->query
("UPDATE phpgw_vfs SET owner_id='$this->working_id',
directory='$t->fake_leading_dirs_clean', name='$t->fake_name_clean' WHERE
owner_id='$this->working_id' AND directory='$t->fake_leading_dirs_clean' AND
name='$t->fake_name_clean'" . $this->extra_sql (VFS_SQL_UPDATE), __LINE__,
__FILE__);
+
+ $set_attributes_array = array (
+ 'createdby_id' => $account_id,
+ 'created' => $this->now,
+ 'size' => $size,
+ 'mime_type' =>
$record['mime_type'],
+ 'deleteable' =>
$record['deleteable'],
+ 'comment' => $record['comment'],
+ 'app' => $record['app']
+ );
+
+ if (!$this->file_actions)
+ {
+
$set_attributes_array['content'] = $content;
+ }
+
+ $this->set_attributes(array(
+ 'string' =>
$t->fake_full_path,
+ 'relatives' => array
($t->mask),
+ 'attributes' =>
$set_attributes_array
+ )
+ );
+
+ $this->add_journal (array(
+ 'string' =>
$t->fake_full_path,
+ 'relatives' =>
array ($t->mask),
+ 'operation' =>
VFS_OPERATION_EDITED
+ )
+ );
+ }
+ else
+ {
+ $this->touch (array(
+ 'string' =>
$t->fake_full_path,
+ 'relatives' =>
array ($t->mask)
+ )
+ );
+
+ $set_attributes_array = array (
+ 'createdby_id' => $account_id,
+ 'created' => $this->now,
+ 'size' => $size,
+ 'mime_type' =>
$record['mime_type'],
+ 'deleteable' =>
$record['deleteable'],
+ 'comment' => $record['comment'],
+ 'app' => $record['app']
+ );
+
+ if (!$this->file_actions)
+ {
+
$set_attributes_array['content'] = $content;
+ }
+
+ $this->set_attributes(array(
+ 'string' =>
$t->fake_full_path,
+ 'relatives' =>
array ($t->mask),
+ 'attributes' =>
$set_attributes_array
+ )
+ );
+ }
+ $this->correct_attributes (array(
+ 'string' =>
$t->fake_full_path,
+ 'relatives' => array
($t->mask)
+ )
+ );
+ }
+ else /* It's a directory */
+ {
+ /* First, make the initial directory */
+ if ($this->mkdir (array(
+ 'string' => $data['to'],
+ 'relatives' => array
($data['relatives'][1])
+ )) === False
+ )
+ {
+ throw new Exception('Error, it is a
directory');
+ }
+
+ /* Next, we create all the directories below
the initial directory */
+ $ls = $this->ls (array(
+ 'string' =>
$f->fake_full_path,
+ 'relatives' => array
($f->mask),
+ 'checksubdirs' => True,
+ 'mime_type' => 'Directory'
+ )
+ );
+
+ while (list ($num, $entry) = each ($ls))
+ {
+ $newdir = ereg_replace
("^$f->fake_full_path", "$t->fake_full_path", $entry['directory']);
+ if ($this->mkdir (array(
+ 'string' =>
$newdir.'/'.$entry['name'],
+ 'relatives' =>
array ($t->mask)
+ )) === False
+ )
+ {
+ throw new Exception('While loop
error!');
+ }
+ }
+
+ /* Lastly, we copy the files over */
+ $ls = $this->ls (array(
+ 'string' =>
$f->fake_full_path,
+ 'relatives' => array
($f->mask)
+ )
+ );
+
+ while (list ($num, $entry) = each ($ls))
+ {
+ if ($entry['mime_type'] == 'Directory')
+ {
+ continue;
+ }
+
+ $newdir = ereg_replace
("^$f->fake_full_path", "$t->fake_full_path", $entry['directory']);
+ $this->cp (array(
+ 'from' =>
"$entry[directory]/$entry[name]",
+ 'to' =>
"$newdir/$entry[name]",
+ 'relatives' =>
array ($f->mask, $t->mask)
+ )
+ );
+ }
+ }
+
+ if (!$f->outside)
+ {
+ $this->add_journal (array(
+ 'string' =>
$f->fake_full_path,
+ 'relatives' => array
($f->mask),
+ 'operation' =>
VFS_OPERATION_COPIED,
+ 'state_one' => NULL,
+ 'state_two' =>
$t->fake_full_path
+ )
+ );
+ }
+
+ return True;
+ }
/*
* See vfs_shared
*/
Modified: branches/Version-1_0-branch/phpgwapi/inc/class.xslttemplates.inc.php
===================================================================
--- branches/Version-1_0-branch/phpgwapi/inc/class.xslttemplates.inc.php
2011-02-17 08:37:43 UTC (rev 7017)
+++ branches/Version-1_0-branch/phpgwapi/inc/class.xslttemplates.inc.php
2011-02-17 12:03:48 UTC (rev 7018)
@@ -222,6 +222,11 @@
}
}
+ function set_xml_data($xml)
+ {
+ $this->xmldata = $xml;
+ }
+
function get_var($name)
{
return $this->vars[$name];
@@ -294,20 +299,21 @@
function xml_parse()
{
- $this->xmldata = '';
-
- $xmldata = $this->vars;
-
- /* auto generate xml based on vars */
- foreach ( $this->xmlvars as $key => $value )
+ if(strlen($this->xmldata)== 0)
{
- $xmldata[$key] = $value;
+ $xmldata = $this->vars;
+
+ /* auto generate xml based on vars */
+ foreach ( $this->xmlvars as $key => $value )
+ {
+ $xmldata[$key] = $value;
+ }
+
+ // $this->xmldata = var2xml('PHPGW', $xmldata);
+ // use simplexml - it's faster.
+ $this->xmldata =
phpgwapi_xmlhelper::toXML($xmldata, 'PHPGW');
}
- // $this->xmldata = var2xml('PHPGW', $xmldata);
- //use simplexml - it's faster.
- $this->xmldata = phpgwapi_xmlhelper::toXML($xmldata,
'PHPGW');
-
$debug = false;
// $debug = true;
if ($debug)
Modified: branches/Version-1_0-branch/property/inc/class.uigeneric.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.uigeneric.inc.php
2011-02-17 08:37:43 UTC (rev 7017)
+++ branches/Version-1_0-branch/property/inc/class.uigeneric.inc.php
2011-02-17 12:03:48 UTC (rev 7018)
@@ -583,15 +583,22 @@
if (is_array($values))
{
- $insert_record_values =
$GLOBALS['phpgw']->session->appsession("insert_record_values{$this->acl_location}",$this->location_info['acl_app']);
+ $insert_record_attributes =
$GLOBALS['phpgw']->session->appsession("insert_record_values{$this->acl_location}",$this->location_info['acl_app']);
- if(is_array($insert_record_values))
+ if(is_array($insert_record_attributes))
{
- foreach($insert_record_values as $field)
+ foreach ($insert_record_attributes as
$attribute)
{
-// $values['extra'][$field] =
phpgw::get_var($field);
+ foreach ($values_attribute as
&$attr)
+ {
+ if($attr['name'] ==
$attribute)
+ {
+ $attr['value']
= phpgw::get_var($attribute, 'string', 'POST');
+ }
+ }
}
}
+
// $values =
$this->bocommon->collect_locationdata($values,$insert_record_values);
if ((isset($values['save']) && $values['save'])
|| (isset($values['apply']) && $values['apply']))
{
Modified: branches/Version-1_0-branch/rental/inc/class.uidelegate.inc.php
===================================================================
--- branches/Version-1_0-branch/rental/inc/class.uidelegate.inc.php
2011-02-17 08:37:43 UTC (rev 7017)
+++ branches/Version-1_0-branch/rental/inc/class.uidelegate.inc.php
2011-02-17 12:03:48 UTC (rev 7018)
@@ -49,8 +49,9 @@
}
public function add_actions(&$value, $key, $params)
- {
- if(($this->isExecutiveOfficer() ||
$this->isAdministrator()))
+ {
+ $use_fellesdata =
$config->config_data['use_fellesdata'];
+ if(($this->isExecutiveOfficer() ||
$this->isAdministrator()) && $use_fellesdata)
{
$unit_id = $params[0];
Modified: branches/Version-1_0-branch/rental/inc/class.uiparty.inc.php
===================================================================
--- branches/Version-1_0-branch/rental/inc/class.uiparty.inc.php
2011-02-17 08:37:43 UTC (rev 7017)
+++ branches/Version-1_0-branch/rental/inc/class.uiparty.inc.php
2011-02-17 12:03:48 UTC (rev 7018)
@@ -76,6 +76,7 @@
//Retrieve the type of query and perform type specific logic
$type = phpgw::get_var('type');
+ $use_fellesdata = $config->config_data['use_fellesdata'];
switch($type)
{
case 'included_parties': // ... get all parties
incolved in the contract
@@ -89,7 +90,10 @@
case 'sync_parties_identifier':
case 'sync_parties_org_unit':
$filters = array('sync' => $type, 'party_type'
=> phpgw::get_var('party_type'), 'active' => phpgw::get_var('active'));
- $bofelles = rental_bofellesdata::get_instance();
+ if($use_fellesdata)
+ {
+ $bofelles =
rental_bofellesdata::get_instance();
+ }
break;
default: // ... get all parties of a given type
phpgwapi_cache::session_set('rental',
'party_query', $search_for);
@@ -103,39 +107,42 @@
$result_objects =
rental_soparty::get_instance()->get($start_index, $num_of_objects, $sort_field,
$sort_ascending, $search_for, $search_type, $filters);
$result_count =
rental_soparty::get_instance()->get_count($search_for, $search_type, $filters);
+
// Create an empty row set
$rows = array();
foreach ($result_objects as $party) {
if(isset($party))
{
$serialized = $party->serialize($contract);
- $sync_data = $party->get_sync_data();
- if($type == 'sync_parties')
- {
- $unit_name_and_id =
$bofelles->responsibility_id_exist($sync_data['responsibility_id']);
- }
- else if($type == 'sync_parties_res_unit')
- {
- $unit_name_and_id =
$bofelles->result_unit_exist($sync_data['result_unit_number']);
- }
- else if($type == 'sync_parties_identifier')
- {
- $unit_name_and_id =
$bofelles->result_unit_exist($party->get_identifier());
- }
- else if($type == 'sync_parties_org_unit')
- {
- $unit_name_and_id =
$bofelles->org_unit_exist($sync_data['org_enhet_id']);
- }
-
- if(isset($unit_name_and_id))
- {
- $unit_id = $unit_name_and_id['UNIT_ID'];
- $unit_name =
$unit_name_and_id['UNIT_NAME'];
- if(isset($unit_id) &&
is_numeric($unit_id))
+ if($use_fellesdata){
+ $sync_data = $party->get_sync_data();
+ if($type == 'sync_parties')
{
- $serialized['org_unit_name'] =
isset($unit_name) ? $unit_name : lang('no_name');
- $serialized['org_unit_id'] =
$unit_id;
+ $unit_name_and_id =
$bofelles->responsibility_id_exist($sync_data['responsibility_id']);
}
+ else if($type ==
'sync_parties_res_unit')
+ {
+ $unit_name_and_id =
$bofelles->result_unit_exist($sync_data['result_unit_number']);
+ }
+ else if($type ==
'sync_parties_identifier')
+ {
+ $unit_name_and_id =
$bofelles->result_unit_exist($party->get_identifier());
+ }
+ else if($type ==
'sync_parties_org_unit')
+ {
+ $unit_name_and_id =
$bofelles->org_unit_exist($sync_data['org_enhet_id']);
+ }
+
+ if(isset($unit_name_and_id))
+ {
+ $unit_id =
$unit_name_and_id['UNIT_ID'];
+ $unit_name =
$unit_name_and_id['UNIT_NAME'];
+ if(isset($unit_id) &&
is_numeric($unit_id))
+ {
+
$serialized['org_unit_name'] = isset($unit_name) ? $unit_name :
lang('no_name');
+
$serialized['org_unit_id'] = $unit_id;
+ }
+ }
}
$rows[] = $serialized;
}
@@ -171,6 +178,10 @@
*/
public function update_all_org_enhet_id()
{
+ $use_fellesdata = $config->config_data['use_fellesdata'];
+ if(!$use_fellesdata){
+ return;
+ }
$bofelles = rental_bofellesdata::get_instance();
$parties = rental_soparty::get_instance()->get();
Modified: branches/Version-1_0-branch/rental/inc/class.uiresultunit.inc.php
===================================================================
--- branches/Version-1_0-branch/rental/inc/class.uiresultunit.inc.php
2011-02-17 08:37:43 UTC (rev 7017)
+++ branches/Version-1_0-branch/rental/inc/class.uiresultunit.inc.php
2011-02-17 12:03:48 UTC (rev 7018)
@@ -24,6 +24,7 @@
public function query()
{
+ $use_fellesdata =
$config->config_data['use_fellesdata'];
if($GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'] > 0)
{
$user_rows_per_page =
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];
@@ -93,10 +94,11 @@
public function edit(){
$GLOBALS['phpgw_info']['flags']['app_header'] .=
'::'.lang('edit');
+ $use_fellesdata =
$config->config_data['use_fellesdata'];
$unit_id = (int)phpgw::get_var('id');
- if (isset($unit_id) && $unit_id > 0) {
+ if (isset($unit_id) && $unit_id > 0 && $use_fellesdata)
{
$msglog['error']['msg'] =
phpgw::get_var('error');
$msglog['message']['msg'] =
phpgw::get_var('message');
@@ -172,7 +174,8 @@
public function add_delegate(int $account_id, $org_unit_id,
$org_name)
{
- if(!isset($account_id) || $account_id == '')
+ $use_fellesdata =
$config->config_data['use_fellesdata'];
+ if(!isset($account_id) || $account_id == '' &&
$use_fellesdata)
{
//User is only registered in Fellesdata
$username = phpgw::get_var('username');
@@ -199,7 +202,7 @@
$org_name_string = $org_name;
//If the usernames are set retrieve account
data from Fellesdata
- if(isset($user_name) && $user_name != '' &&
$owner_name && $owner_name != '')
+ if(isset($user_name) && $user_name != '' &&
$owner_name && $owner_name != '' && $use_fellesdata)
{
$fellesdata_user =
frontend_bofellesdata::get_instance()->get_user($user_name);
$fellesdata_owner =
frontend_bofellesdata::get_instance()->get_user($owner_name);
Modified:
branches/Version-1_0-branch/rental/inc/plugins/fellesdata/party.edit.php
===================================================================
--- branches/Version-1_0-branch/rental/inc/plugins/fellesdata/party.edit.php
2011-02-17 08:37:43 UTC (rev 7017)
+++ branches/Version-1_0-branch/rental/inc/plugins/fellesdata/party.edit.php
2011-02-17 12:03:48 UTC (rev 7018)
@@ -9,6 +9,7 @@
<select name="org_enhet_id">
<option value=""><?php echo
lang('no_party_location') ?></option>
<?php
+
$result_units =
rental_bofellesdata::get_instance()->get_result_units();
$party_org_enhet_id = $party->get_org_enhet_id();
foreach ($result_units as $result_unit)
Modified: branches/Version-1_0-branch/rental/setup/phpgw_no.lang
===================================================================
--- branches/Version-1_0-branch/rental/setup/phpgw_no.lang 2011-02-17
08:37:43 UTC (rev 7017)
+++ branches/Version-1_0-branch/rental/setup/phpgw_no.lang 2011-02-17
12:03:48 UTC (rev 7018)
@@ -213,6 +213,7 @@
facilit_import rental no Import fra Facilit
failed_removing_delegate rental no Det oppstod en feil under
sletting av delegaten.
fax rental no Faks
+fellesdata_not_in_use rental no Fellesdata er ikke i bruk
field_of_responsibility rental no Ansvarsområde
filters rental no Filtre
Finish rental no Avslutt
@@ -555,6 +556,7 @@
unable_to_connect_to_database rental no Problemer med å koble til
databasen.
unknown_user rental no Personen finnes ikke.
user_found_in_Fellesdata rental no Personen finnes i Fellesdata.
+user_not_in_fellesdata rental no Personen finnes ikke i Fellesdata.
user_found_in_PE rental no Personen er bruker av dette systemet.
warning_billing_date_between rental no Fakturastart må være innenfor
kontraktens datoer!
warning_due_date_between rental no Opsjonsfrist må være innenfor
kontraktens datoer!
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [7018] Merge 6981:7017 from trunk,
Sigurd Nes <=