[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [15400] ACL: refine query
From: |
sigurdne |
Subject: |
[Fmsystem-commits] [15400] ACL: refine query |
Date: |
Tue, 2 Aug 2016 15:54:49 +0000 (UTC) |
Revision: 15400
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=15400
Author: sigurdne
Date: 2016-08-02 15:54:49 +0000 (Tue, 02 Aug 2016)
Log Message:
-----------
ACL: refine query
Modified Paths:
--------------
trunk/helpdesk/inc/class.botts.inc.php
trunk/helpdesk/inc/class.menu.inc.php
trunk/helpdesk/inc/class.sotts.inc.php
trunk/helpdesk/inc/class.uitts.inc.php
trunk/helpdesk/setup/phpgw_no.lang
trunk/helpdesk/templates/base/config.tpl
trunk/helpdesk/templates/base/tts.xsl
trunk/phpgwapi/inc/class.acl.inc.php
trunk/preferences/inc/class.boadmin_acl.inc.php
trunk/property/inc/class.boadmin.inc.php
trunk/property/inc/class.custom_fields.inc.php
trunk/property/inc/class.uiadmin.inc.php
trunk/property/templates/base/admin.xsl
Modified: trunk/helpdesk/inc/class.botts.inc.php
===================================================================
--- trunk/helpdesk/inc/class.botts.inc.php 2016-08-01 13:31:53 UTC (rev
15399)
+++ trunk/helpdesk/inc/class.botts.inc.php 2016-08-02 15:54:49 UTC (rev
15400)
@@ -437,11 +437,13 @@
return $tickets;
}
- function read_single($id)
+ function read_single($id, $values = array(), $view = false )
{
$this->so->update_view($id);
- $ticket = $this->so->read_single($id);
+ $values['attributes'] = $this->get_custom_cols();
+ $ticket = $this->so->read_single($id, $values);
+ $ticket = $this->custom->prepare($ticket, 'helpdesk',
'.ticket', $view);
$ticket['user_lid'] =
$GLOBALS['phpgw']->accounts->id2name($ticket['user_id']);
$ticket['group_lid'] =
$GLOBALS['phpgw']->accounts->id2name($ticket['group_id']);
@@ -657,59 +659,67 @@
return $record_history;
}
- function add($ticket)
+ function add( $data, $values_attribute = array() )
{
- if((!isset($ticket['location_code']) || !
$ticket['location_code']) && isset($ticket['location']) &&
is_array($ticket['location']))
+
+ $data['finnish_date'] =
$this->bocommon->date_to_timestamp($data['finnish_date']);
+
+ if ($values_attribute && is_array($values_attribute))
{
- while (is_array($ticket['location']) &&
list(,$value) = each($ticket['location']))
+ $values_attribute =
$this->custom->convert_attribute_save($values_attribute);
+ }
+
+ $criteria = array
+ (
+ 'appname' => 'helpdesk',
+ 'location' => $this->acl_location,
+ 'allrows' => true
+ );
+
+ $custom_functions =
$GLOBALS['phpgw']->custom_functions->find($criteria);
+
+ foreach ($custom_functions as $entry)
+ {
+ // prevent path traversal
+ if (preg_match('/\.\./', $entry['file_name']))
{
- if($value)
- {
- $location[] = $value;
- }
+ continue;
}
- $ticket['location_code']=implode("-",
$location);
+
+ $file = PHPGW_SERVER_ROOT .
"/helpdesk/inc/custom/{$GLOBALS['phpgw_info']['user']['domain']}/{$entry['file_name']}";
+ if ($entry['active'] && is_file($file) &&
!$entry['client_side'] && $entry['pre_commit'])
+ {
+ require $file;
+ }
}
- $ticket['finnish_date'] =
$this->bocommon->date_to_timestamp($ticket['finnish_date']);
+ $receipt = $this->so->add($data, $values_attribute);
- $receipt = $this->so->add($ticket);
-
$this->config->read();
- if ( (isset($ticket['send_mail']) &&
$ticket['send_mail'])
- ||
(isset($this->config->config_data['mailnotification'])
- &&
$this->config->config_data['mailnotification'])
+ if ((isset($data['send_mail']) && $data['send_mail'])
|| (isset($this->config->config_data['mailnotification']) &&
$this->config->config_data['mailnotification'])
)
{
- $receipt_mail =
$this->mail_ticket($receipt['id'],false,$receipt,$ticket['location_code']);
+ $receipt_mail =
$this->mail_ticket($receipt['id'], false, $receipt, $data['location_code'],
false, isset($data['send_mail']) && $data['send_mail'] ? true : false);
}
- $criteria = array
- (
- 'appname' => 'helpdesk',
- 'location' => $this->acl_location,
- 'allrows' => true
- );
-
- $custom_functions =
$GLOBALS['phpgw']->custom_functions->find($criteria);
-
- foreach ( $custom_functions as $entry )
+ reset($custom_functions);
+ foreach ($custom_functions as $entry)
{
// prevent path traversal
- if ( preg_match('/\.\./', $entry['file_name']) )
+ if (preg_match('/\.\./', $entry['file_name']))
{
continue;
}
$file = PHPGW_SERVER_ROOT .
"/helpdesk/inc/custom/{$GLOBALS['phpgw_info']['user']['domain']}/{$entry['file_name']}";
- if ( $entry['active'] && is_file($file) )
+ if ($entry['active'] && is_file($file) &&
!$entry['client_side'] && !$entry['pre_commit'])
{
require_once $file;
}
}
- if(isset($receipt_mail) && is_array($receipt_mail))
+ if (isset($receipt_mail) && is_array($receipt_mail))
{
$receipt = array_merge($receipt, $receipt_mail);
}
Modified: trunk/helpdesk/inc/class.menu.inc.php
===================================================================
--- trunk/helpdesk/inc/class.menu.inc.php 2016-08-01 13:31:53 UTC (rev
15399)
+++ trunk/helpdesk/inc/class.menu.inc.php 2016-08-02 15:54:49 UTC (rev
15400)
@@ -72,6 +72,18 @@
'text' =>
lang('Configuration'),
'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'admin.uiconfig.index', 'appname' => 'helpdesk') )
),
+ 'ticket_attribs' => array
+ (
+ 'text' => lang('ticket
Attributes'),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'admin.ui_custom.list_attribute',
+ 'appname' =>
'helpdesk', 'location' => '.ticket', 'menu_selection' =>
'admin::helpdesk::ticket_attribs'))
+ ),
+ 'ticket_functions' => array
+ (
+ 'text' => lang('custom
functions'),
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'admin.ui_custom.list_custom_function',
+ 'appname' =>
'helpdesk', 'location' => '.ticket', 'menu_selection' =>
'admin::helpdesk::ticket_functions'))
+ ),
'ticket_cats' => array
(
'text' => lang('Ticket
Categories'),
@@ -102,7 +114,7 @@
array
(
'text' =>
$GLOBALS['phpgw']->translation->translate('Grant Access', array(), true),
- 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'helpdesk.uiadmin.aclprefs', 'acl_app'=> 'helpdesk'))
+ 'url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'property.uiadmin.aclprefs', 'acl_app'=> 'helpdesk'))
)
);
Modified: trunk/helpdesk/inc/class.sotts.inc.php
===================================================================
--- trunk/helpdesk/inc/class.sotts.inc.php 2016-08-01 13:31:53 UTC (rev
15399)
+++ trunk/helpdesk/inc/class.sotts.inc.php 2016-08-02 15:54:49 UTC (rev
15400)
@@ -175,15 +175,6 @@
$where= 'AND';
}
-
if(isset($GLOBALS['phpgw']->config->config_data['acl_at_location']) &&
$GLOBALS['phpgw']->config->config_data['acl_at_location'])
- {
- $access_location =
execMethod('property.socommon.get_location_list', PHPGW_ACL_READ);
- if($access_location)
- {
- $filtermethod .= " $where
phpgw_helpdesk_tickets.loc1 in ('" . implode("','", $access_location) . "')";
- $where= 'AND';
- }
- }
if (is_array($this->grants))
{
@@ -219,12 +210,6 @@
}
}
- if($tenant_id =
$GLOBALS['phpgw']->session->appsession('tenant_id','helpdesk'))
- {
- $filtermethod .= $where . '
phpgw_helpdesk_tickets.tenant_id=' . $tenant_id;
- $where = 'AND';
- }
-
if ($status_id == 'X')
{
$closed = '';
@@ -347,7 +332,6 @@
. " $filtermethod $querymethod";
$sql2 = "SELECT count(*) as cnt FROM ({$sql}) as t";
- _debug_array($sql2);
$this->db->query($sql2,__LINE__,__FILE__);
$this->db->next_record();
$this->total_records = $this->db->f('cnt');
@@ -356,6 +340,10 @@
$tickets = array();
if(!$dry_run)
{
+ $location_id =
$GLOBALS['phpgw']->locations->get_id('helpdesk', '.ticket');
+ $custom_cols = $this->custom->find('helpdesk',
'.ticket', 0, '', 'ASC', 'attrib_sort', true, true);
+ $_return_field_array = array();
+
if(!$allrows)
{
$this->db->limit_query($sql .
$ordermethod,$start,__LINE__,__FILE__);
@@ -374,29 +362,40 @@
unset($_fetch_single);
}
+ $i = 0;
while ($this->db->next_record())
{
$tickets[]= array
- (
- 'id'
=> (int) $this->db->f('id'),
- 'subject'
=> $this->db->f('subject',true),
- 'user_id'
=> $this->db->f('user_id'),
- 'assignedto'
=> $this->db->f('assignedto'),
- 'status'
=> $this->db->f('status'),
- 'priority'
=> $this->db->f('priority'),
- 'cat_id'
=> $this->db->f('cat_id'),
- 'group_id'
=> $this->db->f('group_id'),
- 'entry_date'
=> $this->db->f('entry_date'),
- 'modified_date'
=> $this->db->f('modified_date'),
- 'finnish_date'
=> $this->db->f('finnish_date'),
- 'finnish_date2'
=> $this->db->f('finnish_date2'),
- 'order_id'
=> $this->db->f('order_id'),
- 'vendor_id'
=> $this->db->f('vendor_id'),
- 'actual_cost'
=> $this->db->f('actual_cost'),
- 'estimate'
=> $this->db->f('budget'),
- 'new_ticket'
=> $this->db->f('view') ? false : true,
- 'billable_hours'
=> $this->db->f('billable_hours'),
- );
+ (
+ 'id'
=> (int) $this->db->f('id'),
+ 'subject'
=> $this->db->f('subject',true),
+ 'user_id'
=> $this->db->f('user_id'),
+ 'assignedto' =>
$this->db->f('assignedto'),
+ 'status'
=> $this->db->f('status'),
+ 'priority'
=> $this->db->f('priority'),
+ 'cat_id'
=> $this->db->f('cat_id'),
+ 'group_id'
=> $this->db->f('group_id'),
+ 'entry_date' =>
$this->db->f('entry_date'),
+ 'modified_date' =>
$this->db->f('modified_date'),
+ 'finnish_date' =>
$this->db->f('finnish_date'),
+ 'finnish_date2' =>
$this->db->f('finnish_date2'),
+ 'order_id'
=> $this->db->f('order_id'),
+ 'vendor_id'
=> $this->db->f('vendor_id'),
+ 'actual_cost' =>
$this->db->f('actual_cost'),
+ 'estimate'
=> $this->db->f('budget'),
+ 'new_ticket' =>
$this->db->f('view') ? false : true,
+ 'billable_hours' =>
$this->db->f('billable_hours'),
+ );
+ foreach ($custom_cols as $custom_col)
+ {
+ if ($custom_value =
$this->db->f($custom_col['column_name'], true))
+ {
+ $custom_value =
$this->custom->get_translated_value(array('value' => $custom_value,
+ 'attrib_id' =>
$custom_col['id'], 'datatype' => $custom_col['datatype']), $location_id);
+ }
+
$tickets[$i][$custom_col['column_name']] = $custom_value;
+ }
+ $i ++;
}
}
@@ -428,7 +427,7 @@
return $entity;
}
- function read_single($id)
+ function read_single($id, $values = array() )
{
$id = (int) $id;
$sql = "SELECT * FROM phpgw_helpdesk_tickets WHERE id =
{$id}";
@@ -477,6 +476,15 @@
{
$ticket['assignedto_name'] =
$GLOBALS['phpgw']->accounts->get($ticket['assignedto'])->__toString();
}
+
+ if (isset($values['attributes']) &&
is_array($values['attributes']))
+ {
+ $ticket['attributes'] =
$values['attributes'];
+ foreach ($ticket['attributes'] as
&$attr)
+ {
+ $attr['value'] =
$this->db->f($attr['column_name']);
+ }
+ }
}
return $ticket;
@@ -928,10 +936,10 @@
$value_set =
$this->db->validate_update($value_set);
$this->db->query("update phpgw_helpdesk_tickets
set $value_set where id='$id'", __LINE__, __FILE__);
- $this->historylog->add('G', $id,
$ticket['group_id'], $oldgroup_id);
+ $this->historylog->add('G', $id,
(int)$ticket['group_id'], $oldgroup_id);
}
- if ($oldpriority != $ticket['priority'])
+ if ($ticket['priority'] && $oldpriority !=
$ticket['priority'])
{
$this->fields_updated[] = 'priority';
$this->db->query("update phpgw_helpdesk_tickets
set priority='" . $ticket['priority']
@@ -1138,7 +1146,7 @@
'deadline'
=> ''
);
-
execMethod('helpdesk.sopending_action.close_pending_action', $action_params);
+
execMethod('property.sopending_action.close_pending_action', $action_params);
unset($action_params);
}
if ($this->db->f('in_progress') )
@@ -1155,7 +1163,7 @@
'deadline'
=> ''
);
-
execMethod('helpdesk.sopending_action.close_pending_action', $action_params);
+
execMethod('property.sopending_action.close_pending_action', $action_params);
unset($action_params);
}
Modified: trunk/helpdesk/inc/class.uitts.inc.php
===================================================================
--- trunk/helpdesk/inc/class.uitts.inc.php 2016-08-01 13:31:53 UTC (rev
15399)
+++ trunk/helpdesk/inc/class.uitts.inc.php 2016-08-02 15:54:49 UTC (rev
15400)
@@ -285,18 +285,6 @@
$name[] = 'entry_date';
$name[] = 'status';
- if( $this->acl->check('.ticket.order', PHPGW_ACL_READ,
'helpdesk') )
- {
- $name[] = 'order_id';
- $name[] = 'vendor';
- }
-
- if( $this->acl->check('.ticket.order', PHPGW_ACL_ADD,
'helpdesk') )
- {
- $name[] = 'estimate';
- $name[] = 'actual_cost';
- }
-
$uicols_related = $this->bo->uicols_related;
foreach($uicols_related as $related)
@@ -322,12 +310,14 @@
array_push($descr,$_name);
}
- $name[] = 'finnish_date';
- $name[] = 'delay';
+ if($this->_show_finnish_date)
+ {
+ $name[] = 'finnish_date';
+ $name[] = 'delay';
+ array_push($descr,lang('finnish
date'),lang('delay'));
+ }
- array_push($descr,lang('finnish date'),lang('delay'));
-
$custom_cols =
isset($GLOBALS['phpgw_info']['user']['preferences']['helpdesk']['ticket_columns'])
? $GLOBALS['phpgw_info']['user']['preferences']['helpdesk']['ticket_columns']
: array();
foreach ($custom_cols as $col)
@@ -1034,8 +1024,10 @@
}
}
+ $disable_userassign_on_add =
isset($this->bo->config->config_data['tts_disable_userassign_on_add']) ?
$this->bo->config->config_data['tts_disable_userassign_on_add'] : false;
+ $disable_groupassign_on_add =
isset($this->bo->config->config_data['tts_disable_groupassign_on_add']) ?
$this->bo->config->config_data['tts_disable_groupassign_on_add'] : false;
- if (!$values['assignedto'] &&
!$values['group_id'])
+ if (!$values['assignedto'] &&
!$values['group_id'] && !$disable_userassign_on_add &&
!$disable_groupassign_on_add)
{
$receipt['error'][] = array('msg' =>
lang('Please select a person or a group to handle the ticket !'));
}
@@ -1194,7 +1186,7 @@
$msgbox_data = (isset($receipt) ?
$this->bocommon->msgbox_data($receipt) : '');
- if (!$this->simple && $this->show_finnish_date)
+ if (!$this->simple && $this->_show_finnish_date)
{
$GLOBALS['phpgw']->jqcal->add_listener('values_finnish_date');
}
@@ -1210,13 +1202,14 @@
$tabs['add'] = array('label' => lang('Add'), 'link' =>
'#add');
$active_tab = 'add';
+
$data = array(
'my_groups' => json_encode($my_groups),
'custom_attributes' => array('attributes' =>
$values['attributes']),
'lookup_functions' =>
isset($values['lookup_functions']) ? $values['lookup_functions'] : '',
'contact_data' => $contact_data,
'simple' => $this->simple,
- 'show_finnish_date' => $this->show_finnish_date,
+ 'show_finnish_date' =>
$this->_show_finnish_date,
'value_origin' => isset($values['origin_data'])
? $values['origin_data'] : '',
'value_origin_type' => (isset($origin) ?
$origin : ''),
'value_origin_id' => (isset($origin_id) ?
$origin_id : ''),
@@ -1224,8 +1217,10 @@
'lang_no_user' => lang('Select user'),
'lang_user_statustext' => lang('Select the user
the selection belongs to. To do not use a user select NO USER'),
'select_user_name' => 'values[assignedto]',
- 'user_list' =>
$this->bocommon->get_user_list_right2('select', 4, $values['assignedto'],
$this->acl_location),
+ 'user_list' =>
$this->_get_user_list($values['assignedto']),
'disable_userassign_on_add' =>
isset($this->bo->config->config_data['tts_disable_userassign_on_add']) ?
$this->bo->config->config_data['tts_disable_userassign_on_add'] : '',
+ 'disable_groupassign_on_add' =>
isset($this->bo->config->config_data['tts_disable_groupassign_on_add']) ?
$this->bo->config->config_data['tts_disable_groupassign_on_add'] : '',
+ 'disable_priority' =>
isset($this->bo->config->config_data['disable_priority']) ?
$this->bo->config->config_data['disable_priority'] : '',
'lang_no_group' => lang('No group'),
'group_list' =>
$this->bo->get_group_list($values['group_id']),
'select_group_name' => 'values[group_id]',
@@ -1553,7 +1548,7 @@
}
- if ($this->show_finnish_date)
+ if ($this->_show_finnish_date)
{
$GLOBALS['phpgw']->jqcal->add_listener('values_finnish_date');
}
@@ -1752,11 +1747,12 @@
'lookup_functions' =>
isset($ticket['lookup_functions']) ? $ticket['lookup_functions'] : '',
'simple' => $this->simple,
'send_response' =>
isset($this->bo->config->config_data['tts_send_response']) ?
$this->bo->config->config_data['tts_send_response'] : '',
+ 'disable_priority' =>
isset($this->bo->config->config_data['disable_priority']) ?
$this->bo->config->config_data['disable_priority'] : '',
'value_sms_phone' => $ticket['contact_phone'],
'value_budget' => $ticket['budget'],
'value_actual_cost' => $ticket['actual_cost'],
'contact_data' => $contact_data,
- 'show_finnish_date' => $this->show_finnish_date,
+ 'show_finnish_date' =>
$this->_show_finnish_date,
'tabs' => self::_generate_tabs(true),
'base_java_url' =>
"{menuaction:'helpdesk.uitts.update_data',id:{$id}}",
'location_item_id' => $id,
@@ -1770,7 +1766,7 @@
'lang_user_statustext' => lang('Select the user
the selection belongs to. To do not use a user select NO USER'),
'select_user_name' => 'values[assignedto]',
'value_assignedto_id' => $ticket['assignedto'],
- 'user_list' =>
$this->bocommon->get_user_list_right2('select', 4, $ticket['assignedto'],
$this->acl_location),
+ 'user_list' =>
$this->_get_user_list($values['assignedto']),
'lang_no_group' => lang('No group'),
'group_list' =>
$this->bo->get_group_list($ticket['group_id']),
'select_group_name' => 'values[group_id]',
@@ -1800,7 +1796,7 @@
'contact_phone' => $ticket['contact_phone'],
'pref_send_mail' =>
isset($GLOBALS['phpgw_info']['user']['preferences']['helpdesk']['tts_user_mailnotification'])
?
$GLOBALS['phpgw_info']['user']['preferences']['helpdesk']['tts_user_mailnotification']
: '',
'fileupload' =>
true,//isset($this->bo->config->config_data['fmttsfileupload']) ?
$this->bo->config->config_data['fmttsfileupload'] : '',
- 'multiple_uploader' => true,
+ // 'multiple_uploader' => true,
'fileuploader_action' =>
"{menuaction:'property.fileuploader.add',upload_target:'helpdesk.botts.addfiles',id:'{$id}'}",
'link_to_files' =>
isset($this->bo->config->config_data['files_url']) ?
$this->bo->config->config_data['files_url'] : '',
'files' => isset($ticket['files']) ?
$ticket['files'] : '',
@@ -1911,4 +1907,38 @@
}
}
+ private function _get_user_list($selected)
+ {
+ $xsl_rootdir = PHPGW_SERVER_ROOT .
"/property/templates/{$GLOBALS['phpgw_info']['server']['template_set']}";
+
+
$GLOBALS['phpgw']->xslttpl->add_file(array('user_id_select'), $xsl_rootdir);
+
+ $users =
$GLOBALS['phpgw']->acl->get_user_list_right(16, $this->acl_location,
'helpdesk');
+ $user_list = array();
+ $selected_found = false;
+ foreach ($users as $user)
+ {
+ $name = (isset($user['account_lastname']) ?
$user['account_lastname'] . ' ' : '') . $user['account_firstname'];
+ $user_list[] = array(
+ 'id' => $user['account_id'],
+ 'name' => $name,
+ 'selected' => $user['account_id'] ==
$selected ? 1 : 0
+ );
+
+ if (!$selected_found)
+ {
+ $selected_found = $user['account_id']
== $selected ? true : false;
+ }
+ }
+ if ($selected && !$selected_found)
+ {
+ $user_list[] = array
+ (
+ 'id' => $selected,
+ 'name' =>
$GLOBALS['phpgw']->accounts->get($selected)->__toString(),
+ 'selected' => 1
+ );
+ }
+ return $user_list;
+ }
}
Modified: trunk/helpdesk/setup/phpgw_no.lang
===================================================================
--- trunk/helpdesk/setup/phpgw_no.lang 2016-08-01 13:31:53 UTC (rev 15399)
+++ trunk/helpdesk/setup/phpgw_no.lang 2016-08-02 15:54:49 UTC (rev 15400)
@@ -39,10 +39,10 @@
prev helpdesk no Forrige
old value helpdesk no Forrige verdi
first helpdesk no Første
-first note added helpdesk no Første notat er registrert
+first note added helpdesk no Første notat
from helpdesk no Fra
general helpdesk no Generell
-notify helpdesk no Varsle
+notify helpdesk no Kopi til
re-opened helpdesk no Gjenåpnet
group helpdesk no Gruppe
action helpdesk no Handling
@@ -91,7 +91,7 @@
my submitted tickets helpdesk no Meldinger startet av meg
check to attach file helpdesk no Merk for å legge ved fil
check to delete file helpdesk no Merk for å slette fil
-note helpdesk no Merknad
+note helpdesk no Notat
method helpdesk no Metode
my assigned tickets helpdesk no Mine tildelte meldinger
failed to upload file ! helpdesk no Opplasting av fil feilet
@@ -101,7 +101,7 @@
next helpdesk no Neste
memo helpdesk no Notat
new helpdesk no Ny
-new note helpdesk no Ny kommentar
+new note helpdesk no Nytt notat
new value helpdesk no Ny verdi
ok helpdesk no OK
about helpdesk no Om
@@ -173,4 +173,5 @@
billable hours helpdesk no Egne timer
change to helpdesk no Endre til
do you really want to change the status to %1 helpdesk no Vil du
virkelig endre status til %1
-do you really want to change the priority to %1 helpdesk no
Vil du virkelig endre prioritet til %1
\ No newline at end of file
+do you really want to change the priority to %1 helpdesk no
Vil du virkelig endre prioritet til %1
+please enter a title! helpdesk no Angi en overskrift
\ No newline at end of file
Modified: trunk/helpdesk/templates/base/config.tpl
===================================================================
--- trunk/helpdesk/templates/base/config.tpl 2016-08-01 13:31:53 UTC (rev
15399)
+++ trunk/helpdesk/templates/base/config.tpl 2016-08-02 15:54:49 UTC (rev
15400)
@@ -29,6 +29,35 @@
{lang_default}: {lang_Open}</td>
<td><input name="newsettings[tts_lang_open]"
value="{value_tts_lang_open}"></td>
</tr>
+ <tr class="pure-table-odd">
+ <td >{lang_TTS_disable_assign_to_user_on_add}:</td>
+ <td>
+ <select
name="newsettings[tts_disable_userassign_on_add]">
+ <option value=""
{selected_tts_disable_userassign_on_add_}>NO</option>
+ <option value="1"
{selected_tts_disable_userassign_on_add_1}>YES</option>
+ </select>
+ </td>
+ </tr>
+ <tr class="pure-table-odd">
+ <td >{lang_TTS_disable_assign_to_group_on_add}:</td>
+ <td>
+ <select
name="newsettings[tts_disable_groupassign_on_add]">
+ <option value=""
{selected_tts_disable_groupassign_on_add_}>NO</option>
+ <option value="1"
{selected_tts_disable_groupassign_on_add_1}>YES</option>
+ </select>
+ </td>
+ </tr>
+ <tr class="pure-table-odd">
+ <td >{lang_TTS_disable_priority}:</td>
+ <td>
+ <select name="newsettings[disable_priority]">
+ <option value=""
{selected_disable_priority_}>NO</option>
+ <option value="1"
{selected_disable_priority_1}>YES</option>
+ </select>
+ </td>
+ </tr>
+
+
<tr class="row_on">
<td valign = 'top'>{lang_TTS_simplified_group}:</td>
<td>
Modified: trunk/helpdesk/templates/base/tts.xsl
===================================================================
--- trunk/helpdesk/templates/base/tts.xsl 2016-08-01 13:31:53 UTC (rev
15399)
+++ trunk/helpdesk/templates/base/tts.xsl 2016-08-02 15:54:49 UTC (rev
15400)
@@ -69,26 +69,26 @@
</div>
<xsl:choose>
<xsl:when test="simple !='1'">
- <div
class="pure-control-group">
- <label>
-
<xsl:value-of select="php:function('lang', 'Group')"/>
- </label>
+ <xsl:if
test="disable_groupassign_on_add !='1'">
+ <div
class="pure-control-group">
+ <label>
+
<xsl:value-of select="php:function('lang', 'Group')"/>
+ </label>
-
<xsl:call-template name="group_select"/>
- </div>
- <xsl:choose>
- <xsl:when
test="disable_userassign_on_add !='1'">
- <div
class="pure-control-group">
-
<label>
-
<xsl:value-of select="php:function('lang', 'Assign to')"/>
-
</label>
+
<xsl:call-template name="group_select"/>
+ </div>
+ </xsl:if>
+ <xsl:if
test="disable_userassign_on_add !='1'">
+ <div
class="pure-control-group">
+ <label>
+
<xsl:value-of select="php:function('lang', 'Assign to')"/>
+ </label>
-
<xsl:call-template name="user_id_select"/>
- </div>
- </xsl:when>
- </xsl:choose>
- <xsl:call-template
name="contact_form"/>
- <div
class="pure-control-group">
+
<xsl:call-template name="user_id_select"/>
+ </div>
+ </xsl:if>
+ <!--xsl:call-template
name="contact_form"/-->
+ <!--div
class="pure-control-group">
<label>
<xsl:value-of select="php:function('lang', 'Send e-mail')"/>
</label>
@@ -102,22 +102,24 @@
</xsl:attribute>
</xsl:if>
</input>
- </div>
- <div
class="pure-control-group">
- <label>
-
<xsl:value-of select="php:function('lang', 'Priority')"/>
- </label>
+ </div-->
+ <xsl:if
test="disable_priority !='1'">
+ <div
class="pure-control-group">
+ <label>
+
<xsl:value-of select="php:function('lang', 'Priority')"/>
+ </label>
- <xsl:variable
name="lang_priority_statustext">
-
<xsl:value-of select="lang_priority_statustext"/>
- </xsl:variable>
- <xsl:variable
name="select_priority_name">
-
<xsl:value-of select="select_priority_name"/>
- </xsl:variable>
- <select
name="{$select_priority_name}"
onMouseover="window.status='{$lang_priority_statustext}'; return true;"
onMouseout="window.status='';return true;">
-
<xsl:apply-templates select="priority_list/options"/>
- </select>
- </div>
+
<xsl:variable name="lang_priority_statustext">
+
<xsl:value-of select="lang_priority_statustext"/>
+
</xsl:variable>
+
<xsl:variable name="select_priority_name">
+
<xsl:value-of select="select_priority_name"/>
+
</xsl:variable>
+ <select
name="{$select_priority_name}" title="{$lang_priority_statustext}">
+
<xsl:apply-templates select="priority_list/options"/>
+
</select>
+ </div>
+ </xsl:if>
<div
class="pure-control-group">
<label>
<xsl:value-of select="php:function('lang', 'status')"/>
@@ -161,7 +163,7 @@
<xsl:text>required</xsl:text>
</xsl:attribute>
<xsl:attribute
name="data-validation-error-msg">
-
<xsl:value-of select="php:function('lang', 'Please enter a title !')"/>
+
<xsl:value-of select="php:function('lang', 'Please enter a title!')"/>
</xsl:attribute>
</xsl:if>
@@ -326,7 +328,7 @@
<xsl:value-of
select="php:function('lang', 'update subject')"/>
</xsl:attribute>
</input>
- <input type="text" id="id"
name="id" value="{id}">
+ <input type="hidden" id="id"
name="id" value="{id}">
</input>
</div>
@@ -357,7 +359,7 @@
</div>
</xsl:when>
</xsl:choose>
- <xsl:call-template name="contact_form"/>
+ <!--xsl:call-template
name="contact_form"/-->
<xsl:for-each select="value_target">
<div class="pure-control-group">
<label>
@@ -398,12 +400,12 @@
</div>
<xsl:choose>
<xsl:when test="simple !='1'">
- <div
class="pure-control-group">
+ <!--div
class="pure-control-group">
<label>
<xsl:value-of select="php:function('lang', 'group')"/>
</label>
<xsl:call-template name="group_select"/>
- </div>
+ </div-->
<div
class="pure-control-group">
<label>
<xsl:value-of select="php:function('lang', 'assigned to')"/>
@@ -439,35 +441,33 @@
</xsl:if>
</input>
</div>
+ <xsl:if
test="disable_priority !='1'">
+ <div
class="pure-control-group">
+ <label>
+
<xsl:value-of select="php:function('lang', 'Priority')"/>
+ </label>
+
<xsl:variable name="lang_priority_statustext">
+
<xsl:value-of select="php:function('lang', 'Select the priority the selection
belongs to')"/>
+
</xsl:variable>
+
<xsl:variable name="select_priority_name">
+
<xsl:value-of select="select_priority_name"/>
+
</xsl:variable>
+ <select
name="{$select_priority_name}" class="forms"
title="{$lang_priority_statustext}"
onMouseover="window.status='{$lang_priority_statustext}'; return true;"
onMouseout="window.status='';return true;">
+
<xsl:apply-templates select="priority_list/options"/>
+
</select>
+ </div>
+ </xsl:if>
<div
class="pure-control-group">
<label>
-
<xsl:value-of select="php:function('lang', 'Priority')"/>
+
<xsl:value-of select="php:function('lang', 'status')"/>
</label>
- <xsl:variable
name="lang_priority_statustext">
-
<xsl:value-of select="php:function('lang', 'Select the priority the selection
belongs to')"/>
- </xsl:variable>
- <xsl:variable
name="select_priority_name">
-
<xsl:value-of select="select_priority_name"/>
- </xsl:variable>
- <select
name="{$select_priority_name}" class="forms"
title="{$lang_priority_statustext}"
onMouseover="window.status='{$lang_priority_statustext}'; return true;"
onMouseout="window.status='';return true;">
-
<xsl:apply-templates select="priority_list/options"/>
+ <select
id="status_id" name="values[status]" class="forms">
+
<xsl:attribute name="title">
+
<xsl:value-of select="php:function('lang', 'Set the status of the ticket')"/>
+
</xsl:attribute>
+
<xsl:apply-templates select="status_list/options"/>
</select>
</div>
- <xsl:choose>
- <xsl:when
test="value_order_id=''">
- <div
class="pure-control-group">
-
<label>
-
<xsl:value-of select="php:function('lang', 'status')"/>
-
</label>
-
<select id="status_id" name="values[status]" class="forms">
-
<xsl:attribute name="title">
-
<xsl:value-of select="php:function('lang', 'Set the status of
the ticket')"/>
-
</xsl:attribute>
-
<xsl:apply-templates select="status_list/options"/>
-
</select>
- </div>
- </xsl:when>
- </xsl:choose>
<div
class="pure-control-group">
<label>
<xsl:value-of select="php:function('lang', 'category')"/>
@@ -566,6 +566,8 @@
<div class="pure-control-group">
<label>
<xsl:value-of
select="php:function('lang', 'paste image data')"/>
+ <br/>
+ <xsl:text>Ctrl +
V</xsl:text>
</label>
<canvas title="Copy image data
into clipboard and press Ctrl+V" style="border:1px solid grey;" id="my_canvas"
width="100" height="100">
</canvas>
Modified: trunk/phpgwapi/inc/class.acl.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.acl.inc.php 2016-08-01 13:31:53 UTC (rev
15399)
+++ trunk/phpgwapi/inc/class.acl.inc.php 2016-08-02 15:54:49 UTC (rev
15400)
@@ -2006,11 +2006,10 @@
}
else
{
- $sql = "SELECT account_id, account_type FROM
phpgw_accounts"
+ $sql = "SELECT DISTINCT account_id,
account_type FROM phpgw_accounts"
. " {$this->_join} phpgw_acl on
phpgw_accounts.account_id = phpgw_acl.acl_account"
. " {$this->_join} phpgw_locations on
phpgw_acl.location_id = phpgw_locations.location_id"
- . " WHERE account_status = 'A' AND
phpgw_locations.name = '{$location}'"
- . " ORDER BY account_lastname ASC";
+ . " WHERE account_status = 'A' AND
phpgw_locations.name = '{$location}'";
$this->_db->query($sql,__LINE__,__FILE__);
Modified: trunk/preferences/inc/class.boadmin_acl.inc.php
===================================================================
--- trunk/preferences/inc/class.boadmin_acl.inc.php 2016-08-01 13:31:53 UTC
(rev 15399)
+++ trunk/preferences/inc/class.boadmin_acl.inc.php 2016-08-02 15:54:49 UTC
(rev 15400)
@@ -67,7 +67,7 @@
$this->start=0;
}
- if($acl_app && !$this->acl_app)
+ if($acl_app)
{
$this->acl_app = $acl_app;
}
Modified: trunk/property/inc/class.boadmin.inc.php
===================================================================
--- trunk/property/inc/class.boadmin.inc.php 2016-08-01 13:31:53 UTC (rev
15399)
+++ trunk/property/inc/class.boadmin.inc.php 2016-08-02 15:54:49 UTC (rev
15400)
@@ -67,7 +67,8 @@
$module = phpgw::get_var('module');
$granting_group = phpgw::get_var('granting_group',
'int');
$allrows = phpgw::get_var('allrows', 'bool');
- $acl_app = 'property';
//get_var('acl_app',array('POST','GET'));
+ $acl_app = phpgw::get_var('acl_app', 'string',
'REQUEST', 'property');
+ $this->acl_app = $acl_app;
if ($start)
{
@@ -109,10 +110,6 @@
$this->allrows = $allrows ? $allrows : '';
- if (isset($acl_app))
- {
- $this->acl_app = $acl_app;
- }
}
function read_sessiondata()
@@ -261,7 +258,7 @@
{
$check_account_type = array('accounts');
$acl_account_type = 'accounts';
- $valid_users =
$GLOBALS['phpgw']->acl->get_ids_for_location('run', phpgwapi_acl::READ,
'property');
+ $valid_users =
$GLOBALS['phpgw']->acl->get_ids_for_location('run', phpgwapi_acl::READ,
$this->acl_app);
}
else
{
Modified: trunk/property/inc/class.custom_fields.inc.php
===================================================================
--- trunk/property/inc/class.custom_fields.inc.php 2016-08-01 13:31:53 UTC
(rev 15399)
+++ trunk/property/inc/class.custom_fields.inc.php 2016-08-02 15:54:49 UTC
(rev 15400)
@@ -96,14 +96,14 @@
if (!$view_only && $attributes['history'])
{
-
$GLOBALS['phpgw']->jqcal->add_listener("values_attribute_{$i}_date");
+
$GLOBALS['phpgw']->jqcal->add_listener("values_attribute_{$attributes['id']}_date");
}
if ($attributes['datatype'] == 'D' ||
$attributes['datatype'] == 'DT' || $attributes['datatype'] == 'date' ||
$attributes['datatype'] == 'timestamp')
{
if (!$view_only)
{
-
$GLOBALS['phpgw']->jqcal->add_listener('values_attribute_' . $i);
+
$GLOBALS['phpgw']->jqcal->add_listener("values_attribute_{$attributes['id']}");
$attributes['lang_datetitle'] =
lang('Select date');
}
@@ -115,8 +115,8 @@
$clear_functions[$m]['action']
= <<<JS
if(confirm("{$confirm_msg}"))
{
- var
attribute_{$i}_date = document.getElementById('values_attribute_{$i}');
-
attribute_{$i}_date.value = '';
+ var
attribute_{$attributes['id']}_date =
document.getElementById('values_attribute_{$attributes['id']}');
+
attribute_{$attributes['id']}_date.value = '';
}
JS;
$m++;
@@ -128,12 +128,12 @@
$clear_functions[$m]['action']
= <<<JS
if(confirm("{$confirm_msg}"))
{
- var
attribute_{$i}_date = document.getElementById('values_attribute_{$i}');
- var
attribute_{$i}_hour = document.getElementById('values_attribute_{$i}_hour');
- var
attribute_{$i}_min = document.getElementById('values_attribute_{$i}_min');
-
attribute_{$i}_date.value = '';
-
attribute_{$i}_hour.value = '';
-
attribute_{$i}_min.value = '';
+ var
attribute_{$attributes['id']}_date =
document.getElementById('values_attribute_{$attributes['id']}');
+ var
attribute_{$attributes['id']}_hour =
document.getElementById('values_attribute_{$attributes['id']}_hour');
+ var
attribute_{$attributes['id']}_min =
document.getElementById('values_attribute_{$attributes['id']}_min');
+
attribute_{$attributes['id']}_date.value = '';
+
attribute_{$attributes['id']}_hour.value = '';
+
attribute_{$attributes['id']}_min.value = '';
}
JS;
$m++;
Modified: trunk/property/inc/class.uiadmin.inc.php
===================================================================
--- trunk/property/inc/class.uiadmin.inc.php 2016-08-01 13:31:53 UTC (rev
15399)
+++ trunk/property/inc/class.uiadmin.inc.php 2016-08-02 15:54:49 UTC (rev
15400)
@@ -45,6 +45,7 @@
var $permission;
var $sub;
var $currentapp;
+ var $acl_app;
var $public_functions = array
(
'list_acl' => true,
@@ -62,18 +63,18 @@
$this->account =
$GLOBALS['phpgw_info']['user']['account_id'];
$this->bo = CreateObject('property.boadmin', true);
- $this->bopreferences =
createObject('preferences.boadmin_acl', true);
+ $this->acl_app = $this->bo->acl_app;
+ $this->bopreferences =
createObject('preferences.boadmin_acl');
$this->bocommon = CreateObject('property.bocommon');
$this->acl = & $GLOBALS['phpgw']->acl;
$this->acl_location = '.admin';
- $this->acl_read =
$this->acl->check($this->acl_location, PHPGW_ACL_READ, 'property');
- $this->acl_add = $this->acl->check($this->acl_location,
PHPGW_ACL_ADD, 'property');
- $this->acl_edit =
$this->acl->check($this->acl_location, PHPGW_ACL_EDIT, 'property');
- $this->acl_delete =
$this->acl->check($this->acl_location, PHPGW_ACL_DELETE, 'property');
- $this->acl_manage =
$this->acl->check($this->acl_location, 16, 'property');
+ $this->acl_read =
$this->acl->check($this->acl_location, PHPGW_ACL_READ, $this->acl_app);
+ $this->acl_add = $this->acl->check($this->acl_location,
PHPGW_ACL_ADD, $this->acl_app);
+ $this->acl_edit =
$this->acl->check($this->acl_location, PHPGW_ACL_EDIT, $this->acl_app);
+ $this->acl_delete =
$this->acl->check($this->acl_location, PHPGW_ACL_DELETE, $this->acl_app);
+ $this->acl_manage =
$this->acl->check($this->acl_location, 16, $this->acl_app);
- // $this->acl_app
= $this->bo->acl_app;
$this->start = $this->bo->start;
$this->query = $this->bo->query;
$this->sort = $this->bo->sort;
@@ -116,7 +117,6 @@
$values = phpgw::get_var('values');
$r_processed = phpgw::get_var('processed');
- // $acl_app =
get_var('acl_app',array('GET'));
$set_permission = phpgw::get_var('set_permission',
'bool');
if ($set_permission)
@@ -228,7 +228,7 @@
'query' => $this->query,
'module' => $this->location,
'granting_group' => $this->granting_group,
- 'acl_app' => $acl_app
+ 'acl_app' => $this->acl_app
);
if (!$this->location)
@@ -252,6 +252,7 @@
(
'msgbox_data' =>
$GLOBALS['phpgw']->common->msgbox($msgbox_data),
'form_action' =>
$GLOBALS['phpgw']->link('/index.php', $link_data),
+ 'value_acl_app' => $this->acl_app,
'done_action' =>
$GLOBALS['phpgw']->link('/preferences/index.php'),
'lang_save' => lang('save'),
'lang_done' => lang('done'),
@@ -262,7 +263,7 @@
'record_limit' =>
$GLOBALS['phpgw_info']['user']['preferences']['common']['maxmatchs'],
'num_records' => $num_records,
'all_records' =>
(isset($this->bo->total_records) ? $this->bo->total_records : ''),
- 'link_url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'property.uiadmin.aclprefs')),
+ 'link_url' =>
$GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'property.uiadmin.aclprefs', 'acl_app' => $this->acl_app)),
'img_path' =>
$GLOBALS['phpgw']->common->get_image_path('phpgwapi', 'default'),
'lang_groups' => lang('groups'),
'lang_users' => lang('users'),
@@ -298,7 +299,7 @@
$function_msg = lang('set grants');
$owner_name =
$GLOBALS['phpgw']->accounts->id2name($this->account); // get owner name for
title
- $GLOBALS['phpgw_info']['flags']['app_header'] =
lang('property') . ' - ' . $appname . ': ' . $function_msg . ': ' . $owner_name;
+ $GLOBALS['phpgw_info']['flags']['app_header'] =
lang($this->acl_app) . ' - ' . $appname . ': ' . $function_msg . ': ' .
$owner_name;
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',
array('list_permission' => $data));
$this->save_sessiondata();
}
@@ -562,7 +563,7 @@
$appname = lang('permission');
$function_msg = lang('set permission');
- $GLOBALS['phpgw_info']['flags']['app_header'] =
lang('property') . ' - ' . $appname . ': ' . $function_msg;
+ $GLOBALS['phpgw_info']['flags']['app_header'] =
lang($this->acl_app) . ' - ' . $appname . ': ' . $function_msg;
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',
array('list_permission' => $data));
$this->save_sessiondata();
}
Modified: trunk/property/templates/base/admin.xsl
===================================================================
--- trunk/property/templates/base/admin.xsl 2016-08-01 13:31:53 UTC (rev
15399)
+++ trunk/property/templates/base/admin.xsl 2016-08-02 15:54:49 UTC (rev
15400)
@@ -99,11 +99,9 @@
</xsl:variable>
<INPUT type="hidden"
name="location" value="{$location}"/>
<INPUT type="hidden"
name="processed" value="{$processed}"/>
- <input type="submit"
name="set_permission" value="{$lang_save}" onMouseout="window.status='';return
true;">
- <xsl:attribute
name="onMouseover">
-
<xsl:text>window.status='</xsl:text>
+ <input type="submit"
name="set_permission" value="{$lang_save}">
+ <xsl:attribute
name="title">
<xsl:value-of
select="lang_save_statustext"/>
- <xsl:text>';
return true;</xsl:text>
</xsl:attribute>
</input>
</td>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [15400] ACL: refine query,
sigurdne <=