[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [12603] Syncromind: Merge 12529:12602 from trunk
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [12603] Syncromind: Merge 12529:12602 from trunk |
Date: |
Thu, 15 Jan 2015 12:06:56 +0000 |
Revision: 12603
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=12603
Author: sigurdne
Date: 2015-01-15 12:06:55 +0000 (Thu, 15 Jan 2015)
Log Message:
-----------
Syncromind: Merge 12529:12602 from trunk
Modified Paths:
--------------
branches/dev-syncromind/admin/templates/base/custom.xsl
branches/dev-syncromind/phpgwapi/inc/class.categories.inc.php
branches/dev-syncromind/property/inc/class.bocommon.inc.php
branches/dev-syncromind/property/inc/class.boproject.inc.php
branches/dev-syncromind/property/inc/class.boworkorder.inc.php
branches/dev-syncromind/property/inc/class.uiimport.inc.php
branches/dev-syncromind/property/inc/class.uiproject.inc.php
branches/dev-syncromind/property/inc/class.uiworkorder.inc.php
branches/dev-syncromind/property/inc/hook_settings.inc.php
branches/dev-syncromind/property/templates/base/cat_sub_select.xsl
branches/dev-syncromind/property/templates/base/user_id_filter.xsl
branches/dev-syncromind/property/templates/base/user_id_select.xsl
branches/dev-syncromind/rental/inc/hook_config.inc.php
branches/dev-syncromind/rental/templates/base/config.tpl
branches/dev-syncromind/rental/templates/base/contract_list.php
Property Changed:
----------------
branches/dev-syncromind/
Property changes on: branches/dev-syncromind
___________________________________________________________________
Modified: svn:mergeinfo
-
/trunk:12111-12211,12213-12246,12250-12363,12366-12405,12407-12435,12437-12462,12464-12527
+
/trunk:12111-12211,12213-12246,12250-12363,12366-12405,12407-12435,12437-12462,12464-12527,12530-12602
Modified: branches/dev-syncromind/admin/templates/base/custom.xsl
===================================================================
--- branches/dev-syncromind/admin/templates/base/custom.xsl 2015-01-15
09:13:41 UTC (rev 12602)
+++ branches/dev-syncromind/admin/templates/base/custom.xsl 2015-01-15
12:06:55 UTC (rev 12603)
@@ -180,6 +180,11 @@
<xsl:template match="edit_attrib" xmlns:php="http://php.net/xsl">
<div align="left">
+
+ <xsl:variable name="form_action">
+ <xsl:value-of select="form_action"/>
+ </xsl:variable>
+ <form method="post" action="{$form_action}">
<table cellpadding="2" cellspacing="2" width="80%"
align="center">
<xsl:choose>
@@ -192,8 +197,6 @@
</xsl:when>
</xsl:choose>
- <xsl:variable name="form_action"><xsl:value-of
select="form_action"/></xsl:variable>
- <form method="post" action="{$form_action}">
<tr>
<td class="th_text" align="left">
@@ -475,8 +478,9 @@
</input>
</td>
</tr>
-
+ </table>
</form>
+ <table>
<tr>
<td>
<xsl:variable
name="done_action"><xsl:value-of select="done_action"/></xsl:variable>
Modified: branches/dev-syncromind/phpgwapi/inc/class.categories.inc.php
===================================================================
--- branches/dev-syncromind/phpgwapi/inc/class.categories.inc.php
2015-01-15 09:13:41 UTC (rev 12602)
+++ branches/dev-syncromind/phpgwapi/inc/class.categories.inc.php
2015-01-15 12:06:55 UTC (rev 12603)
@@ -691,6 +691,10 @@
$cat_list = array();
while (is_array($cats) && list(,$cat) = each($cats))
{
+ if($cat['active'] == 2 &&
!in_array($cat['id'],$selected))//hidden
+ {
+ continue;
+ }
$sel_cat = '';
if (in_array($cat['id'],$selected))
{
Modified: branches/dev-syncromind/property/inc/class.bocommon.inc.php
===================================================================
--- branches/dev-syncromind/property/inc/class.bocommon.inc.php 2015-01-15
09:13:41 UTC (rev 12602)
+++ branches/dev-syncromind/property/inc/class.bocommon.inc.php 2015-01-15
12:06:55 UTC (rev 12603)
@@ -388,6 +388,7 @@
}
$user_list = array();
+ $selected_found = false;
foreach ($users as $user)
{
@@ -410,6 +411,12 @@
'lastname'
=> $user['account_lastname'],
);
}
+
+ if(!$selected_found)
+ {
+ $selected_found = $user['account_lid']
== $selected ? true : false;
+ }
+
}
foreach ($user_list as &$user)
@@ -417,7 +424,25 @@
$user['id'] = $user['lid'];
$user['name'] = ltrim("{$user['lastname']},
{$user['firstname']}",', ');
}
+ unset($user);
+ if($selected && !$selected_found)
+ {
+ $user_id =
$GLOBALS['phpgw']->accounts->name2id($selected);
+
+ $_user =
$GLOBALS['phpgw']->accounts->get($user_id);
+
+ $user_list[] = array
+ (
+ 'lid' => $_user->lid,
+ 'firstname' => $_user->firstname,
+ 'lastname' => $_user->lastname,
+ 'id' => $selected,
+ 'name' => $_user->__toString(),
+ 'selected' => 'selected'
+ );
+ }
+
return $user_list;
}
@@ -478,30 +503,33 @@
$user_list = array();
- while (is_array($users) && list(,$user) = each($users))
+ $selected_found = false;
+ foreach ($users as $user)
{
$name =
(isset($user['account_lastname'])?$user['account_lastname'].'
':'').$user['account_firstname'];
- if ($user['account_id']==$selected)
+ $user_list[] = array
+ (
+ 'id' => $user['account_id'],
+ 'name' => $name,
+ 'selected' => $user['account_id']
== $selected ? 1 : 0
+ );
+
+ if(!$selected_found)
{
- $user_list[] = array
- (
- //'user_id' =>
$user['account_id'],
- 'id' =>
$user['account_id'],
- 'name' =>
$name,
- 'selected' =>
'selected'
- );
+ $selected_found = $user['account_id']
== $selected ? true : false;
}
- else
- {
- $user_list[] = array
- (
- //'user_id' =>
$user['account_id'],
- 'id' =>
$user['account_id'],
- 'name' => $name
- );
- }
}
+ if($selected && !$selected_found)
+ {
+ $user_list[] = array
+ (
+ 'id' => $selected,
+ 'name' =>
$GLOBALS['phpgw']->accounts->get($selected)->__toString(),
+ 'selected' => 1
+ );
+ }
+
return $user_list;
}
Modified: branches/dev-syncromind/property/inc/class.boproject.inc.php
===================================================================
--- branches/dev-syncromind/property/inc/class.boproject.inc.php
2015-01-15 09:13:41 UTC (rev 12602)
+++ branches/dev-syncromind/property/inc/class.boproject.inc.php
2015-01-15 12:06:55 UTC (rev 12603)
@@ -71,8 +71,25 @@
- $default_filter_year =
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['default_project_filter_year'])
&&
$GLOBALS['phpgw_info']['user']['preferences']['property']['default_project_filter_year']
== 'current_year' ? date('Y') : 'all';
+ $default_filter_year= 'all';
+
if(isset($GLOBALS['phpgw_info']['user']['preferences']['property']['default_project_filter_year']))
+ {
+ $_last_year = date('Y') -1;
+
switch($GLOBALS['phpgw_info']['user']['preferences']['property']['default_project_filter_year'])
+ {
+ case 'current_year':
+ $default_filter_year =
date('Y');
+ break;
+ case "{$_last_year}":
+ $default_filter_year =
$_last_year;
+ break;
+ default:
+ $default_filter_year = 'all';
+ break;
+ }
+ }
+
$start =
phpgw::get_var('start', 'int', 'REQUEST', 0);
$query =
phpgw::get_var('query');
$sort =
phpgw::get_var('sort');
Modified: branches/dev-syncromind/property/inc/class.boworkorder.inc.php
===================================================================
--- branches/dev-syncromind/property/inc/class.boworkorder.inc.php
2015-01-15 09:13:41 UTC (rev 12602)
+++ branches/dev-syncromind/property/inc/class.boworkorder.inc.php
2015-01-15 12:06:55 UTC (rev 12603)
@@ -70,8 +70,25 @@
$this->use_session = true;
}
- $default_filter_year =
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['default_project_filter_year'])
&&
$GLOBALS['phpgw_info']['user']['preferences']['property']['default_project_filter_year']
== 'current_year' ? date('Y') : 'all';
+ $default_filter_year= 'all';
+
if(isset($GLOBALS['phpgw_info']['user']['preferences']['property']['default_project_filter_year']))
+ {
+ $_last_year = date('Y') -1;
+
switch($GLOBALS['phpgw_info']['user']['preferences']['property']['default_project_filter_year'])
+ {
+ case 'current_year':
+ $default_filter_year =
date('Y');
+ break;
+ case "{$_last_year}":
+ $default_filter_year =
$_last_year;
+ break;
+ default:
+ $default_filter_year = 'all';
+ break;
+ }
+ }
+
$start =
phpgw::get_var('start', 'int', 'REQUEST', 0);
$query =
phpgw::get_var('query');
$sort =
phpgw::get_var('sort');
Modified: branches/dev-syncromind/property/inc/class.uiimport.inc.php
===================================================================
--- branches/dev-syncromind/property/inc/class.uiimport.inc.php 2015-01-15
09:13:41 UTC (rev 12602)
+++ branches/dev-syncromind/property/inc/class.uiimport.inc.php 2015-01-15
12:06:55 UTC (rev 12603)
@@ -60,10 +60,11 @@
'fm_ecodimb'
=> array('name' => 'fm_ecodimb (' . lang('dimb') . ')', 'permission' =>
PHPGW_ACL_READ | PHPGW_ACL_ADD | PHPGW_ACL_EDIT),
'fm_budget'
=> array('name' => 'fm_budget (' . lang('budget') . ')', 'permission'
=> PHPGW_ACL_READ | PHPGW_ACL_ADD | PHPGW_ACL_EDIT),
'fm_org_unit'
=> array('name' => 'fm_org_unit (' . lang('department') . ')', 'permission' =>
PHPGW_ACL_READ | PHPGW_ACL_ADD | PHPGW_ACL_EDIT),
+ 'fm_project_group'
=> array('name' => 'fm_project_group', 'permission' => PHPGW_ACL_READ |
PHPGW_ACL_ADD | PHPGW_ACL_EDIT),
'fm_eco_periodization_outline' => array('name'
=> 'fm_eco_periodization_outline (' . lang('periodization outline') . ')',
'permission' => PHPGW_ACL_READ | PHPGW_ACL_ADD | PHPGW_ACL_EDIT),
'fm_eco_periodization' =>
array('name' => 'fm_eco_periodization (' . lang('periodization') . ')',
'permission' => PHPGW_ACL_READ | PHPGW_ACL_ADD | PHPGW_ACL_EDIT),
'fm_ecodimd'
=> array('name' => 'fm_ecodimd', 'permission' => PHPGW_ACL_READ | PHPGW_ACL_ADD
| PHPGW_ACL_EDIT),
- 'phpgw_categories'
=> array('name' => 'phpgw_categories (' . lang('categories') . ')',
'permission' => PHPGW_ACL_READ),
+ 'phpgw_categories'
=> array('name' => 'phpgw_categories (' . lang('categories') . ')',
'permission' => PHPGW_ACL_READ | PHPGW_ACL_ADD | PHPGW_ACL_EDIT),
);
$location_types =
execMethod('property.soadmin_location.select_location_type');
Modified: branches/dev-syncromind/property/inc/class.uiproject.inc.php
===================================================================
--- branches/dev-syncromind/property/inc/class.uiproject.inc.php
2015-01-15 09:13:41 UTC (rev 12602)
+++ branches/dev-syncromind/property/inc/class.uiproject.inc.php
2015-01-15 12:06:55 UTC (rev 12603)
@@ -294,11 +294,11 @@
$_cats =
$this->cats->return_sorted_array(0,false,'','','',false, false);
//$this->cats->formatted_xslt_list(array('format'=>'filter','selected' =>
$this->cat_id,'globals' => True));
-
+
$values_combo_box[2] = array();
foreach($_cats as $_cat)
{
- if($_cat['level'] == 0 )
+ if($_cat['level'] == 0 &&
!$_cat['active'] == 2)
{
$values_combo_box[2][] = $_cat;
}
Modified: branches/dev-syncromind/property/inc/class.uiworkorder.inc.php
===================================================================
--- branches/dev-syncromind/property/inc/class.uiworkorder.inc.php
2015-01-15 09:13:41 UTC (rev 12602)
+++ branches/dev-syncromind/property/inc/class.uiworkorder.inc.php
2015-01-15 12:06:55 UTC (rev 12603)
@@ -222,7 +222,7 @@
$values_combo_box[$count] = array();
foreach($_cats as $_cat)
{
- if($_cat['level'] == 0 )
+ if($_cat['level'] == 0 && !$_cat['active'] == 2)
{
$values_combo_box[$count][] = $_cat;
}
@@ -2201,12 +2201,19 @@
}
}
- $cat_sub = $this->cats->return_sorted_array($start =
0,$limit = false,$query = '',$sort = '',$order = '',$globals = False, false);
+ $_cat_sub = $this->cats->return_sorted_array($start =
0,$limit = false,$query = '',$sort = '',$order = '',$globals = False, false);
-
- foreach ($cat_sub as &$entry)
+ $selected_cat = $values['cat_id'] ? $values['cat_id']:
$project['cat_id'];
+ $cat_sub = array();
+ foreach ($_cat_sub as $entry)
{
+ if($entry['active'] == 2 && !$entry['id'] ==
$selected_cat)//hidden
+ {
+ continue;
+ }
$entry['name'] = str_repeat (' . ' ,
(int)$entry['level'] ) . $entry['name'];
+ $entry['title'] = $entry['description'];
+ $cat_sub[] = $entry;
}
$suppresscoordination =
isset($config->config_data['project_suppresscoordination']) &&
$config->config_data['project_suppresscoordination'] ? 1 : '';
@@ -2359,7 +2366,7 @@
'lang_save_statustext'
=> lang('Save the workorder'),
'lang_cat_sub'
=> lang('category'),
- 'cat_sub_list'
=> $this->bocommon->select_list($values['cat_id'] ?
$values['cat_id']: $project['cat_id'], $cat_sub),
+ 'cat_sub_list'
=> $this->bocommon->select_list($selected_cat, $cat_sub),
'cat_sub_name'
=> 'values[cat_id]',
'lang_cat_sub_statustext'
=> lang('select sub category'),
Modified: branches/dev-syncromind/property/inc/hook_settings.inc.php
===================================================================
--- branches/dev-syncromind/property/inc/hook_settings.inc.php 2015-01-15
09:13:41 UTC (rev 12602)
+++ branches/dev-syncromind/property/inc/hook_settings.inc.php 2015-01-15
12:06:55 UTC (rev 12603)
@@ -249,6 +249,7 @@
$default_project_filter_year =array
(
+ (date('Y') -1) => (date('Y')-1),
'current_year' => lang('current year'),
'all' => lang('all'),
);
Modified: branches/dev-syncromind/property/templates/base/cat_sub_select.xsl
===================================================================
--- branches/dev-syncromind/property/templates/base/cat_sub_select.xsl
2015-01-15 09:13:41 UTC (rev 12602)
+++ branches/dev-syncromind/property/templates/base/cat_sub_select.xsl
2015-01-15 12:06:55 UTC (rev 12603)
@@ -18,12 +18,12 @@
</xsl:variable>
<xsl:choose>
<xsl:when test="selected">
- <option value="{$id}" selected="selected">
+ <option value="{$id}" selected="selected"
title="{title}">
<xsl:value-of
disable-output-escaping="yes" select="name"/>
</option>
</xsl:when>
<xsl:otherwise>
- <option value="{$id}">
+ <option value="{$id}" title="{title}">
<xsl:value-of
disable-output-escaping="yes" select="name"/>
</option>
</xsl:otherwise>
Modified: branches/dev-syncromind/property/templates/base/user_id_filter.xsl
===================================================================
--- branches/dev-syncromind/property/templates/base/user_id_filter.xsl
2015-01-15 09:13:41 UTC (rev 12602)
+++ branches/dev-syncromind/property/templates/base/user_id_filter.xsl
2015-01-15 12:06:55 UTC (rev 12603)
@@ -36,7 +36,7 @@
<xsl:value-of select="user_id"/>
</xsl:variable>
<xsl:choose>
- <xsl:when test="selected">
+ <xsl:when test="selected = 1">
<option value="{$user_id}" selected="selected">
<xsl:value-of
disable-output-escaping="yes" select="name"/>
</option>
Modified: branches/dev-syncromind/property/templates/base/user_id_select.xsl
===================================================================
--- branches/dev-syncromind/property/templates/base/user_id_select.xsl
2015-01-15 09:13:41 UTC (rev 12602)
+++ branches/dev-syncromind/property/templates/base/user_id_select.xsl
2015-01-15 12:06:55 UTC (rev 12603)
@@ -23,7 +23,7 @@
<xsl:value-of select="id"/>
</xsl:variable>
<xsl:choose>
- <xsl:when test="selected">
+ <xsl:when test="selected = 1">
<option value="{$user_id}{$id}"
selected="selected">
<xsl:value-of
disable-output-escaping="yes" select="name"/>
</option>
Modified: branches/dev-syncromind/rental/inc/hook_config.inc.php
===================================================================
--- branches/dev-syncromind/rental/inc/hook_config.inc.php 2015-01-15
09:13:41 UTC (rev 12602)
+++ branches/dev-syncromind/rental/inc/hook_config.inc.php 2015-01-15
12:06:55 UTC (rev 12603)
@@ -184,3 +184,31 @@
}
return $out;
}
+
+ /**
+ * Get HTML checkbox with contract_types that are valid for new contracts
+ *
+ * @param $config
+ * @return string HTML checkboxes to be placed in a table
+ */
+ function contract_types($config)
+ {
+ phpgw::import_class('rental.socontract');
+ $types =
rental_socontract::get_instance()->get_fields_of_responsibility();
+ $types_assigned = isset($config['contract_types']) ?
$config['contract_types'] : array();
+ $out = '';
+ foreach ( $types as $type => $_label)
+ {
+ $label =
$GLOBALS['phpgw']->translation->translate($_label, array(), false, 'rental');
+ $checked = '';
+ if ( in_array($type, $types_assigned))
+ {
+ $checked = ' checked';
+ }
+
+ $out .= <<<HTML
+ <tr><td><input type="checkbox"
name="newsettings[contract_types][]" value="{$type}"
{$checked}><label>{$label}</label></td></tr>
+HTML;
+ }
+ return $out;
+ }
Modified: branches/dev-syncromind/rental/templates/base/config.tpl
===================================================================
--- branches/dev-syncromind/rental/templates/base/config.tpl 2015-01-15
09:13:41 UTC (rev 12602)
+++ branches/dev-syncromind/rental/templates/base/config.tpl 2015-01-15
12:06:55 UTC (rev 12603)
@@ -159,6 +159,16 @@
<td>{lang_path_to_wkhtmltopdf}:</td>
<td><input name="newsettings[path_to_wkhtmltopdf]"
value="{value_path_to_wkhtmltopdf}"></td>
</tr>
+ <tr class="row_off">
+ <td valign = 'top'>{lang_contract_types}:</td>
+ <td>
+ <!--to be able to blank the setting - need an
empty value-->
+ <input type = 'hidden'
name="newsettings[contract_types][]" value="">
+ <table>
+ {hook_contract_types}
+ </table>
+ </td>
+ </tr>
<!-- END body -->
<!-- BEGIN footer -->
Modified: branches/dev-syncromind/rental/templates/base/contract_list.php
===================================================================
--- branches/dev-syncromind/rental/templates/base/contract_list.php
2015-01-15 09:13:41 UTC (rev 12602)
+++ branches/dev-syncromind/rental/templates/base/contract_list.php
2015-01-15 12:06:55 UTC (rev 12603)
@@ -26,10 +26,27 @@
<h3><?php echo lang('t_new_contract') ?></h3>
<select name="location_id" id="location_id">
<?php
+ $config = CreateObject('phpgwapi.config','rental');
+ $config->read();
+ $valid_contract_types = array();
+ if(isset($config->config_data['contract_types']) &&
is_array($config->config_data['contract_types']))
+ {
+ foreach ($config->config_data['contract_types']
as $_key => $_value)
+ {
+ if($_value)
+ {
+ $valid_contract_types[] =
$_value;
+ }
+ }
+ }
+
$types =
rental_socontract::get_instance()->get_fields_of_responsibility();
foreach($types as $id => $label)
{
-
+ if($valid_contract_types &&
!in_array($id,$valid_contract_types))
+ {
+ continue;
+ }
$names = $this->locations->get_name($id);
if($names['appname'] ==
$GLOBALS['phpgw_info']['flags']['currentapp'])
{
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [12603] Syncromind: Merge 12529:12602 from trunk,
Sigurd Nes <=