[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [6735] Merge 6731:6734 from trunk
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [6735] Merge 6731:6734 from trunk |
Date: |
Fri, 07 Jan 2011 14:21:07 +0000 |
Revision: 6735
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=6735
Author: sigurdne
Date: 2011-01-07 14:21:07 +0000 (Fri, 07 Jan 2011)
Log Message:
-----------
Merge 6731:6734 from trunk
Modified Paths:
--------------
branches/Version-1_0-branch/phpgwapi/inc/class.historylog.inc.php
branches/Version-1_0-branch/phpgwapi/inc/class.xslttemplates.inc.php
branches/Version-1_0-branch/phpgwapi/setup/setup.inc.php
branches/Version-1_0-branch/phpgwapi/setup/tables_update.inc.php
branches/Version-1_0-branch/property/inc/class.bocommon.inc.php
branches/Version-1_0-branch/property/inc/class.botts.inc.php
branches/Version-1_0-branch/property/inc/class.menu.inc.php
branches/Version-1_0-branch/property/inc/class.socommon.inc.php
branches/Version-1_0-branch/property/inc/class.sogeneric.inc.php
branches/Version-1_0-branch/property/inc/class.uilookup.inc.php
branches/Version-1_0-branch/property/inc/class.uitts.inc.php
branches/Version-1_0-branch/property/js/yahoo/tts.view.js
branches/Version-1_0-branch/property/setup/setup.inc.php
branches/Version-1_0-branch/property/setup/tables_current.inc.php
branches/Version-1_0-branch/property/setup/tables_update.inc.php
branches/Version-1_0-branch/property/templates/base/config.tpl
branches/Version-1_0-branch/property/templates/base/tts.xsl
Added Paths:
-----------
branches/Version-1_0-branch/helpdesk/
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
+
/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
Modified: branches/Version-1_0-branch/phpgwapi/inc/class.historylog.inc.php
===================================================================
--- branches/Version-1_0-branch/phpgwapi/inc/class.historylog.inc.php
2011-01-07 14:10:06 UTC (rev 6734)
+++ branches/Version-1_0-branch/phpgwapi/inc/class.historylog.inc.php
2011-01-07 14:21:07 UTC (rev 6735)
@@ -15,10 +15,10 @@
* @package phpgwapi
* @subpackage application
*/
- class historylog
+ class phpgwapi_historylog
{
var $db;
- var $location_id;
+ protected $location_id;
var $template;
var $nextmatchs;
var $types = array(
@@ -28,7 +28,7 @@
);
var $alternate_handlers = array();
- function historylog($appname, $location = '.')
+ function __construct($appname, $location = '.')
{
if (! $appname)
{
@@ -50,12 +50,20 @@
{
if ($new_value != $old_value)
{
- $this->db->query("INSERT INTO phpgw_history_log
(history_record_id,"
- .
"location_id,history_owner,history_status,history_new_value,history_old_value,history_timestamp)
"
- . "VALUES ('".(int)$record_id."'," .
$this->location_id . ",'"
- .
$GLOBALS['phpgw_info']['user']['account_id'] . "','$status','"
- . $this->db->db_addslashes($new_value)
. "','" . $this->db->db_addslashes($old_value) . "','" .
date($this->db->datetime_format())
- . "')",__LINE__,__FILE__);
+
+ $value_set = array
+ (
+ 'history_record_id' =>
(int)$record_id,
+ 'location_id' =>
$this->location_id,
+ 'history_owner' =>
$GLOBALS['phpgw_info']['user']['account_id'],
+ 'history_status' => $status,
+ 'history_new_value' =>
$this->db->db_addslashes($new_value),
+ 'history_old_value' =>
$this->db->db_addslashes($old_value),
+ 'history_timestamp' =>
date($this->db->datetime_format())
+ );
+
+ $this->db->query( 'INSERT INTO
phpgw_history_log (' . implode( ',', array_keys( $value_set ) ) . ') VALUES
('
+ . $this->db->validate_insert( array_values(
$value_set ) ) . ')',__LINE__,__FILE__);
}
}
@@ -108,14 +116,15 @@
{
$return_values[] = array
(
- 'id' =>
$this->db->f('history_id'),
- 'record_id' =>
$this->db->f('history_record_id'),
- 'owner' =>
$GLOBALS['phpgw']->accounts->id2name($this->db->f('history_owner')),
-// 'status' =>
lang($this->types[$this->db->f('history_status')]),
- 'status' => str_replace('
','',$this->db->f('history_status')),
- 'new_value' =>
htmlspecialchars_decode($this->db->f('history_new_value',true)),
- 'old_value' =>
htmlspecialchars_decode($this->db->f('history_old_value',true)),
- 'datetime' =>
$this->db->from_timestamp($this->db->f('history_timestamp'))
+ 'id' =>
$this->db->f('history_id'),
+ 'record_id' =>
$this->db->f('history_record_id'),
+ 'owner' =>
$GLOBALS['phpgw']->accounts->id2name($this->db->f('history_owner')),
+// 'status' =>
lang($this->types[$this->db->f('history_status')]),
+ 'status' => str_replace('
','',$this->db->f('history_status')),
+ 'new_value' =>
htmlspecialchars_decode($this->db->f('history_new_value',true)),
+ 'old_value' =>
htmlspecialchars_decode($this->db->f('history_old_value',true)),
+ 'datetime' =>
$this->db->from_timestamp($this->db->f('history_timestamp')),
+ 'publish' =>
$this->db->f('publish')
);
}
return $return_values;
Modified: branches/Version-1_0-branch/phpgwapi/inc/class.xslttemplates.inc.php
===================================================================
--- branches/Version-1_0-branch/phpgwapi/inc/class.xslttemplates.inc.php
2011-01-07 14:10:06 UTC (rev 6734)
+++ branches/Version-1_0-branch/phpgwapi/inc/class.xslttemplates.inc.php
2011-01-07 14:21:07 UTC (rev 6735)
@@ -130,7 +130,7 @@
{
foreach ( $filename as $file )
{
- $this->add_file($file);
+ $this->add_file($file, $rootdir);
}
return;
}
Modified: branches/Version-1_0-branch/phpgwapi/setup/setup.inc.php
===================================================================
--- branches/Version-1_0-branch/phpgwapi/setup/setup.inc.php 2011-01-07
14:10:06 UTC (rev 6734)
+++ branches/Version-1_0-branch/phpgwapi/setup/setup.inc.php 2011-01-07
14:21:07 UTC (rev 6735)
@@ -12,7 +12,7 @@
// Basic information about this app
$setup_info['phpgwapi']['name'] = 'phpgwapi';
$setup_info['phpgwapi']['title'] = 'phpgwapi';
- $setup_info['phpgwapi']['version'] = '0.9.17.531';
+ $setup_info['phpgwapi']['version'] = '0.9.17.532';
$setup_info['phpgwapi']['versions']['current_header'] = '1.31';
$setup_info['phpgwapi']['versions']['system'] = '1.0';
$setup_info['phpgwapi']['enable'] = 3;
Modified: branches/Version-1_0-branch/phpgwapi/setup/tables_update.inc.php
===================================================================
--- branches/Version-1_0-branch/phpgwapi/setup/tables_update.inc.php
2011-01-07 14:10:06 UTC (rev 6734)
+++ branches/Version-1_0-branch/phpgwapi/setup/tables_update.inc.php
2011-01-07 14:21:07 UTC (rev 6735)
@@ -2843,3 +2843,24 @@
}
}
+
+ $test[] = '0.9.17.531';
+ /**
+ * Add publishing flag to history log
+ *
+ * @return string the new version number
+ */
+ function phpgwapi_upgrade0_9_17_531()
+ {
+ $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+
+
$GLOBALS['phpgw_setup']->oProc->AddColumn('phpgw_history_log','publish',array('type'
=> 'int','precision' => 2,'nullable' => True));
+
+
+ if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+ {
+ $GLOBALS['setup_info']['phpgwapi']['currentver'] =
'0.9.17.532';
+ return $GLOBALS['setup_info']['phpgwapi']['currentver'];
+ }
+ }
+
Modified: branches/Version-1_0-branch/property/inc/class.bocommon.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.bocommon.inc.php
2011-01-07 14:10:06 UTC (rev 6734)
+++ branches/Version-1_0-branch/property/inc/class.bocommon.inc.php
2011-01-07 14:21:07 UTC (rev 6735)
@@ -43,8 +43,8 @@
var $order;
var $cat_id;
var $district_id;
+ var $xsl_rootdir;
-
var $public_functions = array
(
'confirm_session' => true,
@@ -87,7 +87,7 @@
$this->datetimeformat = "Y-m-d G:i:s";
break;
}
-
+ $this->xsl_rootdir = PHPGW_SERVER_ROOT .
'/property/templates/base';
}
function check_perms($rights, $required)
@@ -224,12 +224,12 @@
{
switch($format)
{
- case 'select':
-
$GLOBALS['phpgw']->xslttpl->add_file(array('user_id_select'));
- break;
- case 'filter':
-
$GLOBALS['phpgw']->xslttpl->add_file(array('user_id_filter'));
- break;
+ case 'select':
+
$GLOBALS['phpgw']->xslttpl->add_file(array('user_id_select'),$this->xsl_rootdir);
+ break;
+ case 'filter':
+
$GLOBALS['phpgw']->xslttpl->add_file(array('user_id_filter'),$this->xsl_rootdir);
+ break;
}
if(!$selected && $default)
@@ -304,10 +304,10 @@
switch($format)
{
case 'select':
-
$GLOBALS['phpgw']->xslttpl->add_file(array('group_select'));
+
$GLOBALS['phpgw']->xslttpl->add_file(array('group_select'), $this->xsl_rootdir);
break;
case 'filter':
-
$GLOBALS['phpgw']->xslttpl->add_file(array('group_filter'));
+
$GLOBALS['phpgw']->xslttpl->add_file(array('group_filter'), $this->xsl_rootdir);
break;
}
@@ -459,12 +459,12 @@
switch($format)
{
- case 'select':
-
$GLOBALS['phpgw']->xslttpl->add_file(array('user_id_select'));
- break;
- case 'filter':
-
$GLOBALS['phpgw']->xslttpl->add_file(array('user_id_filter'));
- break;
+ case 'select':
+
$GLOBALS['phpgw']->xslttpl->add_file(array('user_id_select'),
$this->xsl_rootdir);
+ break;
+ case 'filter':
+
$GLOBALS['phpgw']->xslttpl->add_file(array('user_id_filter'),
$this->xsl_rootdir);
+ break;
}
if(!$selected && $default)
@@ -534,11 +534,11 @@
if( isset($data['type']) && $data['type']=='view')
{
-
$GLOBALS['phpgw']->xslttpl->add_file(array('vendor_view'));
+
$GLOBALS['phpgw']->xslttpl->add_file(array('vendor_view'), $this->xsl_rootdir);
}
else
{
-
$GLOBALS['phpgw']->xslttpl->add_file(array('vendor_form'));
+
$GLOBALS['phpgw']->xslttpl->add_file(array('vendor_form'), $this->xsl_rootdir);
}
$vendor['value_vendor_id'] =
$data['vendor_id'];
@@ -583,11 +583,11 @@
$field = $data['field'];
if( isset($data['type']) && $data['type']=='view')
{
-
$GLOBALS['phpgw']->xslttpl->add_file(array('contact_view'));
+
$GLOBALS['phpgw']->xslttpl->add_file(array('contact_view'), $this->xsl_rootdir);
}
else
{
-
$GLOBALS['phpgw']->xslttpl->add_file(array('contact_form'));
+
$GLOBALS['phpgw']->xslttpl->add_file(array('contact_form'), $this->xsl_rootdir);
}
$contact['value_contact_id'] =
$data['contact_id'];
@@ -616,11 +616,11 @@
{
if($data['type']=='view')
{
-
$GLOBALS['phpgw']->xslttpl->add_file(array('tenant_view'));
+
$GLOBALS['phpgw']->xslttpl->add_file(array('tenant_view'), $this->xsl_rootdir);
}
else
{
-
$GLOBALS['phpgw']->xslttpl->add_file(array('tenant_form'));
+
$GLOBALS['phpgw']->xslttpl->add_file(array('tenant_form'), $this->xsl_rootdir);
}
$tenant['value_tenant_id'] =
$data['tenant_id'];
@@ -682,11 +682,11 @@
{
if( isset($data['type']) && $data['type']=='view')
{
-
$GLOBALS['phpgw']->xslttpl->add_file(array('b_account_view'));
+
$GLOBALS['phpgw']->xslttpl->add_file(array('b_account_view'),
$this->xsl_rootdir);
}
else
{
-
$GLOBALS['phpgw']->xslttpl->add_file(array('b_account_form'));
+
$GLOBALS['phpgw']->xslttpl->add_file(array('b_account_form'),
$this->xsl_rootdir);
}
$b_account['value_b_account_id'] =
$data['b_account_id'];
@@ -729,11 +729,11 @@
return $project_group;
}
-
$GLOBALS['phpgw']->xslttpl->add_file(array('project_group_view'));
+
$GLOBALS['phpgw']->xslttpl->add_file(array('project_group_view'),
$this->xsl_rootdir);
}
else
{
-
$GLOBALS['phpgw']->xslttpl->add_file(array('project_group_form'));
+
$GLOBALS['phpgw']->xslttpl->add_file(array('project_group_form'),
$this->xsl_rootdir);
}
$project_group['value_project_group']
= $data['project_group'];
@@ -763,11 +763,11 @@
return $ecodimb;
}
-
$GLOBALS['phpgw']->xslttpl->add_file(array('ecodimb_view'));
+
$GLOBALS['phpgw']->xslttpl->add_file(array('ecodimb_view'), $this->xsl_rootdir);
}
else
{
-
$GLOBALS['phpgw']->xslttpl->add_file(array('ecodimb_form'));
+
$GLOBALS['phpgw']->xslttpl->add_file(array('ecodimb_form'), $this->xsl_rootdir);
}
$ecodimb['value_ecodimb']
= $data['ecodimb'];
@@ -800,11 +800,11 @@
//
return $event;
}
-
$GLOBALS['phpgw']->xslttpl->add_file(array('event_view'));
+
$GLOBALS['phpgw']->xslttpl->add_file(array('event_view'), $this->xsl_rootdir);
}
else
{
-
$GLOBALS['phpgw']->xslttpl->add_file(array('event_form'));
+
$GLOBALS['phpgw']->xslttpl->add_file(array('event_form'), $this->xsl_rootdir);
}
// If the record is not saved - issue a warning
@@ -891,11 +891,11 @@
if($data['type']=='view')
{
-
$GLOBALS['phpgw']->xslttpl->add_file(array('alarm_view'));
+
$GLOBALS['phpgw']->xslttpl->add_file(array('alarm_view'), $this->xsl_rootdir);
}
else
{
-
$GLOBALS['phpgw']->xslttpl->add_file(array('alarm_form'));
+
$GLOBALS['phpgw']->xslttpl->add_file(array('alarm_form'), $this->xsl_rootdir);
}
$alarm['header'][] = array
@@ -1413,10 +1413,10 @@
switch($format)
{
case 'select':
-
$GLOBALS['phpgw']->xslttpl->add_file(array('select_part_of_town'));
+
$GLOBALS['phpgw']->xslttpl->add_file(array('select_part_of_town'),
$this->xsl_rootdir);
break;
case 'filter':
-
$GLOBALS['phpgw']->xslttpl->add_file(array('filter_part_of_town'));
+
$GLOBALS['phpgw']->xslttpl->add_file(array('filter_part_of_town'),
$this->xsl_rootdir);
break;
}
@@ -1456,10 +1456,10 @@
switch($format)
{
case 'select':
-
$GLOBALS['phpgw']->xslttpl->add_file(array('select_district'));
+
$GLOBALS['phpgw']->xslttpl->add_file(array('select_district'),
$this->xsl_rootdir);
break;
case 'filter':
-
$GLOBALS['phpgw']->xslttpl->add_file(array('filter_district'));
+
$GLOBALS['phpgw']->xslttpl->add_file(array('filter_district'),
$this->xsl_rootdir);
break;
}
@@ -1474,10 +1474,10 @@
switch($data['format'])
{
case 'select':
-
$GLOBALS['phpgw']->xslttpl->add_file(array('cat_select'));
+
$GLOBALS['phpgw']->xslttpl->add_file(array('cat_select'), $this->xsl_rootdir);
break;
case 'filter':
-
$GLOBALS['phpgw']->xslttpl->add_file(array('cat_filter'));
+
$GLOBALS['phpgw']->xslttpl->add_file(array('cat_filter'), $this->xsl_rootdir);
break;
}
@@ -1993,7 +1993,7 @@
{
return;
}
- $GLOBALS['phpgw']->xslttpl->add_file(array('menu'));
+ $GLOBALS['phpgw']->xslttpl->add_file(array('menu'),
$this->xsl_rootdir);
if(!$menu =
$GLOBALS['phpgw']->session->appsession($GLOBALS['phpgw_info']['flags']['menu_selection'],
"menu_{$app}"))
{
@@ -2037,7 +2037,7 @@
function no_access()
{
-
$GLOBALS['phpgw']->xslttpl->add_file(array('no_access','menu'));
+
$GLOBALS['phpgw']->xslttpl->add_file(array('no_access','menu'),
$this->xsl_rootdir);
$receipt['error'][]=array('msg'=>lang('NO ACCESS'));
Modified: branches/Version-1_0-branch/property/inc/class.botts.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.botts.inc.php
2011-01-07 14:10:06 UTC (rev 6734)
+++ branches/Version-1_0-branch/property/inc/class.botts.inc.php
2011-01-07 14:21:07 UTC (rev 6735)
@@ -235,6 +235,7 @@
'F' => lang('finnish date'),
'SC' => lang('Status changed'),
'M' => lang('Sent by email to'),
+ 'MS' => lang('Sent by sms'),
'AC'=> lang('actual cost changed'),
);
@@ -582,6 +583,9 @@
$type = lang('Sent by email to');
$this->order_sent_adress =
$value['new_value']; // in case we want to resend the order as an reminder
break;
+ case 'MS':
+ $type = lang('Sent by sms');
+ break;
default:
// nothing
}
Modified: branches/Version-1_0-branch/property/inc/class.menu.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.menu.inc.php 2011-01-07
14:10:06 UTC (rev 6734)
+++ branches/Version-1_0-branch/property/inc/class.menu.inc.php 2011-01-07
14:21:07 UTC (rev 6735)
@@ -639,6 +639,13 @@
);
}
+
$menus['navigation']['helpdesk']['children']['response_template'] = array
+ (
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'property.uigeneric.index', 'type' => 'response_template') ),
+ 'text' => lang('order template'),
+ 'image' => array('property',
'helpdesk')
+ );
+
if ( $acl->check('.project', PHPGW_ACL_READ,
'property') )
{
$menus['navigation']['project'] = array
Modified: branches/Version-1_0-branch/property/inc/class.socommon.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.socommon.inc.php
2011-01-07 14:10:06 UTC (rev 6734)
+++ branches/Version-1_0-branch/property/inc/class.socommon.inc.php
2011-01-07 14:21:07 UTC (rev 6735)
@@ -314,6 +314,10 @@
{
$name = 'workorder';
}
+ else if($name == 'helpdesk')
+ {
+ $name = 'workorder';
+ }
$this->db->query("SELECT value FROM fm_idgenerator
WHERE name='{$name}'");
$this->db->next_record();
$next_id = $this->db->f('value') +1;
Modified: branches/Version-1_0-branch/property/inc/class.sogeneric.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.sogeneric.inc.php
2011-01-07 14:10:06 UTC (rev 6734)
+++ branches/Version-1_0-branch/property/inc/class.sogeneric.inc.php
2011-01-07 14:21:07 UTC (rev 6735)
@@ -1436,6 +1436,66 @@
'menu_selection' =>
'admin::property::ticket_status'
);
break;
+
+ case 'helpdesk_status':
+ // the helpdesk app
+ $info = array
+ (
+ 'table'
=> 'phpgw_helpdesk_status',
+ 'id'
=> array('name' => 'id', 'type' => 'auto'),
+ 'fields'
=> array
+ (
+ array
+ (
+ 'name' =>
'name',
+ 'descr' =>
lang('name'),
+ 'type' =>
'varchar'
+ ),
+ array
+ (
+ 'name' =>
'sorting',
+ 'descr' =>
lang('sorting'),
+ 'type' =>
'integer',
+ 'sortable'=>
true
+ ),
+ array
+ (
+ 'name' =>
'color',
+ 'descr' =>
lang('color'),
+ 'type' =>
'varchar'
+ ),
+ array
+ (
+ 'name' =>
'approved',
+ 'descr' =>
lang('approved'),
+ 'type' =>
'checkbox'
+ ),
+ array
+ (
+ 'name' =>
'in_progress',
+ 'descr' =>
lang('In progress'),
+ 'type' =>
'checkbox'
+ ),
+ array
+ (
+ 'name' =>
'delivered',
+ 'descr' =>
lang('delivered'),
+ 'type' =>
'checkbox'
+ ),
+ array
+ (
+ 'name' =>
'closed',
+ 'descr' =>
lang('closed'),
+ 'type' =>
'checkbox'
+ )
+ ),
+ 'edit_msg'
=> lang('edit'),
+ 'add_msg'
=> lang('add'),
+ 'name'
=> lang('event action'),
+ 'acl_location' =>
'.admin',
+ 'menu_selection' =>
'admin::helpdesk::ticket_status'
+ );
+ break;
case 'pending_action_type':
$info = array
(
@@ -1507,7 +1567,49 @@
);
break;
+ case 'response_template':
+ $info = array
+ (
+ 'table'
=> 'fm_response_template',
+ 'id'
=> array('name' => 'id', 'type' => 'auto'),
+ 'fields'
=> array
+ (
+ array
+ (
+ 'name' =>
'name',
+ 'descr' =>
lang('name'),
+ 'type' =>
'varchar'
+ ),
+ array
+ (
+ 'name' =>
'content',
+ 'descr' =>
lang('content'),
+ 'type' => 'text'
+ ),
+ array
+ (
+ 'name' =>
'public',
+ 'descr' =>
lang('public'),
+ 'type' =>
'checkbox'
+ )
+ ),
+ 'edit_msg'
=> lang('edit'),
+ 'add_msg'
=> lang('add'),
+ 'name'
=> lang('response template'),
+ 'acl_location' =>
'.ticket',
+ 'menu_selection' =>
'property::helpdesk::response_template',
+ 'default'
=> array
+ (
+ 'user_id'
=> array('add' => '$this->account'),
+ 'entry_date' =>
array('add' => 'time()'),
+ 'modified_date' =>
array('edit' => 'time()'),
+ ),
+ 'check_grant' => true
+ );
+
+ break;
+
case 'responsibility_role':
$info = array
Modified: branches/Version-1_0-branch/property/inc/class.uilookup.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.uilookup.inc.php
2011-01-07 14:10:06 UTC (rev 6734)
+++ branches/Version-1_0-branch/property/inc/class.uilookup.inc.php
2011-01-07 14:21:07 UTC (rev 6735)
@@ -49,19 +49,20 @@
var $public_functions = array
(
- 'addressbook' => true,
- 'organisation' => true,
- 'vendor' => true,
- 'b_account' => true,
- 'location' => true,
- 'entity' => true,
- 'ns3420' => true,
- 'street' => true,
- 'tenant' => true,
- 'phpgw_user' => true,
- 'project_group' => true,
- 'ecodimb' => true,
- 'order_template'=> true
+ 'addressbook' => true,
+ 'organisation' => true,
+ 'vendor' => true,
+ 'b_account' => true,
+ 'location' => true,
+ 'entity' => true,
+ 'ns3420' => true,
+ 'street' => true,
+ 'tenant' => true,
+ 'phpgw_user' => true,
+ 'project_group' => true,
+ 'ecodimb' => true,
+ 'order_template' => true,
+ 'response_template' => true
);
function __construct()
@@ -2989,4 +2990,218 @@
$this->save_sessiondata();
}
+
+ function response_template()
+ {
+ if( phpgw::get_var('phpgw_return_as') != 'json' )
+ {
+
+ $datatable['config']['base_url'] =
$GLOBALS['phpgw']->link('/index.php', array
+ (
+ 'menuaction'
=> 'property.uilookup.response_template',
+ 'second_display' => true,
+ 'cat_id'
=> $this->cat_id,
+ 'query'
=> $this->query,
+ 'filter'
=> $this->filter
+ ));
+ $datatable['config']['allow_allrows'] = true;
+
+ $datatable['config']['base_java_url'] =
"menuaction:'property.uilookup.response_template',"
+ ."second_display:true,"
+ ."type:'response_template',"
+ ."cat_id:'{$this->cat_id}',"
+ ."query:'{$this->query}',"
+ ."filter:'{$this->filter}'";
+
+ $datatable['actions']['form'] = array
+ (
+ array
+ (
+ 'action' =>
$GLOBALS['phpgw']->link('/index.php',
+ array
+ (
+ 'menuaction'
=> 'property.uilookup.response_template',
+
'second_display' => true,
+ 'cat_id'
=> $this->cat_id,
+ 'query'
=> $this->query,
+ 'filter'
=> $this->filter,
+ 'type'
=> 'response_template'
+ )
+ ),
+ 'fields' => array
+ (
+ 'field' => array
+ (
+ array
+ ( //boton
SEARCH
+ 'id' =>
'btn_search',
+ 'name'
=> 'search',
+ 'value'
=> lang('search'),
+ 'type'
=> 'button',
+
'tab_index' => 2
+ ),
+ array
+ ( // TEXT IMPUT
+ 'name'
=> 'query',
+ 'id'
=> 'txt_query',
+ 'value'
=> '',//'',//$query,
+ 'type'
=> 'text',
+ 'size'
=> 28,
+
'onkeypress' => 'return pulsar(event)',
+
'tab_index' => 1
+ )
+ ),
+ 'hidden_value' => array
+ (
+ )
+ )
+ )
+ );
+ }
+
+ $uicols = array (
+ 'input_type' =>
array('text','text','text'),
+ 'name' =>
array('id','name','content'),
+ 'formatter' => array('','',''),
+ 'descr' =>
array(lang('ID'),lang('name'),lang('content'))
+ );
+
+ $template_list = array();
+ $bo = CreateObject('property.bogeneric',true);
+ $template_list = $bo->read();
+
+ $content = array();
+ $j=0;
+ if (isset($template_list) && is_array($template_list))
+ {
+ foreach($template_list as $template_entry)
+ {
+ for
($i=0;$i<count($uicols['name']);$i++)
+ {
+
$datatable['rows']['row'][$j]['column'][$i]['value'] =
$template_entry[$uicols['name'][$i]];
+
$datatable['rows']['row'][$j]['column'][$i]['name'] = $uicols['name'][$i];
+ }
+ $j++;
+ }
+ }
+
+ $uicols_count = count($uicols['descr']);
+ $datatable['rowactions']['action'] = array();
+ for ($i=0;$i<$uicols_count;$i++)
+ {
+ //all colums should be have formatter
+
$datatable['headers']['header'][$i]['formatter'] =
($uicols['formatter'][$i]==''? '""' : $uicols['formatter'][$i]);
+
+ $datatable['headers']['header'][$i]['name']
= $uicols['name'][$i];
+ $datatable['headers']['header'][$i]['text']
= $uicols['descr'][$i];
+ $datatable['headers']['header'][$i]['visible']
= true;
+ $datatable['headers']['header'][$i]['sortable']
= true;
+
$datatable['headers']['header'][$i]['sort_field'] =
$uicols['name'][$i];
+ }
+
+ $function_exchange_values = '';
+
+ $function_exchange_values .= 'var temp =
opener.document.getElementsByName("values[response_text]")[0].value;' ."\r\n";
+ $function_exchange_values .= 'if(temp){temp = temp +
"\n";}' ."\r\n";
+ $function_exchange_values .=
'opener.document.getElementsByName("values[response_text]")[0].value = temp +
data.getData("content");' ."\r\n";
+ $function_exchange_values .=
'opener.SmsCountKeyUp(160);' ."\r\n";
+
+ $function_exchange_values .= 'window.close()';
+
+ $datatable['exchange_values'] =
$function_exchange_values;
+ $datatable['valida'] = '';
+
+ // path for property.js
+ $datatable['property_js'] =
$GLOBALS['phpgw_info']['server']['webserver_url']."/property/js/yahoo/property.js";
+
+ // Pagination and sort values
+ $datatable['pagination']['records_start'] =
(int)$this->start;
+ $datatable['pagination']['records_limit'] =
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'];
+ $datatable['pagination']['records_returned']=
count($template_list);
+ $datatable['pagination']['records_total'] =
$this->bo->total_records;
+
+ if ( (phpgw::get_var("start")== "") &&
(phpgw::get_var("order",'string')== ""))
+ {
+ $datatable['sorting']['order']
= 'id'; // name key Column in myColumnDef
+ $datatable['sorting']['sort']
= 'name'; // ASC / DESC
+ }
+ else
+ {
+ $datatable['sorting']['order']
= phpgw::get_var('order', 'string'); // name of column of Database
+ $datatable['sorting']['sort']
= phpgw::get_var('sort', 'string'); // ASC / DESC
+ }
+
+ $appname
= lang('template');
+ $function_msg =
lang('list response template');
+
+
+ //-- BEGIN----------------------------- JSON CODE
------------------------------
+
+ //values for Pagination
+ $json = array
+ (
+ 'recordsReturned' =>
$datatable['pagination']['records_returned'],
+ 'totalRecords' =>
(int)$datatable['pagination']['records_total'],
+ 'startIndex' =>
$datatable['pagination']['records_start'],
+ 'sort' =>
$datatable['sorting']['order'],
+ 'dir' =>
$datatable['sorting']['sort'],
+ 'records' =>
array()
+ );
+
+ // values for datatable
+ if(isset($datatable['rows']['row']) &&
is_array($datatable['rows']['row'])){
+ foreach( $datatable['rows']['row'] as $row )
+ {
+ $json_row = array();
+ foreach( $row['column'] as $column)
+ {
+ if(isset($column['format']) &&
$column['format']== "link" && $column['java_link']==true)
+ {
+
$json_row[$column['name']] = "<a href='#' id='".$column['link']."'
onclick='javascript:filter_data(this.id);'>" .$column['value']."</a>";
+ }
+ else
if(isset($column['format']) && $column['format']== "link")
+ {
+
$json_row[$column['name']] = "<a href='".$column['link']."' target='_blank'>"
.$column['value']."</a>";
+ }
+ else
+ {
+
$json_row[$column['name']] = $column['value'];
+ }
+ }
+ $json['records'][] = $json_row;
+ }
+ }
+
+ // right in datatable
+ if(isset($datatable['rowactions']['action']) &&
is_array($datatable['rowactions']['action']))
+ {
+ $json['rights'] =
$datatable['rowactions']['action'];
+ }
+
+ if( phpgw::get_var('phpgw_return_as') == 'json' )
+ {
+ return $json;
+ }
+
+ $datatable['json_data'] = json_encode($json);
+ //-------------------- JSON CODE ----------------------
+
+ // Prepare template variables and process XSLT
+ $template_vars = array();
+ $template_vars['datatable'] = $datatable;
+
$GLOBALS['phpgw']->xslttpl->add_file(array('datatable'));
+ $GLOBALS['phpgw']->xslttpl->set_var('phpgw',
$template_vars);
+
+
+ //Title of Page
+ $GLOBALS['phpgw_info']['flags']['app_header'] =
lang('property') . ' - ' . $appname . ': ' . $function_msg;
+
+ // Prepare YUI Library
+ $GLOBALS['phpgw']->js->validate_file( 'yahoo',
'lookup.tenant.index', 'property' );
+
+ $this->save_sessiondata();
+ }
+
+
+
}
Modified: branches/Version-1_0-branch/property/inc/class.uitts.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.uitts.inc.php
2011-01-07 14:10:06 UTC (rev 6734)
+++ branches/Version-1_0-branch/property/inc/class.uitts.inc.php
2011-01-07 14:21:07 UTC (rev 6735)
@@ -2010,6 +2010,8 @@
$GLOBALS['phpgw']->xslttpl->add_file(array('tts',
'files'));
+ $historylog =
CreateObject('property.historylog','tts');
+
if(isset($values['save']))
{
if(!$this->acl_edit)
@@ -2087,6 +2089,22 @@
}
}
//
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=>
'property.uitts.index'));
+
+
+ if( phpgw::get_var('notify_client_by_sms',
'bool')
+ && isset($values['response_text'])
+ && $values['response_text']
+ && phpgw::get_var('to_sms_phone'))
+ {
+ $to_sms_phone =
phpgw::get_var('to_sms_phone');
+ // $ticket['contact_phone'] =
$to_sms_phone;
+
+ $sms = CreateObject('sms.sms');
+
$sms->websend2pv($this->account,$to_sms_phone,$values['response_text']);
+
$historylog->add('MS',$id,"{$to_sms_phone}::{$values['response_text']}");
+ }
+
+
}
//---------end files
$ticket = $this->bo->read_single($id);
@@ -2337,8 +2355,6 @@
if($vendor_email)
{
- $historylog =
CreateObject('property.historylog','tts');
-
$subject = lang(workorder).":
{$ticket['order_id']}";
$organisation = '';
@@ -2572,6 +2588,8 @@
foreach($additional_notes as &$note)
{
$note['order_text'] = '<input
type="checkbox" name="values[order_text][]" value="'.$note['value_note'].'"
title="'.lang('Check to add text to order').'">';
+
+
}
}
@@ -2692,6 +2710,8 @@
$order_catetory =
$this->cats->formatted_xslt_list(array('select_name' =>
'values[cat_id]','selected' => $ticket['order_cat_id']));
$data = array
(
+ 'send_response'
=> isset($this->bo->config->config_data['tts_send_response']) ?
$this->bo->config->config_data['tts_send_response'] : '',
+ 'value_sms_phone'
=> $ticket['contact_phone'],
'access_order'
=> $access_order,
'currency'
=>
$GLOBALS['phpgw_info']['user']['preferences']['common']['currency'],
'value_order_id'
=> $ticket['order_id'],
@@ -2752,6 +2772,7 @@
'lang_no_cat'
=> lang('no category'),
'value_cat_id'
=> $this->cat_id,
'cat_select'
=> $cat_select,
+
'value_category_name'
=> $ticket['category_name'],
'form_action'
=> $GLOBALS['phpgw']->link('/index.php',$form_link),
Modified: branches/Version-1_0-branch/property/js/yahoo/tts.view.js
===================================================================
--- branches/Version-1_0-branch/property/js/yahoo/tts.view.js 2011-01-07
14:10:06 UTC (rev 6734)
+++ branches/Version-1_0-branch/property/js/yahoo/tts.view.js 2011-01-07
14:21:07 UTC (rev 6735)
@@ -58,6 +58,42 @@
}
+ function SmsCountKeyUp(maxChar)
+ {
+ var msg =
document.getElementsByName("values[response_text]")[0];
+ var left = document.forms.form.charNumberLeftOutput;
+ var smsLenLeft = maxChar - msg.value.length;
+ if (smsLenLeft >= 0)
+ {
+ left.value = smsLenLeft;
+ }
+ else
+ {
+ var msgMaxLen = maxChar;
+ left.value = 0;
+ msg.value = msg.value.substring(0, msgMaxLen);
+ }
+ }
+
+ function SmsCountKeyDown(maxChar)
+ {
+ var msg =
document.getElementsByName("values[response_text]")[0];
+ var left = document.forms.form.charNumberLeftOutput;
+ var smsLenLeft = maxChar - msg.value.length;
+ if (smsLenLeft >= 0)
+ {
+ left.value = smsLenLeft;
+ }
+ else
+ {
+ var msgMaxLen = maxChar;
+ left.value = 0;
+ msg.value = msg.value.substring(0, msgMaxLen);
+ }
+ }
+
+
+
this.fetch_vendor_email=function()
{
// formObject = document.body.getElementsByTagName('form');
Modified: branches/Version-1_0-branch/property/setup/setup.inc.php
===================================================================
--- branches/Version-1_0-branch/property/setup/setup.inc.php 2011-01-07
14:10:06 UTC (rev 6734)
+++ branches/Version-1_0-branch/property/setup/setup.inc.php 2011-01-07
14:21:07 UTC (rev 6735)
@@ -12,7 +12,7 @@
*/
$setup_info['property']['name'] = 'property';
- $setup_info['property']['version'] = '0.9.17.602';
+ $setup_info['property']['version'] = '0.9.17.603';
$setup_info['property']['app_order'] = 8;
$setup_info['property']['enable'] = 1;
$setup_info['property']['app_group'] = 'office';
@@ -169,6 +169,7 @@
'fm_orders',
'fm_order_dim1',
'fm_order_template',
+ 'fm_response_template',
'fm_s_agreement',
'fm_s_agreement_budget',
'fm_s_agreement_category',
Modified: branches/Version-1_0-branch/property/setup/tables_current.inc.php
===================================================================
--- branches/Version-1_0-branch/property/setup/tables_current.inc.php
2011-01-07 14:10:06 UTC (rev 6734)
+++ branches/Version-1_0-branch/property/setup/tables_current.inc.php
2011-01-07 14:21:07 UTC (rev 6735)
@@ -1774,6 +1774,21 @@
'ix' => array(),
'uc' => array()
),
+ 'fm_response_template' => array(
+ 'fd' => array(
+ 'id' => array('type' => 'auto', 'precision' =>
4,'nullable' => False),
+ 'name' => array('type' => 'varchar',
'precision' => 200,'nullable' => False),
+ 'content' => array('type' => 'text','nullable'
=> True),
+ 'public' => array('type' => 'int', 'precision'
=> 2,'nullable' => True),
+ 'user_id' => array('type' => 'int', 'precision'
=> 4,'nullable' => True),
+ 'entry_date' => array('type' => 'int',
'precision' => 4,'nullable' => True),
+ 'modified_date' => array('type' => 'int',
'precision' => 4,'nullable' => True),
+ ),
+ 'pk' => array('id'),
+ 'fk' => array(),
+ 'ix' => array(),
+ 'uc' => array()
+ ),
'fm_s_agreement' => array(
'fd' => array(
'id' => array('type' => 'int', 'precision' =>
4,'nullable' => False,'default' => '0'),
Modified: branches/Version-1_0-branch/property/setup/tables_update.inc.php
===================================================================
--- branches/Version-1_0-branch/property/setup/tables_update.inc.php
2011-01-07 14:10:06 UTC (rev 6734)
+++ branches/Version-1_0-branch/property/setup/tables_update.inc.php
2011-01-07 14:21:07 UTC (rev 6735)
@@ -4801,3 +4801,40 @@
return $GLOBALS['setup_info']['property']['currentver'];
}
}
+
+ /**
+ * Update property version from 0.9.17.602 to 0.9.17.603
+ * Add templates to response from helpdesk
+ *
+ */
+
+ $test[] = '0.9.17.602';
+ function property_upgrade0_9_17_602()
+ {
+ $GLOBALS['phpgw_setup']->oProc->m_odb->transaction_begin();
+
+ $GLOBALS['phpgw_setup']->oProc->CreateTable(
+ 'fm_response_template', array(
+ 'fd' => array(
+ 'id' => array('type' => 'auto',
'precision' => 4,'nullable' => False),
+ 'name' => array('type' => 'varchar',
'precision' => 200,'nullable' => False),
+ 'content' => array('type' =>
'text','nullable' => True),
+ 'public' => array('type' => 'int',
'precision' => 2,'nullable' => True),
+ 'user_id' => array('type' => 'int',
'precision' => 4,'nullable' => True),
+ 'entry_date' => array('type' => 'int',
'precision' => 4,'nullable' => True),
+ 'modified_date' => array('type' =>
'int', 'precision' => 4,'nullable' => True),
+ ),
+ 'pk' => array('id'),
+ 'fk' => array(),
+ 'ix' => array(),
+ 'uc' => array()
+ )
+ );
+
+ if($GLOBALS['phpgw_setup']->oProc->m_odb->transaction_commit())
+ {
+ $GLOBALS['setup_info']['property']['currentver'] =
'0.9.17.603';
+ return $GLOBALS['setup_info']['property']['currentver'];
+ }
+ }
+
Modified: branches/Version-1_0-branch/property/templates/base/config.tpl
===================================================================
--- branches/Version-1_0-branch/property/templates/base/config.tpl
2011-01-07 14:10:06 UTC (rev 6734)
+++ branches/Version-1_0-branch/property/templates/base/config.tpl
2011-01-07 14:21:07 UTC (rev 6735)
@@ -343,6 +343,16 @@
</tr>
<tr class="row_off">
+ <td>{lang_send_response_TTS}.</td>
+ <td>
+ <select name="newsettings[tts_send_response]">
+ <option value=""
{selected_tts_send_response_}>NO</option>
+ <option value="1"
{selected_tts_send_response_1}>YES</option>
+ </select>
+ </td>
+ </tr>
+
+ <tr class="row_off">
<td>{lang_Ask_for_workorder_approval_by_e-mail}.</td>
<td>
<select name="newsettings[workorder_approval]">
Modified: branches/Version-1_0-branch/property/templates/base/tts.xsl
===================================================================
--- branches/Version-1_0-branch/property/templates/base/tts.xsl 2011-01-07
14:10:06 UTC (rev 6734)
+++ branches/Version-1_0-branch/property/templates/base/tts.xsl 2011-01-07
14:21:07 UTC (rev 6735)
@@ -760,20 +760,26 @@
self.name="first_Window";
function generate_order()
{
- Window1=window.open('<xsl:value-of
select="order_link"/>');
+ Window1=window.open('<xsl:value-of
select="order_link"/>');
}
+
function generate_request()
{
- Window1=window.open('<xsl:value-of
select="request_link"/>');
+ Window1=window.open('<xsl:value-of
select="request_link"/>');
}
function template_lookup()
{
- var oArgs =
{menuaction:'property.uilookup.order_template',type:'order_template'};
+ var oArgs =
{menuaction:'property.uilookup.order_template',type:'order_template'};
+ var strURL = phpGWLink('index.php', oArgs);
+
Window1=window.open(strURL,"Search","width=800,height=700,toolbar=no,scrollbars=yes,resizable=yes");
+ }
- var strURL = phpGWLink('index.php', oArgs);
-
-
Window1=window.open(strURL,"Search","width=800,height=700,toolbar=no,scrollbars=yes,resizable=yes");
+ function response_lookup()
+ {
+ var oArgs =
{menuaction:'property.uilookup.response_template',type:'response_template'};
+ var strURL = phpGWLink('index.php', oArgs);
+
Window1=window.open(strURL,"Search","width=800,height=700,toolbar=no,scrollbars=yes,resizable=yes");
}
</script>
<table cellpadding="2" cellspacing="2" width="95%"
align="center">
@@ -1092,7 +1098,63 @@
<xsl:call-template name="file_upload"/>
</xsl:when>
</xsl:choose>
+ <xsl:choose>
+ <xsl:when test="send_response = 1">
+ <tr>
+ <td class="th_text"
align="left">
+ <xsl:value-of
select="php:function('lang', 'notify client by sms')" />
+ </td>
+ <td align="left">
+ <table>
+ <tr>
+ <td>
+
<input type="checkbox" name="notify_client_by_sms" value="true">
+
<xsl:attribute name="title">
+
<xsl:value-of select="value_sms_client_order_notice"/>
+
</xsl:attribute>
+
</input>
+ </td>
+ <td>
+
<input type="text" name="to_sms_phone" value="{value_sms_phone}">
+
<xsl:attribute name="title">
+
<xsl:value-of select="value_sms_client_order_notice"/>
+
</xsl:attribute>
+
</input>
+ </td>
+ </tr>
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td valign="top">
+ <a
href="javascript:response_lookup()" >
+ <xsl:attribute
name="title">
+
<xsl:value-of select="php:function('lang', 'response')" />
+
</xsl:attribute>
+ <xsl:value-of
select="php:function('lang', 'response')" />
+ </a>
+ </td>
+ <td>
+ <textarea
cols="{textareacols}" rows="{textarearows}" id='response_text'
name="values[response_text]" onKeyUp="javascript: SmsCountKeyUp(160);"
onKeyDown="javascript: SmsCountKeyDown(160);" wrap="virtual">
+ <xsl:attribute
name="title">
+
<xsl:value-of select="php:function('lang', 'response')" />
+ </xsl:attribute>
+ <xsl:value-of
select="value_order_descr"/>
+ </textarea>
+ </td>
+ </tr>
+ <tr>
+ <td>
+ <xsl:value-of
select="php:function('lang', 'character left')" />
+ </td>
+ <td>
+ <input type="text"
readonly='readonly' size="3" maxlength="3" name="charNumberLeftOutput"
id="charNumberLeftOutput" value="160">
+ </input>
+ </td>
+ </tr>
+ </xsl:when>
+ </xsl:choose>
<xsl:choose>
<xsl:when test="access_order = 1">
<xsl:choose>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [6735] Merge 6731:6734 from trunk,
Sigurd Nes <=