[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [7434] Merge 7403:7433 from trunk
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [7434] Merge 7403:7433 from trunk |
Date: |
Mon, 27 Jun 2011 13:36:06 +0000 |
Revision: 7434
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=7434
Author: sigurdne
Date: 2011-06-27 13:36:06 +0000 (Mon, 27 Jun 2011)
Log Message:
-----------
Merge 7403:7433 from trunk
Modified Paths:
--------------
branches/Version-1_0-branch/activitycalendar/inc/class.soactivity.inc.php
branches/Version-1_0-branch/activitycalendar/inc/class.soarena.inc.php
branches/Version-1_0-branch/activitycalendar/inc/class.soorganization.inc.php
branches/Version-1_0-branch/activitycalendar/inc/class.uiactivities.inc.php
branches/Version-1_0-branch/activitycalendar/inc/class.uiarena.inc.php
branches/Version-1_0-branch/activitycalendar/inc/class.uiorganization.inc.php
branches/Version-1_0-branch/activitycalendar/js/activitycalendar/common.js
branches/Version-1_0-branch/activitycalendar/setup/phpgw_no.lang
branches/Version-1_0-branch/activitycalendar/templates/base/activity.php
branches/Version-1_0-branch/activitycalendar/templates/base/arena.php
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity.php
branches/Version-1_0-branch/booking/inc/class.uiresource.inc.php
branches/Version-1_0-branch/booking/setup/tables_current.inc.php
branches/Version-1_0-branch/frontend/inc/class.uientity.inc.php
branches/Version-1_0-branch/frontend/inc/class.uifrontend.inc.php
branches/Version-1_0-branch/frontend/js/yahoo/entity.list.js
branches/Version-1_0-branch/frontend/templates/base/entity.xsl
branches/Version-1_0-branch/frontend/templates/base/entityview.xsl
branches/Version-1_0-branch/phpgwapi/inc/class.xslttemplates.inc.php
branches/Version-1_0-branch/property/inc/class.boentity.inc.php
branches/Version-1_0-branch/property/inc/class.soentity.inc.php
branches/Version-1_0-branch/property/inc/class.solocation.inc.php
branches/Version-1_0-branch/property/inc/class.uientity.inc.php
branches/Version-1_0-branch/property/inc/class.uiimport.inc.php
branches/Version-1_0-branch/property/inc/class.uilocation.inc.php
branches/Version-1_0-branch/property/inc/class.uitts.inc.php
branches/Version-1_0-branch/property/inc/import/default/cvs_import_kunstoversikt_bkb
branches/Version-1_0-branch/property/setup/phpgw_no.lang
branches/Version-1_0-branch/property/templates/base/entity.xsl
Added Paths:
-----------
branches/Version-1_0-branch/frontend/templates/base/attributes_view.xsl
branches/Version-1_0-branch/property/inc/import/default/cvs_import_romdata_bkb
branches/Version-1_0-branch/sms/inc/plugin/gateway/pswin/
Property Changed:
----------------
branches/Version-1_0-branch/
Property changes on: branches/Version-1_0-branch
___________________________________________________________________
Modified: svn:mergeinfo
-
/trunk:6439-6441,6443,6445-6447,6449-6464,6466-6468,6470-6474,6476-6477,6479-6480,6483-6488,6490-6491,6493-6494,6496-6501,6503-6504,6506,6508,6510-6511,6513,6515-6516,6518,6520-6524,6526-6528,6533-6534,6536-6541,6543-6565,6567,6569,6571-6576,6578,6580-6586,6588-6596,6598-6600,6602-6604,6606-6607,6609-6611,6613-6625,6629-6639,6641-6643,6645-6646,6648,6650-6654,6656-6659,6661-6663,6665-6666,6668-6669,6672-6673,6675,6677-6678,6680,6682-6686,6688-6717,6719,6721-6722,6724-6728,6730,6732-6734,6736-6739,6741,6743,6745-6746,6748-6756,6758-6762,6764,6766-6788,6790,6792-6798,6800-6814,6816-6819,6821-6822,6824-6826,6828-6837,6839,6841,6843-6849,6851,6853-6869,6871-6874,6876-6877,6879,6881,6883,6885-6886,6888-6893,6895-6897,6899-6901,6903,6905-6907,6909,6911-6929,6931-6936,6938-6947,6949,6951,6953,6955-6956,6958-6959,6961-6968,6970-6971,6973-6974,6976-6978,6980,6982-7017,7019-7025,7027-7035,7037-7039,7041-7045,7047-7055,7057,7059-7065,7067-7069,7071,7073,7075-7076,7078,7080-7081,7083,7085,7087,7089-7097,7099-7102,7104-7105,7107-7111,7113-7120,7122-7124,7126-7129,7131,7133-7141,7143,7145-7146,7148-7150,7152-7153,7155-7158,7160-7164,7166-7167,7169-7170,7172,7174,7176,7178,7180-7181,7183,7185,7187-7188,7190,7192-7196,7198-7199,7201-7203,7205,7207,7209-7210,7212,7214,7216-7217,7219-7222,7224-7226,7228-7229,7231,7233-7234,7236-7238,7240-7241,7243-7244,7246,7248,7250,7252-7256,7258-7259,7261-7264,7266-7273,7275-7279,7281-7332,7334-7338,7340-7348,7350,7352-7353,7355-7361,7363-7366,7368-7370,7372,7374,7376,7378,7380-7386,7388-7400,7402
+
/trunk:6439-6441,6443,6445-6447,6449-6464,6466-6468,6470-6474,6476-6477,6479-6480,6483-6488,6490-6491,6493-6494,6496-6501,6503-6504,6506,6508,6510-6511,6513,6515-6516,6518,6520-6524,6526-6528,6533-6534,6536-6541,6543-6565,6567,6569,6571-6576,6578,6580-6586,6588-6596,6598-6600,6602-6604,6606-6607,6609-6611,6613-6625,6629-6639,6641-6643,6645-6646,6648,6650-6654,6656-6659,6661-6663,6665-6666,6668-6669,6672-6673,6675,6677-6678,6680,6682-6686,6688-6717,6719,6721-6722,6724-6728,6730,6732-6734,6736-6739,6741,6743,6745-6746,6748-6756,6758-6762,6764,6766-6788,6790,6792-6798,6800-6814,6816-6819,6821-6822,6824-6826,6828-6837,6839,6841,6843-6849,6851,6853-6869,6871-6874,6876-6877,6879,6881,6883,6885-6886,6888-6893,6895-6897,6899-6901,6903,6905-6907,6909,6911-6929,6931-6936,6938-6947,6949,6951,6953,6955-6956,6958-6959,6961-6968,6970-6971,6973-6974,6976-6978,6980,6982-7017,7019-7025,7027-7035,7037-7039,7041-7045,7047-7055,7057,7059-7065,7067-7069,7071,7073,7075-7076,7078,7080-7081,7083,7085,7087,7089-7097,7099-7102,7104-7105,7107-7111,7113-7120,7122-7124,7126-7129,7131,7133-7141,7143,7145-7146,7148-7150,7152-7153,7155-7158,7160-7164,7166-7167,7169-7170,7172,7174,7176,7178,7180-7181,7183,7185,7187-7188,7190,7192-7196,7198-7199,7201-7203,7205,7207,7209-7210,7212,7214,7216-7217,7219-7222,7224-7226,7228-7229,7231,7233-7234,7236-7238,7240-7241,7243-7244,7246,7248,7250,7252-7256,7258-7259,7261-7264,7266-7273,7275-7279,7281-7332,7334-7338,7340-7348,7350,7352-7353,7355-7361,7363-7366,7368-7370,7372,7374,7376,7378,7380-7386,7388-7400,7402,7404-7433
Modified:
branches/Version-1_0-branch/activitycalendar/inc/class.soactivity.inc.php
===================================================================
--- branches/Version-1_0-branch/activitycalendar/inc/class.soactivity.inc.php
2011-06-27 13:32:14 UTC (rev 7433)
+++ branches/Version-1_0-branch/activitycalendar/inc/class.soactivity.inc.php
2011-06-27 13:36:06 UTC (rev 7434)
@@ -850,10 +850,10 @@
function add_group($group_info)
{
- $name = $org_info['name'];
- $orgid = $org_info['organization_id'];
- $description = $org_info['description'];
- $activity_id = $org_info['activity_id'];
+ $name = $group_info['name'];
+ $orgid = $group_info['organization_id'];
+ $description = $group_info['description'];
+ $activity_id = $group_info['activity_id'];
$show_in_portal = 1;
$columns[] = 'name';
@@ -863,9 +863,9 @@
$columns[] = 'show_in_portal';
$cols = implode(',',$columns);
- $values[] = "{$name}";
- $values[] = "{$description}";
- $values[] = "{$orgid}";
+ $values[] = "'{$name}'";
+ $values[] = "'{$description}'";
+ $values[] = "'{$orgid}'";
$values[] = $activity_id;
$values[] = $show_in_portal;
$vals = implode(',',$values);
@@ -902,10 +902,10 @@
function add_contact_person_org($contact)
{
- $name = $contact2['name'];
- $phone = $contact2['phone'];
- $mail = $contact2['mail'];
- $org_id = $contact2['org_id'];
+ $name = $contact['name'];
+ $phone = $contact['phone'];
+ $mail = $contact['mail'];
+ $org_id = $contact['org_id'];
$ssn = '';
$columns[] = 'name';
@@ -915,10 +915,10 @@
$columns[] = 'organization_id';
$cols = implode(',',$columns);
- $values[] = "{$name}";
- $values[] = "{$ssn}";
- $values[] = "{$phone}";
- $values[] = "{$mail}";
+ $values[] = "'{$name}'";
+ $values[] = "'{$ssn}'";
+ $values[] = "'{$phone}'";
+ $values[] = "'{$mail}'";
$values[] = $org_id;
$vals = implode(',',$values);
@@ -934,10 +934,10 @@
function add_contact_person_group($contact)
{
- $name = $contact2['name'];
- $phone = $contact2['phone'];
- $mail = $contact2['mail'];
- $org_id = $contact2['group_id'];
+ $name = $contact['name'];
+ $phone = $contact['phone'];
+ $mail = $contact['mail'];
+ $org_id = $contact['group_id'];
$columns[] = 'name';
$columns[] = 'phone';
@@ -945,9 +945,9 @@
$columns[] = 'group_id';
$cols = implode(',',$columns);
- $values[] = "{$name}";
- $values[] = "{$phone}";
- $values[] = "{$mail}";
+ $values[] = "'{$name}'";
+ $values[] = "'{$phone}'";
+ $values[] = "'{$mail}'";
$values[] = $org_id;
$vals = implode(',',$values);
Modified: branches/Version-1_0-branch/activitycalendar/inc/class.soarena.inc.php
===================================================================
--- branches/Version-1_0-branch/activitycalendar/inc/class.soarena.inc.php
2011-06-27 13:32:14 UTC (rev 7433)
+++ branches/Version-1_0-branch/activitycalendar/inc/class.soarena.inc.php
2011-06-27 13:36:06 UTC (rev 7434)
@@ -278,5 +278,22 @@
}
return $ret;
}
+
+ public function get_address($search)
+ {
+ $result_arr = array();
+ $result_arr[] = "<option>Ingen</option>";
+ if($search)
+ {
+ $sql = "select * from fm_streetaddress where
UPPER(descr) like UPPER('{$search}%')";
+ $this->db->query($sql, __LINE__, __FILE__);
+ while($this->db->next_record()){
+ //$result_arr = $this->db->f('name');
+ $result_arr[] = "<option value='" .
$this->db->f('descr') . "'>" . $this->db->f('descr') . "</option>";
+ }
+ }
+ $result = implode(' ' , $result_arr);
+ return $result;
+ }
}
?>
\ No newline at end of file
Modified:
branches/Version-1_0-branch/activitycalendar/inc/class.soorganization.inc.php
===================================================================
---
branches/Version-1_0-branch/activitycalendar/inc/class.soorganization.inc.php
2011-06-27 13:32:14 UTC (rev 7433)
+++
branches/Version-1_0-branch/activitycalendar/inc/class.soorganization.inc.php
2011-06-27 13:36:06 UTC (rev 7434)
@@ -62,6 +62,9 @@
case "district":
$like_clauses[] = "org.district
$this->like $like_pattern";
break;
+ default:
+ $like_clauses[] = "org.name $this->like
$like_pattern";
+ break;
}
@@ -73,6 +76,11 @@
$filter_clauses = array();
$filter_clauses[] = "show_in_portal=1";
+
+ if(isset($filters[$this->get_id_field_name()])){
+ $id =
$this->marshal($filters[$this->get_id_field_name()],'int');
+ $filter_clauses[] = "org.id = {$id}";
+ }
/*
// All parties with contracts of type X
Modified:
branches/Version-1_0-branch/activitycalendar/inc/class.uiactivities.inc.php
===================================================================
--- branches/Version-1_0-branch/activitycalendar/inc/class.uiactivities.inc.php
2011-06-27 13:32:14 UTC (rev 7433)
+++ branches/Version-1_0-branch/activitycalendar/inc/class.uiactivities.inc.php
2011-06-27 13:36:06 UTC (rev 7434)
@@ -18,7 +18,8 @@
'add' => true,
'edit' => true,
'download' => true,
- 'send_mail' => true
+ 'send_mail' => true,
+ 'get_organization_groups' => true
);
public function __construct()
@@ -392,5 +393,41 @@
}
}
}
+
+ public function get_organization_groups()
+ {
+ $GLOBALS['phpgw_info']['flags']['noheader'] = true;
+ $GLOBALS['phpgw_info']['flags']['nofooter'] = true;
+ $GLOBALS['phpgw_info']['flags']['xslt_app'] = false;
+
+ $org_id = phpgw::get_var('orgid');
+ $group_id = phpgw::get_var('groupid');
+ $returnHTML = "<option value='0'>Ingen gruppe valgt</option>";
+ if($org_id)
+ {
+ $groups =
activitycalendar_sogroup::get_instance()->get(null, null, null, null, null,
null, array('org_id' => $org_id));
+ foreach ($groups as $group) {
+ if(isset($group))
+ {
+ //$res_g = $group->serialize();
+ $selected = "";
+ if($group_id && $group_id > 0)
+ {
+ $gr_id = (int)$group_id;
+ if($gr_id ==
(int)$group->get_id())
+ {
+ $selected_group = "
selected";
+ }
+ }
+ $group_html[] = "<option value='" .
$group->get_id() . "'". $selected_group . ">" . $group->get_name() .
"</option>";
+ }
+ }
+ $html = implode(' ' , $group_html);
+ $returnHTML = $returnHTML . ' ' . $html;
+ }
+
+
+ return $returnHTML;
+ }
}
?>
Modified: branches/Version-1_0-branch/activitycalendar/inc/class.uiarena.inc.php
===================================================================
--- branches/Version-1_0-branch/activitycalendar/inc/class.uiarena.inc.php
2011-06-27 13:32:14 UTC (rev 7433)
+++ branches/Version-1_0-branch/activitycalendar/inc/class.uiarena.inc.php
2011-06-27 13:36:06 UTC (rev 7434)
@@ -12,7 +12,8 @@
'query' => true,
'view' => true,
'add' => true,
- 'edit' => true
+ 'edit' => true,
+ 'get_address_search' => true
);
public function __construct()
@@ -31,6 +32,16 @@
$GLOBALS['phpgw']->redirect_link('/index.php',
array('menuaction' => 'activitycalendar.uiarena.edit'));
}
+ /**
+ * Public method.
+ */
+ public function get_address_search()
+ {
+ $search_string = phpgw::get_var('search');
+ //var_dump($search_string);
+ return
activitycalendar_soarena::get_instance()->get_address($search_string);
+ }
+
public function index()
{
// No messages so far
@@ -92,7 +103,7 @@
// ... set all parameters
$arena->set_internal_arena_id(phpgw::get_var('internal_arena_id'));
$arena->set_arena_name(phpgw::get_var('arena_name'));
- $arena->set_address(phpgw::get_var('address'));
+ $arena->set_address(phpgw::get_var('address') .
' ' . phpgw::get_var('address_no'));
if(activitycalendar_soarena::get_instance()->store($arena)) // ... and then try
to store the object
{
Modified:
branches/Version-1_0-branch/activitycalendar/inc/class.uiorganization.inc.php
===================================================================
---
branches/Version-1_0-branch/activitycalendar/inc/class.uiorganization.inc.php
2011-06-27 13:32:14 UTC (rev 7433)
+++
branches/Version-1_0-branch/activitycalendar/inc/class.uiorganization.inc.php
2011-06-27 13:36:06 UTC (rev 7434)
@@ -12,7 +12,10 @@
(
'index' => true,
'query' => true,
- 'get_organization_groups' => true
+ 'changed_organizations' => true,
+ 'get_organization_groups' => true,
+ 'show' => true,
+ 'edit' => true
);
public function __construct()
@@ -32,6 +35,11 @@
$this->render('organization_list.php');
}
+ public function changed_organizations()
+ {
+ $this->render('organization_list_changed.php');
+ }
+
public function index_json()
{
$organizations =
activitycalendar_soorganization::get_instance()->get(); //get organizations
@@ -53,7 +61,59 @@
return $this->yui_results($organizations);
}
+ public function edit()
+ {
+ $id = (int)phpgw::get_var('id');
+ $type = phpgw::get_var('type');
+ if($type)
+ {
+ //var_dump($type);
+ $so = activitycalendar_sogroup::get_instance();
+ }
+ else
+ {
+ //var_dump('org');
+ $so = activitycalendar_soorganization::get_instance();
+ }
+ }
+ public function show()
+ {
+ $id = (int)phpgw::get_var('id');
+ $type = phpgw::get_var('type');
+ if($type)
+ {
+ //var_dump($type);
+ $so = activitycalendar_sogroup::get_instance();
+ $group = $so->get(null, null, null, null, null, null,
array('id' => $id));
+
+ return $this->render('group.php', array
+ (
+ 'group' => $group,
+ 'editable' => true,
+ 'message' => isset($message) ? $message
: phpgw::get_var('message'),
+ 'error' => isset($error) ? $error :
phpgw::get_var('error')
+ )
+ );
+ }
+ else
+ {
+ //var_dump('org');
+ $so = activitycalendar_soorganization::get_instance();
+ $org = $so->get(null, null, null, null, null, null,
array('id' => $id));
+
+ return $this->render('organization.php', array
+ (
+ 'organization' => $org,
+ 'editable' => true,
+ 'message' => isset($message) ? $message
: phpgw::get_var('message'),
+ 'error' => isset($error) ? $error :
phpgw::get_var('error')
+ )
+ );
+ }
+ }
+
+
/**
* (non-PHPdoc)
@@ -254,6 +314,27 @@
}
$value['labels'][] = lang('show');
break;
+
+ case 'changed_organizations':
+ $value['ajax'][] = false;
+ if($value['organization_id'] != '' &&
$value['organization_id'] != null){
+ $value['actions'][] =
html_entity_decode(self::link(array('menuaction' =>
'activitycalendar.uiorganization.show', 'id' => $value['id'], 'type' =>
'group')));
+ }
+ else
+ {
+ $value['actions'][] =
html_entity_decode(self::link(array('menuaction' =>
'activitycalendar.uiorganization.show', 'id' => $value['id'])));
+ }
+ $value['labels'][] = lang('show');
+ $value['ajax'][] = false;
+ if($value['organization_id'] != '' &&
$value['organization_id'] != null){
+ $value['actions'][] =
html_entity_decode(self::link(array('menuaction' =>
'activitycalendar.uiorganization.show', 'id' => $value['id'], 'type' =>
'group')));
+ }
+ else
+ {
+ $value['actions'][] =
html_entity_decode(self::link(array('menuaction' =>
'activitycalendar.uiorganization.edit', 'id' => $value['id'])));
+ }
+ $value['labels'][] = lang('edit');
+ break;
}
}
}
Modified:
branches/Version-1_0-branch/activitycalendar/js/activitycalendar/common.js
===================================================================
--- branches/Version-1_0-branch/activitycalendar/js/activitycalendar/common.js
2011-06-27 13:32:14 UTC (rev 7433)
+++ branches/Version-1_0-branch/activitycalendar/js/activitycalendar/common.js
2011-06-27 13:36:06 UTC (rev 7434)
@@ -258,7 +258,7 @@
}
}
-/*
+
YAHOO.activitycalendar.autocompleteHelper = function(url, field, hidden,
container, label_attr) {
label_attr = label_attr || 'name';
var myDataSource = new YAHOO.util.DataSource(url);
@@ -269,20 +269,19 @@
fields: [label_attr, 'id']
};
myDataSource.maxCacheEntries = 5;
- console.log(myDataSource);
- console.log(field);
- console.log(container);
- console.log(YAHOO.widget.AutoComplete);
+ //console.log(myDataSource);
+ //console.log(field);
+ //console.log(container);
+ //console.log(YAHOO.widget.AutoComplete);
var ac = new YAHOO.widget.AutoComplete(field, container, myDataSource);
ac.queryQuestionMark = false;
ac.resultTypeList = false;
ac.forceSelection = true;
- console.log(ac);
+ //console.log(ac);
ac.itemSelectEvent.subscribe(function(sType, aArgs) {
- console.log(aArgs[2]);
+ //console.log(aArgs[2]);
YAHOO.util.Dom.get(hidden).value = aArgs[2].id;
});
return ac;
};
-*/
\ No newline at end of file
Modified: branches/Version-1_0-branch/activitycalendar/setup/phpgw_no.lang
===================================================================
--- branches/Version-1_0-branch/activitycalendar/setup/phpgw_no.lang
2011-06-27 13:32:14 UTC (rev 7433)
+++ branches/Version-1_0-branch/activitycalendar/setup/phpgw_no.lang
2011-06-27 13:36:06 UTC (rev 7434)
@@ -378,4 +378,5 @@
mail_body_state_4 activitycalendar no Ditt tips er behandlet
og publisert i kommuneportalen. Mvh %1 kulturkontor
mail_body_state_5 activitycalendar no Ditt tips er behandlet,
men vil ikke bli publisert i kommuneportalen. Mvh %1 kulturkontor
send_mail activitycalendar no Send e-post
-marked_as activitycalendar no Status
\ No newline at end of file
+marked_as activitycalendar no Status
+address_number activitycalendar no Nummer
\ No newline at end of file
Modified:
branches/Version-1_0-branch/activitycalendar/templates/base/activity.php
===================================================================
--- branches/Version-1_0-branch/activitycalendar/templates/base/activity.php
2011-06-27 13:32:14 UTC (rev 7433)
+++ branches/Version-1_0-branch/activitycalendar/templates/base/activity.php
2011-06-27 13:36:06 UTC (rev 7434)
@@ -10,24 +10,20 @@
function get_available_groups()
{
var org_id = document.getElementById('organization_id').value;
- var group_select = document.getElementById('group_id');
- //alert(group_select);
+ var div_select = document.getElementById('group_select');
+
<?php if($activity->get_group_id()){?>
- url =
"index.php?menuaction=activitycalendar.uiorganization.get_organization_groups&phpgw_return_as=json&orgid="
+ org_id + "&groupid=" + <?php echo $activity->get_group_id();?>;
+ url =
"index.php?menuaction=activitycalendar.uiactivities.get_organization_groups&phpgw_return_as=json&orgid="
+ org_id + "&groupid=" + <?php echo $activity->get_group_id();?>;
<?php }else{?>
- url =
"index.php?menuaction=activitycalendar.uiorganization.get_organization_groups&phpgw_return_as=json&orgid="
+ org_id;
+ url =
"index.php?menuaction=activitycalendar.uiactivities.get_organization_groups&phpgw_return_as=json&orgid="
+ org_id;
<?php }?>
+
+var divcontent_start = "<select name=\"group_id\" id=\"group_id\">";
+var divcontent_end = "</select>";
-/* $.ajax({url: url,
- success: function(response) {
- $("#group_id").innerHTML = response;
- }
- });
-*/
var callback = {
success: function(response){
- //alert("det funker");
- group_select.innerHTML =
JSON.parse(response.responseText);
+ div_select.innerHTML = divcontent_start
+ JSON.parse(response.responseText) + divcontent_end;
},
failure: function(o) {
alert("AJAX doesn't work"); //FAILURE
@@ -41,7 +37,6 @@
{
get_available_groups();
});
-
</script>
<div class="yui-content">
@@ -113,9 +108,11 @@
if ($editable)
{
?>
- <select name="group_id"
id="group_id">
- <option value="0">Ingen
gruppe valgt</option>
- </select>
+ <div id="group_select">
+ <select name="group_id"
id="group_id">
+ <option
value="0">Ingen gruppe valgt</option>
+ </select>
+ </div>
<?php
?>
<?php
@@ -273,8 +270,8 @@
}
else
{
- if($activity->get_district()){
- echo
$act_so->get_district_name($activity->get_district());
+ if($activity->get_office()){
+ echo
$act_so->get_office_name($activity->get_office());
}
}
?>
Modified: branches/Version-1_0-branch/activitycalendar/templates/base/arena.php
===================================================================
--- branches/Version-1_0-branch/activitycalendar/templates/base/arena.php
2011-06-27 13:32:14 UTC (rev 7433)
+++ branches/Version-1_0-branch/activitycalendar/templates/base/arena.php
2011-06-27 13:36:06 UTC (rev 7434)
@@ -3,6 +3,31 @@
include("common.php");
?>
+<script type="text/javascript">
+
+function get_address_search()
+{
+ var address = document.getElementById('address_txt').value;
+ var div_address = document.getElementById('address_container');
+
+ url =
"index.php?menuaction=activitycalendar.uiarena.get_address_search&phpgw_return_as=json&search="
+ address;
+
+var divcontent_start = "<select name=\"address\" id=\"address\" size\"5\">";
+var divcontent_end = "</select>";
+
+ var callback = {
+ success: function(response){
+ div_address.innerHTML =
divcontent_start + JSON.parse(response.responseText) + divcontent_end;
+ },
+ failure: function(o) {
+ alert("AJAX doesn't work"); //FAILURE
+ }
+ }
+ var trans = YAHOO.util.Connect.asyncRequest('GET', url, callback, null);
+
+}
+</script>
+
<div class="identifier-header">
<h1><img src="<?php echo ACTIVITYCALENDAR_IMAGE_PATH
?>images/32x32/custom/contact.png" /><?php echo lang('arena') ?></h1>
<div>
@@ -72,7 +97,9 @@
if ($editable)
{
?>
- <input type="text"
name="address" id="address" value="<?php echo $arena->get_address() ?>" />
+ <input type="text"
name="address" id="address_txt" value="<?php echo $arena->get_address() ?>"
onkeyup="javascript:get_address_search()"/>
+ <div
id="address_container"></div>
+ <label
for="address_number"><?php echo lang('address_number') ?></label><input
type="text" name="address_no" id="address_no"/>
<?php
}
else
Modified:
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity.php
===================================================================
---
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity.php
2011-06-27 13:32:14 UTC (rev 7433)
+++
branches/Version-1_0-branch/activitycalendarfrontend/templates/base/activity.php
2011-06-27 13:36:06 UTC (rev 7434)
@@ -10,19 +10,20 @@
function get_available_groups()
{
var org_id = document.getElementById('organization_id').value;
- var group_select = document.getElementById('group_id');
- //alert(group_select);
+ var div_select = document.getElementById('group_select');
+
<?php if($activity->get_group_id()){?>
url =
"index.php?menuaction=activitycalendarfrontend.uiactivity.get_organization_groups&phpgw_return_as=json&orgid="
+ org_id + "&groupid=" + <?php echo $activity->get_group_id();?>;
<?php }else{?>
url =
"index.php?menuaction=activitycalendarfrontend.uiactivity.get_organization_groups&phpgw_return_as=json&orgid="
+ org_id;
<?php }?>
+
+var divcontent_start = "<select name=\"group_id\" id=\"group_id\">";
+var divcontent_end = "</select>";
var callback = {
success: function(response){
- //alert("det funker");
- group_select.innerHTML =
JSON.parse(response.responseText);
- //group_select.innerHTML =
group_select.innerHTML;
+ div_select.innerHTML = divcontent_start
+ JSON.parse(response.responseText) + divcontent_end;
},
failure: function(o) {
alert("AJAX doesn't work"); //FAILURE
@@ -108,9 +109,11 @@
if ($editable)
{
?>
- <select name="group_id"
id="group_id">
- <option value="0">Ingen
gruppe valgt</option>
- </select>
+ <div id="group_select">
+ <select name="group_id"
id="group_id">
+ <option
value="0">Ingen gruppe valgt</option>
+ </select>
+ </div>
<?php
?>
<?php
Modified: branches/Version-1_0-branch/booking/inc/class.uiresource.inc.php
===================================================================
--- branches/Version-1_0-branch/booking/inc/class.uiresource.inc.php
2011-06-27 13:32:14 UTC (rev 7433)
+++ branches/Version-1_0-branch/booking/inc/class.uiresource.inc.php
2011-06-27 13:36:06 UTC (rev 7434)
@@ -118,6 +118,8 @@
public function add()
{
$errors = array();
+ $resource = array();
+ $resource['sort'] = '0';
if($_SERVER['REQUEST_METHOD'] == 'POST')
{
Modified: branches/Version-1_0-branch/booking/setup/tables_current.inc.php
===================================================================
--- branches/Version-1_0-branch/booking/setup/tables_current.inc.php
2011-06-27 13:32:14 UTC (rev 7433)
+++ branches/Version-1_0-branch/booking/setup/tables_current.inc.php
2011-06-27 13:36:06 UTC (rev 7434)
@@ -19,9 +19,9 @@
'fd' => array(
'id' => array('type' => 'auto', 'nullable' =>
false),
'active' => array('type' => 'int', 'nullable'
=> False,'precision' => '4', 'default' => 1),
- 'deactive_calendar' => array('type' => 'int',
'nullable' => False,'precision' => '4', 'default' => 0),
- 'deactive_application' => array('type' =>
'int', 'nullable' => False,'precision' => '4', 'default' => 0),
- 'deactive_sendmessage' => array('type' =>
'int', 'nullable' => False,'precision' => '4', 'default' => 0),
+ 'deactivate_calendar' => array('type' => 'int',
'nullable' => False,'precision' => '4', 'default' => 0),
+ 'deactivate_application' => array('type' =>
'int', 'nullable' => False,'precision' => '4', 'default' => 0),
+ 'deactivate_sendmessage' => array('type' =>
'int', 'nullable' => False,'precision' => '4', 'default' => 0),
'name' => array('type' => 'varchar','precision'
=> '50','nullable' => False),
'homepage' => array('type' => 'text',
'nullable' => False),
'location_code' => array('type' =>
'varchar','precision' => '50','nullable' => True),
Modified: branches/Version-1_0-branch/frontend/inc/class.uientity.inc.php
===================================================================
--- branches/Version-1_0-branch/frontend/inc/class.uientity.inc.php
2011-06-27 13:32:14 UTC (rev 7433)
+++ branches/Version-1_0-branch/frontend/inc/class.uientity.inc.php
2011-06-27 13:36:06 UTC (rev 7434)
@@ -89,11 +89,12 @@
$this->status =
$this->bo->status;
// $this->location_code =
$this->bo->location_code;
$this->p_num =
$this->bo->p_num;
- $this->category_dir =
$this->bo->category_dir;
$GLOBALS['phpgw']->session->appsession('entity_id','property',$this->entity_id);
$this->start_date =
$this->bo->start_date;
$this->end_date =
$this->bo->end_date;
$this->allrows =
$this->bo->allrows;
+ $this->category_dir =
"{$this->type}_{$this->entity_id}_{$this->cat_id}";
+ $this->bo->category_dir =
$this->category_dir;
phpgwapi_cache::session_set('frontend','tab',$this->location_id);
@@ -197,48 +198,9 @@
// this array "$arr_filter_hide" indicate what
filters are hidden or not
$arr_filter_hide = array();
- //// ---- DISTRICT filter----------------------
- if($this->cat_id)
- {
- //this validation comes to previous
versions
- if (isset($category['location_level'])
&& $category['location_level']>0)
- {
- $values_combo_box[1] =
$this->bocommon->select_district_list($group_filters,$this->district_id);
- if(count($values_combo_box[1]))
- {
- $default_value = array
('id'=>'','name'=>lang('no district'));
- array_unshift
($values_combo_box[1],$default_value);
- $arr_filter_hide[1] = 0;
- }
- else
- {
- $arr_filter_hide[1] = 1;
- }
- }
- else
- {
- $values_combo_box[1] = array();
- $arr_filter_hide[1] = 1;
- }
- }
-
- //// ---- USER filter----------------------
- $values_combo_box[2] =
$this->bocommon->get_user_list_right2($group_filters,4,$this->filter,$this->acl_location,array('all'),$default='all');
-
- if(count($values_combo_box[2]))
- {
- $default_value = array
('id'=>'','name'=>lang('no user'));
- array_unshift
($values_combo_box[2],$default_value);
- $arr_filter_hide[2] = 0;
- }
- else
- {
- $arr_filter_hide[2] = 1;
- }
-
- $values_combo_box[3] =
$this->bo->get_criteria_list($this->criteria_id);
+ $values_combo_box[0] =
$this->bo->get_criteria_list($this->criteria_id);
$default_value = array
('id'=>'','name'=>lang('no criteria'));
- array_unshift
($values_combo_box[3],$default_value);
+ array_unshift
($values_combo_box[0],$default_value);
$datatable['actions']['form'] = array
(
@@ -258,34 +220,7 @@
(
'field' => array
(
- /* array
- (
//boton CATEGORY
-
'id' => 'btn_cat_id',
-
'name' => 'cat_id',
-
'value'=> lang('Category'),
-
'type' => 'button',
-
'style' => 'filter',
-
'tab_index' => 1
-
),
- array
- (
//boton DISTINT
-
'id' => 'btn_district_id',
-
'name' => 'district_id',
-
'value'=> lang('District'),
-
'type' => 'button',
-
'style' => 'filter',
-
'tab_index' => 2
- ),
- array
- (
//boton USER
-
'id' => 'btn_user_id',
-
'name' => 'user_id',
-
'value'=> lang('User'),
-
'type' => 'button',
-
'style' => 'filter',
-
'tab_index' => 3
- ),*/
- array
+ /* array
(
//boton search criteria
'id' => 'btn_criteria_id',
'name' => 'criteria_id',
@@ -293,7 +228,7 @@
'type' => 'button',
'style' => 'filter',
'tab_index' => 4
- ),
+ ),*/
array
(//for
link "columns", next to Export button
'type'=> 'link',
@@ -358,8 +293,8 @@
'id' => 'start_date',
'name' => 'start_date',
'value' => $start_date
- ),
- array
+ )),
+ /* array
(//for
link "Date search",
'type'=> 'link',
'id' => 'btn_data_search',
@@ -369,48 +304,27 @@
'menuaction' =>
'property.uiproject.date_search'))."','link','width=350,height=250')",
'value' => lang('Date search'),
'tab_index' => 6
-
)),
- 'hidden_value'
=> array
+
)),*/
+ /* 'hidden_value'
=> array
(
array
(
'id' => 'values_combo_box_0',
'value'=> $this->bocommon->select2String($values_combo_box[0])
- ),
- array
- (
-
'id' => 'values_combo_box_1',
-
'value' => $this->bocommon->select2String($values_combo_box[1])
- ),
- array
- (
-
'id' => 'values_combo_box_2',
-
'value' => $this->bocommon->select2String($values_combo_box[2])
- ),
- array
- (
-
'id' => 'values_combo_box_3',
-
'value' => $this->bocommon->select2String($values_combo_box[3])
- ),
- )
+ )
+ )*/
)));
$custom =
createObject('phpgwapi.custom_fields');
$attrib_data =
$custom->find($this->type_app[$this->type],".{$this->type}.{$this->entity_id}.{$this->cat_id}",
0, '','','',true, true);
-
+/*
$button_def[] = "oMenuButton_0";
- // $button_def[] = "oMenuButton_1";
- // $button_def[] = "oMenuButton_2";
- $button_def[] = "oMenuButton_3";
- $code_inner[] = "{order:0,
var_URL:'cat_id',name:'btn_cat_id',style:'genericbutton',dependiente:[]}";
- // $code_inner[] = "{order:1,
var_URL:'district_id',name:'btn_district_id',style:'genericbutton',dependiente:[]}";
- // $code_inner[] = "{order:2,
var_URL:'filter',name:'btn_user_id',style:'genericbutton',dependiente:[]}";
- $code_inner[] = "{order:3,
var_URL:'criteria_id',name:'btn_criteria_id',style:'genericbutton',dependiente:[]}";
+ $code_inner[] = "{order:0,
var_URL:'criteria_id',name:'btn_criteria_id',style:'genericbutton',dependiente:[]}";
+*/
-
if($attrib_data)
{
- $i = 4;
+ $i = 0;
foreach ( $attrib_data as $attrib )
{
if($attrib['datatype'] == 'LB'
|| $attrib['datatype'] == 'CH' || $attrib['datatype'] == 'R')
@@ -486,12 +400,72 @@
$uicols = $this->bo->uicols;
- $content = array();
+ $uicols['name'][] = 'img_id';
+ $uicols['descr'][] = 'dummy';
+ $uicols['sortable'][] = false;
+ $uicols['sort_field'][] = '';
+ $uicols['format'][] = '';
+ $uicols['formatter'][] = '';
+ $uicols['input_type'][] = 'hidden';
+
+ $uicols['name'][] = 'directory';
+ $uicols['descr'][] = 'directory';
+ $uicols['sortable'][] = false;
+ $uicols['sort_field'][] = '';
+ $uicols['format'][] = '';
+ $uicols['formatter'][] = '';
+ $uicols['input_type'][] = 'hidden';
+
+ $uicols['name'][] = 'file_name';
+ $uicols['descr'][] = lang('name');
+ $uicols['sortable'][] = false;
+ $uicols['sort_field'][] = '';
+ $uicols['format'][] = '';
+ $uicols['formatter'][] = '';
+ $uicols['input_type'][] = 'hidden';
+
+ $uicols['name'][] = 'picture';
+ $uicols['descr'][] = '';
+ $uicols['sortable'][] = false;
+ $uicols['sort_field'][] = '';
+ $uicols['format'][] = '';
+ $uicols['formatter'][] = 'show_picture';
+ $uicols['input_type'][] = '';
+
+ $vfs = CreateObject('phpgwapi.vfs');
+ $vfs->override_acl = 1;
+
+ $j = count($ticket['files']);
+ for ($i=0;$i<$j;$i++)
+ {
+
$ticket['files'][$i]['file_name']=urlencode($ticket['files'][$i]['name']);
+ }
+
+ $img_types = array
+ (
+ 'image/jpeg',
+ 'image/png',
+ 'image/gif'
+ );
+
$j=0;
if (isset($entity_list) && is_array($entity_list))
{
- foreach($entity_list as $entity_entry)
+ foreach($entity_list as &$entity_entry)
{
+ $_loc1 = isset($entity_entry['loc1'])
&& $entity_entry['loc1'] ? $entity_entry['loc1'] : 'dummy';
+
+ $_files = $vfs->ls(array(
+ 'string' =>
"/property/{$this->category_dir}/{$_loc1}/{$entity_entry['id']}",
+ 'relatives' =>
array(RELATIVE_NONE)));
+
+ if(isset($_files[0]) && $_files[0] &&
in_array($_files[0]['mime_type'], $img_types))
+ {
+ $entity_entry['file_name']
= urlencode($_files[0]['name']);
+ $entity_entry['directory']
= urlencode($_files[0]['directory']);
+ $entity_entry['img_id']
= $_files[0]['file_id'];
+ }
+
for
($i=0;$i<count($uicols['name']);$i++)
{
if($uicols['input_type'][$i]!='hidden')
@@ -534,7 +508,7 @@
$j++;
}
}
-
+ $vfs->override_acl = 0;
//indica que de la fila seleccionada escogera de la
columna "id" el valor "id". Para agregarlo al URL
$parameters = array
(
@@ -611,14 +585,21 @@
'text' =>
lang('start ticket'),
'action' =>
$GLOBALS['phpgw']->link('/index.php',array
(
- 'menuaction'
=> 'frontend.uihelpdesk.add_ticket',
- 'noframework'
=> 1,
- 'target'
=> '_lightbox'
+ 'menuaction' =>
'frontend.uihelpdesk.add_ticket',
+ 'noframework' => 1,
+ 'target'
=> '_lightbox',
+ 'p_entity_id' =>
$this->entity_id,
+ 'p_cat_id'
=> $this->cat_id,
+ 'type'
=> $this->type,
+ 'target'
=> '_blank',
+ 'bypass'
=> true,
+ 'origin'
=> ".{$this->type}.{$this->entity_id}.{$this->cat_id}",
)),
'parameters'
=> $parameters2
);
}
+
$jasper = execMethod('property.sojasper.read',
array('location_id' =>
$GLOBALS['phpgw']->locations->get_id($this->type_app[$this->type],
$this->acl_location)));
foreach ($jasper as $report)
@@ -875,108 +856,88 @@
}
-
- private function cmp($a, $b)
+ public function view()
{
- $timea = explode('/', $a['date']);
- $timeb = explode('/', $b['date']);
- $year_and_maybe_time_a = explode(' - ', $timea[2]);
- $year_and_maybe_time_b = explode(' - ', $timeb[2]);
- $time_of_day_a = explode(':',
$year_and_maybe_time_a[1]);
- $time_of_day_b = explode(':',
$year_and_maybe_time_b[1]);
+ $GLOBALS['phpgw']->translation->add_app('property');
+ $bo = & $this->bo;
+ $id = phpgw::get_var('id');
+ $values = $bo->read_single(array('id' => $id,
'entity_id' => $this->entity_id, 'cat_id' => $this->cat_id, 'view' => true));
- $timestamp_a = mktime($time_of_day_a[0],
$time_of_day_a[1], 0, $timea[1], $timea[0], $year_and_maybe_time_a[0]);
- $timestamp_b = mktime($time_of_day_b[0],
$time_of_day_b[1], 0, $timeb[1], $timeb[0], $year_and_maybe_time_b[0]);
+//_debug_array($values);
- if($timestamp_a < $timestamp_b)
+ $entity =
$this->soadmin_entity->read_single($this->entity_id);
+ $category =
$this->soadmin_entity->read_single_category($this->entity_id,$this->cat_id);
+ $location_data = array();
+
+ if($entity['location_form'] &&
$category['location_level'] > 0)
{
- return 1;
+ $bolocation =
CreateObject('property.bolocation');
+
$location_data=$bolocation->initiate_ui_location(array
+ (
+ 'values' =>
$values['location_data'],
+ 'type_id' =>
(int)$category['location_level'],
+ 'no_link' => $_no_link,
// disable lookup links for location type less than type_id
+ 'lookup_type' => $lookup_type,
+ 'tenant' =>
$lookup_tenant,
+ 'lookup_entity' =>
$lookup_entity,
+ 'entity_data' =>
isset($values['p'])?$values['p']:''
+ ));
}
- return -1;
- }
+
+ $link_file_data = array
+ (
+ 'menuaction' =>
'property.uientity.view_file',
+ 'loc1' =>
$values['location_data']['loc1'],
+ 'id' => $id,
+ 'cat_id' =>
$this->cat_id,
+ 'entity_id' =>
$this->entity_id,
+ 'type' => $this->type
+ );
+ $img_types = array
+ (
+ 'image/jpeg',
+ 'image/png',
+ 'image/gif'
+ );
- public function view()
- {
- $GLOBALS['phpgw']->translation->add_app('property');
- $bo = CreateObject('property.botts');
- $entityid = phpgw::get_var('id');
- $entity = $bo->read_single($entityid);
+ $content_files = array();
- $assignedto = $entity['assignedto'];
- if(isset($assignedto) && $assignedto != '')
+ for($z=0; $z<count($values['files']); $z++)
{
- $assignedto_account =
$GLOBALS['phpgw']->accounts->get($assignedto);
- //var_dump($assignedto_account);
- if($assignedto_account)
- {
- $entity['assigned_to_name'] =
$assignedto_account->__toString();
- }
- }
-
- $contact_id = $entity['contact_id'];
- if(isset($contact_id) && $contact_id != '')
- {
- $contacts
= CreateObject('phpgwapi.contacts');
- $contact_data
= $contacts->read_single_entry($contact_id,
array('fn','tel_work','email'));
- $entity['value_contact_name'] =
$contact_data[0]['fn'];
- $entity['value_contact_email'] =
$contact_data[0]['email'];
- $entity['value_contact_tel'] =
$contact_data[0]['tel_work'];
- }
-
- $vendor_id = $entity['vendor_id'];
- if(isset($vendor_id) && $vendor_id != '')
- {
- $contacts =
CreateObject('property.sogeneric');
- $contacts->get_location_info('vendor',false);
+ $content_files[$z]['url'] = '<a
href="'.$GLOBALS['phpgw']->link('/index.php',$link_file_data).'&file_name='.$values['files'][$z]['name'].'"
target="_blank" title="'.lang('click to view
file').'">'.$values['files'][$z]['name'].'</a>';
+ $content_files[$z]['file_name'] =
$values['files'][$z]['name'];
- $custom =
createObject('property.custom_fields');
- $vendor_data['attributes'] =
$custom->find('property','.vendor', 0, '', 'ASC', 'attrib_sort', true, true);
-
- $vendor_data =
$contacts->read_single(array('id' => $vendor_id),$vendor_data);
-
- if(is_array($vendor_data))
+ if(in_array($values['files'][$z]['mime_type'],
$img_types))
{
- foreach($vendor_data['attributes'] as
$attribute)
- {
-
if($attribute['name']=='org_name')
- {
-
$entity['value_vendor_name']=$attribute['value'];
- break;
- }
- }
+ $content_files[$z]['file_name'] =
urlencode($values['files'][$z]['name']);
+ $content_files[$z]['directory'] =
urlencode($values['files'][$z]['directory']);
+ $content_files[$z]['img_id'] =
$values['files'][$z]['file_id'];
}
- }
+ }
- $notes = $bo->read_additional_notes($entityid);
- //$history = $bo->read_record_history($entityid);
+ $datavalues[0] = array
+ (
+ 'name'
=> "0",
+ 'values'
=> json_encode($content_files),
+ 'total_records' =>
count($content_files),
+ 'edit_action' => "''",
+ 'is_paginator' => 0,
+ 'footer'
=> 0
+ );
- $entityhistory = array();
+ $myColumnDefs[0] = array
+ (
+ 'name' => "0",
+ 'values' =>
json_encode(array( array('key' =>
'url','label'=>lang('Filename'),'sortable'=>false,'resizeable'=>true),
+
array('key' => 'file_name','hidden'=>true),
+
array('key' => 'img_id','hidden'=>true),
+
array('key' => 'directory','hidden'=>true),
+
array('key' =>
'picture','label'=>'picture','sortable'=>false,'resizeable'=>false,'visible'=>true,'formatter'=>'show_picture')))
+ );
- foreach($notes as $note)
- {
- if($note['value_publish'])
- {
- $entityhistory[] = array(
- 'date' => $note['value_date'],
- 'user' => $note['value_user'],
- 'note' => $note['value_note']
- );
- }
- }
-
- usort($entityhistory, array($this, "cmp"));
-
-
- $i=0;
- foreach($entityhistory as $foo)
- {
- $entityhistory2['record'.$i] = $foo;
- $i++;
- }
-
$msglog =
phpgwapi_cache::session_get('frontend','msgbox');
phpgwapi_cache::session_clear('frontend','msgbox');
@@ -984,175 +945,41 @@
'header' => $this->header_state,
'msgbox_data' => isset($msglog) ?
$GLOBALS['phpgw']->common->msgbox($GLOBALS['phpgw']->common->msgbox_data($msglog))
: array(),
'tabs' => $this->tabs,
- 'entityinfo' => array(
- 'entitylist' =>
$GLOBALS['phpgw']->link('/index.php',
+ 'entityinfo' => array
+ (
+ 'entitylist' =>
$GLOBALS['phpgw']->link('/index.php',
array
(
'menuaction' => 'frontend.uientity.index',
'location_id' => $this->location_id
)),
- 'entity' => $entity,
- 'entityhistory' => $entityhistory2)
+ 'entity' => $entity,
+ 'entityhistory' =>
$entityhistory2,
+ 'custom_attributes' =>
array('attributes' => $values['attributes']),
+ 'location_data' =>
$location_data,
+ 'files'
=> isset($values['files'])?$values['files']:'',
+ 'property_js' =>
json_encode($GLOBALS['phpgw_info']['server']['webserver_url']."/property/js/yahoo/property2.js"),
+ 'base_java_url' =>
"{menuaction:'property.uientity.get_files',".
+
"id:'{$id}',".
+
"entity_id:'{$this->entity_id}',".
+
"cat_id:'{$this->cat_id}',".
+
"type:'{$this->type}'}",
+ 'datatable'
=> $datavalues,
+ 'myColumnDefs' =>
$myColumnDefs,
+ )
);
+ phpgwapi_yui::load_widget('dragdrop');
+ phpgwapi_yui::load_widget('datatable');
+ phpgwapi_yui::load_widget('connection');
+ phpgwapi_yui::load_widget('loader');
+ phpgwapi_yui::load_widget('animation');
+ $GLOBALS['phpgw']->js->validate_file( 'yahoo',
'entity.view', 'frontend' );
+
$GLOBALS['phpgw']->css->add_external_file('phpgwapi/js/yahoo/datatable/assets/skins/sam/datatable.css');
- $GLOBALS['phpgw']->xslttpl->add_file(array('frontend',
'entityview'));
+
+ $GLOBALS['phpgw']->xslttpl->add_file(array('frontend',
'entityview','attributes_view'));
+
$GLOBALS['phpgw']->xslttpl->add_file(array('location_view', 'files'),
PHPGW_SERVER_ROOT . '/property/templates/base');
$GLOBALS['phpgw']->xslttpl->set_var('phpgw',
array('app_data' => $data));
}
-
-
- public function add_ticket()
- {
- $bo = CreateObject('property.botts',true);
- $boloc = CreateObject('property.bolocation',true);
-
- $location_details =
$boloc->read_single($this->location_code, array('noattrib' => true));
-
- $values = phpgw::get_var('values');
- $missingfields = false;
- $msglog = array();
-
- // Read default assign-to-group from config
- $config = CreateObject('phpgwapi.config', 'frontend');
- $config->read();
- $default_cat = $config->config_data['tts_default_cat']
? $config->config_data['tts_default_cat'] : 0;
-
- if(!$default_cat)
- {
- throw new Exception('Default category is not
set in config');
- $GLOBALS['phpgw']->common->phpgw_exit();
- }
-
- if(isset($values['save']))
- {
- foreach($values as $key => $value)
- {
- if(empty($value) && $key !== 'file')
- {
- $missingfields = true;
- }
- }
-
- if(!$missingfields && !phpgw::get_var('added'))
- {
- $location = array
- (
- 'loc1' =>
$location_details['loc1'],
- 'loc2' =>
$location_details['loc2']
- );
-
- $assignedto =
execMethod('property.boresponsible.get_responsible', array('location' =>
$location, 'cat_id' => $default_cat));
-
- if(!$assignedto)
- {
- $default_group =
$config->config_data['tts_default_group'];
- }
- else
- {
- $default_group = 0;
- }
-
- $ticket = array(
- 'origin' => null,
- 'origin_id' => null,
- 'cat_id' =>
$values['cat_id'],
- 'group_id' => ($default_group
? $default_group : null),
- 'assignedto'=> $assignedto,
- 'priority' => 3,
- 'status' => 'O', // O = Open
- 'subject' => $values['title'],
- 'details' =>
$values['locationdesc'].":\n\n".$values['description'],
- 'apply' => lang('Apply'),
- 'contact_id'=> 0,
- 'location' => $location,
- 'street_name' =>
$location_details['street_name'],
- 'street_number' =>
$location_details['street_number'],
- 'location_name' =>
$location_details['loc1_name'],
- //'locationdesc' =>
$values['locationdesc']
- );
-
- $result = $bo->add($ticket);
- if($result['message'][0]['msg'] != null
&& $result['id'] > 0)
- {
- $msglog['message'][] =
array('msg' => lang('Ticket added'));
- $noform = true;
-
-
- // Files
- $values['file_name'] =
@str_replace(' ','_',$_FILES['file']['name']);
- if($values['file_name'] &&
$msglog['id'])
- {
- $bofiles =
CreateObject('property.bofiles');
- $to_file =
$bofiles->fakebase . '/fmticket/' . $msglog['id'] . '/' . $values['file_name'];
-
-
if($bofiles->vfs->file_exists(array(
- 'string' =>
$to_file,
- 'relatives' =>
array(RELATIVE_NONE)
- )))
- {
-
$msglog['error'][] = array('msg'=>lang('This file already exists !'));
- }
- else
- {
-
$bofiles->create_document_dir("fmticket/{$result['id']}");
-
$bofiles->vfs->override_acl = 1;
-
-
if(!$bofiles->vfs->cp(array (
- 'from' =>
$_FILES['file']['tmp_name'],
- 'to' =>
$to_file,
- 'relatives'
=> array (RELATIVE_NONE|VFS_REAL, RELATIVE_ALL))))
- {
-
$msglog['error'][] = array('msg' => lang('Failed to upload file!'));
- }
-
$bofiles->vfs->override_acl = 0;
- }
- }
-
- $redirect = true;
-
phpgwapi_cache::session_set('frontend', 'msgbox', $msglog);
- // /Files
- }
- }
- else
- {
- $msglog['error'][] =
array('msg'=>lang('Missing field(s)'));
- }
- }
-
-
- $tts_frontend_cat_selected =
$config->config_data['tts_frontend_cat'] ?
$config->config_data['tts_frontend_cat'] : array();
-
- $cats = CreateObject('phpgwapi.categories', -1,
'property', '.ticket');
- $cats->supress_info = true;
- $categories = $cats->return_sorted_array(0, false, '',
'', '', true, '', false);
-
- $category_list = array();
- foreach ( $categories as $category)
- {
- if ( in_array($category['id'],
$tts_frontend_cat_selected))
- {
- $category_list[] = array
- (
- 'id' =>
$category['id'],
- 'name' =>
$category['name'],
- 'selected' =>
$category['id'] == $default_cat ? 1 : 0
- );
- }
- }
-
- $data = array(
- 'redirect' =>
isset($redirect) ? $GLOBALS['phpgw']->link('/index.php', array('menuaction' =>
'frontend.uientity.index')) : null,
- 'msgbox_data' =>
$GLOBALS['phpgw']->common->msgbox($GLOBALS['phpgw']->common->msgbox_data($msglog)),
- 'form_action' =>
$GLOBALS['phpgw']->link('/index.php',array('menuaction' =>
'frontend.uientity.add_ticket', 'noframework' => '1')),
- 'title' => $values['title'],
- 'locationdesc' =>
$values['locationdesc'],
- 'description' =>
$values['description'],
- 'noform' => $noform,
- 'category_list' => $category_list
- );
-
-
$GLOBALS['phpgw']->xslttpl->add_file(array('frontend','helpdesk'));
- $GLOBALS['phpgw']->xslttpl->set_var('phpgw',
array('add_ticket' => $data));
- }
-
}
Modified: branches/Version-1_0-branch/frontend/inc/class.uifrontend.inc.php
===================================================================
--- branches/Version-1_0-branch/frontend/inc/class.uifrontend.inc.php
2011-06-27 13:32:14 UTC (rev 7433)
+++ branches/Version-1_0-branch/frontend/inc/class.uifrontend.inc.php
2011-06-27 13:36:06 UTC (rev 7434)
@@ -65,9 +65,9 @@
/* Get the tabs and check to see whether the user has
specified a tab or has a selected tab on session */
$tabs = $this->get_tabs();
- $type = phpgw::get_var('type', 'int', 'REQUEST');
- $tab = isset($type) ? $type :
phpgwapi_cache::session_get('frontend','tab');
- $selected = isset($tab) ? $tab :
array_shift(array_keys($tabs));
+ $location_id = phpgw::get_var('location_id', 'int',
'REQUEST');
+ $tab = isset($location_id) ? $location_id :
phpgwapi_cache::session_get('frontend','tab');
+ $selected = isset($tab) && $tab ? $tab :
array_shift(array_keys($tabs));
$this->tabs =
$GLOBALS['phpgw']->common->create_tabs($tabs, $selected);
phpgwapi_cache::session_set('frontend','tab',$selected);
@@ -278,7 +278,7 @@
$location_id =
$GLOBALS['phpgw']->locations->get_id('frontend', $location);
$tabs[$location_id] = array(
'label' => lang($name),
- 'link' =>
$GLOBALS['phpgw']->link('/',array('menuaction' => "frontend.ui{$name}.index",
'type'=>$location_id, 'noframework' => $noframework))
+ 'link' =>
$GLOBALS['phpgw']->link('/',array('menuaction' => "frontend.ui{$name}.index",
'location_id'=>$location_id, 'noframework' => $noframework))
);
}
unset($location);
@@ -461,7 +461,7 @@
{
//Forward to helpdesk
$location_id =
$GLOBALS['phpgw']->locations->get_id('frontend', '.ticket');
- $GLOBALS['phpgw']->redirect_link('/index.php',
array('menuaction' => 'frontend.uihelpdesk.index', 'type' => $location_id));
+ $GLOBALS['phpgw']->redirect_link('/index.php',
array('menuaction' => 'frontend.uihelpdesk.index', 'location_id' =>
$location_id));
}
Modified: branches/Version-1_0-branch/frontend/js/yahoo/entity.list.js
===================================================================
--- branches/Version-1_0-branch/frontend/js/yahoo/entity.list.js
2011-06-27 13:32:14 UTC (rev 7433)
+++ branches/Version-1_0-branch/frontend/js/yahoo/entity.list.js
2011-06-27 13:36:06 UTC (rev 7434)
@@ -113,6 +113,17 @@
}
+ var show_picture = function(elCell, oRecord, oColumn, oData)
+ {
+ if(oRecord.getData('img_id'))
+ {
+ var oArgs = {menuaction:'property.uigallery.view_file',
file:oRecord.getData('directory') + '/' + oRecord.getData('file_name')};
+ var sUrl = phpGWLink('index.php', oArgs);
+ elCell.innerHTML = "<a href=\""+sUrl+"\"
title=\""+oRecord.getData('file_name')+"\" id=\""+oRecord.getData('img_id')+"\"
rel=\"colorbox\" target=\"_blank\"><img src=\""+sUrl+"&thumb=1\"
alt=\""+oRecord.getData('file_name')+"\" /></a>";
+ }
+ }
+
+
/****************************************************************************************/
this.myParticularRenderEvent = function()
Copied: branches/Version-1_0-branch/frontend/templates/base/attributes_view.xsl
(from rev 7433, trunk/frontend/templates/base/attributes_view.xsl)
===================================================================
--- branches/Version-1_0-branch/frontend/templates/base/attributes_view.xsl
(rev 0)
+++ branches/Version-1_0-branch/frontend/templates/base/attributes_view.xsl
2011-06-27 13:36:06 UTC (rev 7434)
@@ -0,0 +1,364 @@
+<!-- $Id: attributes_form.xsl 7396 2011-06-17 13:19:00Z sigurdne $ -->
+ <xsl:template name="attributes_view">
+ <xsl:apply-templates select="attributes_values"/>
+ </xsl:template>
+
+
+ <xsl:template name="attributes_values" xmlns:php="http://php.net/xsl">
+ <xsl:for-each select="attributes_group" >
+ <div id="{link}">
+ <table cellpadding="2" cellspacing="2"
width="100%" align="center" border="0">
+ <xsl:apply-templates
select="attributes"/>
+ </table>
+ </div>
+ </xsl:for-each>
+ </xsl:template>
+
+ <xsl:template match="attributes">
+ <xsl:variable name="statustext"><xsl:value-of
select="statustext"/></xsl:variable>
+ <ul>
+ <li align="left" width="19%" valign="top"
title="{$statustext}">
+ <xsl:choose>
+ <xsl:when test="helpmsg=1">
+ <xsl:variable
name="help_url"><xsl:value-of select="help_url"/></xsl:variable>
+ <a href="javascript:var
w=window.open('{$help_url}','','left=50,top=100,width=550,height=400,scrollbars')">
+
<xsl:text>[</xsl:text><xsl:value-of select="input_text"/><xsl:text>]</xsl:text>
+ </a>
+ </xsl:when>
+ <xsl:otherwise>
+ <b><xsl:value-of
select="input_text"/></b>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:choose>
+ <xsl:when test="datatype='pwd'">
+ <br/>
+ <xsl:text>[ </xsl:text>
+ <xsl:choose>
+ <xsl:when
test="value!=''">
+
<xsl:value-of select="//lang_edit"/>
+ </xsl:when>
+ <xsl:otherwise>
+
<xsl:value-of select="//lang_add"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:text> ]</xsl:text>
+ </xsl:when>
+ </xsl:choose>
+ </li>
+ <li>
+ <xsl:choose>
+ <xsl:when test="name!=''">
+ <xsl:choose>
+ <xsl:when
test="datatype='R'">
+
<xsl:call-template name="choice"/>
+ </xsl:when>
+ <xsl:when
test="datatype='CH'">
+
<xsl:call-template name="choice"/>
+ </xsl:when>
+ <xsl:when
test="datatype='LB'">
+
<xsl:attribute name="disabled">
+
<xsl:text> disabled</xsl:text>
+
</xsl:attribute>
+
<xsl:for-each select="choice">
+
<xsl:choose>
+
<xsl:when test="checked='checked'">
+
<xsl:value-of disable-output-escaping="yes"
select="value"/>
+
</xsl:when>
+
</xsl:choose>
+
</xsl:for-each>
+ </xsl:when>
+ <xsl:when
test="datatype='AB'">
+ <table>
+
<ul>
+
<li>
+
<xsl:value-of select="contact_name"/>
+
</li>
+
</ul>
+
<xsl:choose>
+
<xsl:when test="contact_tel!=''">
+
<ul>
+
<li>
+
<xsl:value-of select="contact_tel"/>
+
</li>
+
</ul>
+
</xsl:when>
+
</xsl:choose>
+
<xsl:choose>
+
<xsl:when test="contact_email!=''">
+
<ul>
+
<li>
+
<a href="mailto:{contact_email}"><xsl:value-of
select="contact_email"/></a>
+
</li>
+
</ul>
+
</xsl:when>
+
</xsl:choose>
+ </table>
+ </xsl:when>
+ <xsl:when
test="datatype='ABO'">
+ <table>
+
<ul>
+
<li>
+
<xsl:variable name="org_name"><xsl:value-of
select="name"/><xsl:text>_name</xsl:text></xsl:variable>
+
<xsl:variable
name="lookup_function"><xsl:text>lookup_</xsl:text><xsl:value-of
select="name"/><xsl:text>();</xsl:text></xsl:variable>
+
<input type="hidden" name="{name}" value="{value}"
onClick="{$lookup_function}" readonly="readonly" size="5">
+
<xsl:choose>
+
<xsl:when test="disabled!=''">
+
<xsl:attribute name="disabled">
+
<xsl:text> disabled</xsl:text>
+
</xsl:attribute>
+
</xsl:when>
+
</xsl:choose>
+
</input>
+
<input size="30" type="text" name="{$org_name}"
value="{org_name}" onClick="{$lookup_function}" readonly="readonly">
+
<xsl:choose>
+
<xsl:when test="disabled!=''">
+
<xsl:attribute name="disabled">
+
<xsl:text> disabled</xsl:text>
+
</xsl:attribute>
+
</xsl:when>
+
</xsl:choose>
+
</input>
+
</li>
+
</ul>
+
<xsl:choose>
+
<xsl:when test="org_tel!=''">
+
<ul>
+
<li>
+
<xsl:value-of select="org_tel"/>
+
</li>
+
</ul>
+
</xsl:when>
+
</xsl:choose>
+
<xsl:choose>
+
<xsl:when test="org_email!=''">
+
<ul>
+
<li>
+
<a href="mailto:{org_email}"><xsl:value-of
select="org_email"/></a>
+
</li>
+
</ul>
+
</xsl:when>
+
</xsl:choose>
+ </table>
+ </xsl:when>
+ <xsl:when
test="datatype='VENDOR'">
+
<xsl:variable name="vendor_name"><xsl:value-of
select="name"/><xsl:text>_org_name</xsl:text></xsl:variable>
+
<xsl:variable name="lookup_function"><xsl:text>lookup_</xsl:text><xsl:value-of
select="name"/><xsl:text>();</xsl:text></xsl:variable>
+ <input
type="text" name="{name}" value="{value}" onClick="{$lookup_function}"
readonly="readonly" size="6">
+
<xsl:choose>
+
<xsl:when test="disabled!=''">
+
<xsl:attribute name="disabled">
+
<xsl:text> disabled</xsl:text>
+
</xsl:attribute>
+
</xsl:when>
+
</xsl:choose>
+ </input>
+ <input
size="30" type="text" name="{$vendor_name}" value="{vendor_name}"
onClick="{$lookup_function}" readonly="readonly">
+
<xsl:choose>
+
<xsl:when test="disabled!=''">
+
<xsl:attribute name="disabled">
+
<xsl:text> disabled</xsl:text>
+
</xsl:attribute>
+
</xsl:when>
+
</xsl:choose>
+ </input>
+ </xsl:when>
+ <xsl:when
test="datatype='user'">
+
<xsl:variable name="user_name"><xsl:value-of
select="name"/><xsl:text>_user_name</xsl:text></xsl:variable>
+
<xsl:variable name="lookup_function"><xsl:text>lookup_</xsl:text><xsl:value-of
select="name"/><xsl:text>();</xsl:text></xsl:variable>
+ <input
type="text" name="{name}" value="{value}" onClick="{$lookup_function}"
readonly="readonly" size="6">
+
<xsl:choose>
+
<xsl:when test="disabled!=''">
+
<xsl:attribute name="disabled">
+
<xsl:text> disabled</xsl:text>
+
</xsl:attribute>
+
</xsl:when>
+
</xsl:choose>
+ </input>
+ <input
size="30" type="text" name="{$user_name}" value="{user_name}"
onClick="{$lookup_function}" readonly="readonly">
+
<xsl:choose>
+
<xsl:when test="disabled!=''">
+
<xsl:attribute name="disabled">
+
<xsl:text> disabled</xsl:text>
+
</xsl:attribute>
+
</xsl:when>
+
</xsl:choose>
+ </input>
+ </xsl:when>
+ <xsl:when
test="datatype='D'">
+ <input
type="text" id="values_attribute_{counter}"
name="values_attribute[{counter}][value]" value="{value}" size="12"
maxlength="12" >
+
<xsl:attribute name="readonly">
+
<xsl:text> readonly</xsl:text>
+
</xsl:attribute>
+
<xsl:choose>
+
<xsl:when test="disabled!=''">
+
<xsl:attribute name="disabled">
+
<xsl:text> disabled</xsl:text>
+
</xsl:attribute>
+
</xsl:when>
+
</xsl:choose>
+ </input>
+ <img
id="values_attribute_{counter}-trigger" src="{img_cal}" alt="{lang_datetitle}"
title="{lang_datetitle}" style="cursor:pointer; cursor:hand;" />
+ </xsl:when>
+ <xsl:when
test="datatype='T'">
+
<xsl:value-of select="value"/>
+ </xsl:when>
+ <xsl:when
test="datatype='pwd'">
+ <table>
+
<ul>
+
<li>
+
<input type="password"
name="values_attribute[{counter}][value]" size="30">
+
<xsl:choose>
+
<xsl:when test="disabled!=''">
+
<xsl:attribute name="disabled">
+
<xsl:text> disabled</xsl:text>
+
</xsl:attribute>
+
</xsl:when>
+
</xsl:choose>
+
</input>
+
</li>
+
</ul>
+
<ul>
+
<li>
+
<input type="password"
name="values_attribute[{counter}][value2]" size="30">
+
<xsl:choose>
+
<xsl:when test="disabled!=''">
+
<xsl:attribute name="disabled">
+
<xsl:text> disabled</xsl:text>
+
</xsl:attribute>
+
</xsl:when>
+
</xsl:choose>
+
</input>
+
</li>
+
</ul>
+ </table>
+ </xsl:when>
+ <xsl:when
test="datatype='bolean'">
+ <input
type="checkbox" name="values_attribute[{counter}][value]" value="1">
+
<xsl:choose>
+
<xsl:when test="value!=''">
+
<xsl:attribute name="checked">
+
<xsl:text>checked</xsl:text>
+
</xsl:attribute>
+
</xsl:when>
+
</xsl:choose>
+ </input>
+ </xsl:when>
+ <xsl:when
test="datatype='link'">
+ <input
type="text" name="values_attribute[{counter}][value]" value="{value}" size="30">
+
<xsl:choose>
+
<xsl:when test="disabled!=''">
+
<xsl:attribute name="disabled">
+
<xsl:text> disabled</xsl:text>
+
</xsl:attribute>
+
</xsl:when>
+
</xsl:choose>
+ </input>
+
<xsl:choose>
+
<xsl:when test="value!=''">
+
<br/><a href="{value}" target="_blank"><xsl:value-of
select="value"/></a>
+
</xsl:when>
+
</xsl:choose>
+ </xsl:when>
+ <xsl:when
test="datatype='event'">
+
<xsl:choose>
+
<xsl:when test="warning!=''">
+
<xsl:value-of select="warning"/>
+
</xsl:when>
+
<xsl:otherwise>
+
<xsl:variable name="event_descr"><xsl:value-of
select="name"/><xsl:text>_descr</xsl:text></xsl:variable>
+
<xsl:variable
name="lookup_function"><xsl:text>lookup_</xsl:text><xsl:value-of
select="name"/><xsl:text>();</xsl:text></xsl:variable>
+
<table>
+
<ul>
+
<li>
+
<input type="text" name="{name}"
value="{value}" onClick="{$lookup_function}" readonly="readonly"
size="6"></input>
+
<input size="30" type="text"
name="{$event_descr}" value="{descr}" onClick="{$lookup_function}"
readonly="readonly">
+
<xsl:choose>
+
<xsl:when test="disabled!=''">
+
<xsl:attribute
name="disabled">
+
<xsl:text>
disabled</xsl:text>
+
</xsl:attribute>
+
</xsl:when>
+
</xsl:choose>
+
</input>
+
</li>
+
</ul>
+
<xsl:choose>
+
<xsl:when test="next!=''">
+
<ul>
+
<li>
+
<xsl:value-of
select="lang_next_run"/>
+
<xsl:text>: </xsl:text>
+
<xsl:value-of select="next"/>
+
</li>
+
</ul>
+
<ul>
+
<li>
+
<xsl:value-of
select="lang_enabled"/>
+
<xsl:text>: </xsl:text>
+
<xsl:value-of select="enabled"/>
+
</li>
+
</ul>
+
</xsl:when>
+
</xsl:choose>
+
</table>
+
</xsl:otherwise>
+
</xsl:choose>
+ </xsl:when>
+ <xsl:otherwise>
+
<xsl:value-of select="value"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ <xsl:choose>
+ <xsl:when
test="history=1">
+ <input
type="text" name="values_attribute[{counter}][date]" value=""
onFocus="{//dateformat_validate}" onKeyUp="{//onKeyUp}" onBlur="{//onBlur}"
size="12" maxlength="10" >
+ </input>
+
<xsl:variable name="link_history"><xsl:value-of
select="link_history"/></xsl:variable>
+
<xsl:variable name="lang_history_help"><xsl:value-of
select="//lang_history_help"/></xsl:variable>
+
<xsl:variable name="lang_history"><xsl:value-of
select="//lang_history"/></xsl:variable>
+ <a
href="javascript:var
w=window.open('{$link_history}','','left=50,top=100,width=550,height=400,scrollbars')"
+
title="{$lang_history_help}">
+
<xsl:value-of select="//lang_history"/></a>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:when>
+ </xsl:choose>
+ </li>
+ </ul>
+ </xsl:template>
+
+ <xsl:template name="choice">
+ <xsl:variable name="counter"><xsl:value-of
select="counter"/></xsl:variable>
+ <table cellpadding="2" cellspacing="2" width="50%" align="left">
+ <xsl:for-each select="choice" >
+ <ul>
+ <xsl:attribute name="class">
+ <xsl:choose>
+ <xsl:when test="@class">
+ <xsl:value-of
select="@class"/>
+ </xsl:when>
+ <xsl:when
test="position() mod 2 = 0">
+
<xsl:text>row_off</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+
<xsl:text>row_on</xsl:text>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:attribute>
+ <li align="left">
+ <xsl:value-of select="value"/>
+ <xsl:text> </xsl:text>
+ </li>
+ <li align="left">
+ <xsl:choose>
+ <xsl:when
test="checked='checked'">
+ <input
type="{input_type}" name="values_attribute[{$counter}][value][]" value="{id}"
checked="checked"></input>
+ </xsl:when>
+ <xsl:otherwise>
+ <input
type="{input_type}" name="values_attribute[{$counter}][value][]"
value="{id}"></input>
+ </xsl:otherwise>
+ </xsl:choose>
+ </li>
+ </ul>
+ </xsl:for-each>
+ </table>
+ </xsl:template>
Modified: branches/Version-1_0-branch/frontend/templates/base/entity.xsl
===================================================================
--- branches/Version-1_0-branch/frontend/templates/base/entity.xsl
2011-06-27 13:32:14 UTC (rev 7433)
+++ branches/Version-1_0-branch/frontend/templates/base/entity.xsl
2011-06-27 13:36:06 UTC (rev 7434)
@@ -1,7 +1,7 @@
<!-- $Id: helpdesk.xsl 6663 2010-12-09 10:45:28Z sigurdne $ -->
<xsl:template match="entity" xmlns:php="http://php.net/xsl">
<xsl:variable name="form_action"><xsl:value-of
select="form_action"/></xsl:variable>
- <div class="yui-navset" id="ticket_tabview">
+ <div class="yui-navset" id="entity_tabview">
<xsl:value-of disable-output-escaping="yes" select="tabs" />
<div class="yui-content">
<xsl:choose>
@@ -11,7 +11,7 @@
<xsl:apply-templates
select="datatable/actions" />
</div>
</div>
- <div class="tickets">
+ <div class="entity">
<table cellpadding="2" cellspacing="2"
width="95%" align="center">
<xsl:choose>
<xsl:when test="msgbox_data
!= ''">
@@ -27,117 +27,11 @@
</div>
</xsl:when>
<xsl:otherwise>
- <div class="tickets">
+ <div class="entity">
<xsl:value-of select="php:function('lang',
'no_buildings')"/>
</div>
</xsl:otherwise>
</xsl:choose>
-
</div>
</div>
-
</xsl:template>
-
-<xsl:template match="lightbox_name" xmlns:php="http://php.net/xsl">
-</xsl:template>
-
-<xsl:template match="add_ticket" xmlns:php="http://php.net/xsl">
- <xsl:choose>
- <xsl:when test="normalize-space(redirect) != ''">
- <script>
- window.parent.location = '<xsl:value-of select="redirect"/>';
- window.close();
- </script>
- </xsl:when>
- </xsl:choose>
- <h2>Ny skademelding</h2>
- <form ENCTYPE="multipart/form-data" name="form" method="post"
action="{form_action}">
- <table cellpadding="0" cellspacing="0" width="100%">
- <xsl:choose>
- <xsl:when test="msgbox_data != ''">
- <tr>
- <td align="left" colspan="2">
- <xsl:call-template name="msgbox"/>
- </td>
- </tr>
- </xsl:when>
- </xsl:choose>
-
-
- <xsl:if test="noform != 1">
- <tr>
- <td class="th_text" valign="top">
- <xsl:value-of select="php:function('lang',
'category')" />
- </td>
- <td class="th_text" valign="top">
- <select name="values[cat_id]" >
- <xsl:attribute
name="title">
- <xsl:value-of
select="php:function('lang', 'category')" />
- </xsl:attribute>
- <xsl:apply-templates
select="category_list"/>
- </select>
- </td>
- </tr>
- <tr>
- <td class="th_text" valign="top">
- <xsl:value-of select="php:function('lang', 'subject')"
/>
- </td>
- <td class="th_text" valign="top">
- <input type="text" name="values[title]"
value="{title}"/>
- </td>
- </tr>
-
- <tr>
- <td class="th_text" valign="top">
- <xsl:value-of select="php:function('lang',
'locationdesc')" />
- </td>
- <td class="th_text" valign="top">
- <input type="text" name="values[locationdesc]"
value="{locationdesc}"/>
- </td>
- </tr>
-
- <tr>
- <td valign="top">
- <xsl:value-of select="php:function('lang',
'description')" />
- </td>
- <td>
- <textarea cols="60" rows="10"
name="values[description]" wrap="virtual" onMouseout="window.status='';return
true;">
- <xsl:value-of select="description"/>
- </textarea>
- </td>
- </tr>
-
- <tr>
- <td valign="top">
- <xsl:value-of select="php:function('lang', 'file')" />
- </td>
- <td>
- <input type="file" name="file" size="50">
- <xsl:attribute name="title">
- <xsl:value-of select="php:function('lang',
'file')" />
- </xsl:attribute>
- </input>
- </td>
- </tr>
-
- <tr height="50">
- <td>
- <xsl:variable name="lang_send"><xsl:value-of
select="php:function('lang', 'send')" /></xsl:variable>
- <input type="submit" name="values[save]"
value="{$lang_send}" title='{$lang_send}'/>
- </td>
- </tr>
- </xsl:if>
- </table>
- </form>
-</xsl:template>
-
-<xsl:template match="category_list">
- <option value="{id}">
- <xsl:if test="selected != 0">
- <xsl:attribute name="selected" value="selected" />
- </xsl:if>
- <xsl:value-of disable-output-escaping="yes" select="name"/>
- </option>
-</xsl:template>
-
-
Modified: branches/Version-1_0-branch/frontend/templates/base/entityview.xsl
===================================================================
--- branches/Version-1_0-branch/frontend/templates/base/entityview.xsl
2011-06-27 13:32:14 UTC (rev 7433)
+++ branches/Version-1_0-branch/frontend/templates/base/entityview.xsl
2011-06-27 13:36:06 UTC (rev 7434)
@@ -1,5 +1,28 @@
<xsl:template match="entityinfo" xmlns:php="http://php.net/xsl">
+ <script type="text/javascript">
+ var property_js = <xsl:value-of select="property_js" />;
+ var base_java_url = <xsl:value-of select="base_java_url" />;
+ var datatable = new Array();
+ var myColumnDefs = new Array();
+
+ <xsl:for-each select="datatable">
+ datatable[<xsl:value-of select="name"/>] = [
+ {
+ values : <xsl:value-of
select="values"/>,
+ total_records : <xsl:value-of
select="total_records"/>,
+ edit_action : <xsl:value-of
select="edit_action"/>,
+ is_paginator : <xsl:value-of
select="is_paginator"/>,
+ footer : <xsl:value-of
select="footer"/>
+ }
+ ]
+ </xsl:for-each>
+
+ <xsl:for-each select="myColumnDefs">
+ myColumnDefs[<xsl:value-of select="name"/>] =
<xsl:value-of select="values"/>
+ </xsl:for-each>
+ </script>
+
<table cellpadding="2" cellspacing="2" width="95%" align="center">
<xsl:choose>
<xsl:when test="msgbox_data != ''">
@@ -17,64 +40,33 @@
<div id="entityinfo">
<ul style="margin: 2em;">
<li style="margin-bottom: 1em;">
- <a href="{entitylist}"> <<
<xsl:value-of select="php:function('lang', 'show_all_entities')"/></a>
+ <a href="{entitylist}"> <<
<xsl:value-of select="php:function('lang', 'show all entities')"/></a>
</li>
<li>
- <ul>
- <li style="margin-bottom: 5px;">
- <img
src="frontend/templates/base/images/16x16/comment.png" class="list_image"/>
<strong><xsl:value-of select="entity/subject"/></strong>
- </li>
- <li class="entity_detail">
- <img
src="frontend/templates/base/images/16x16/clock_edit.png" class="list_image"/>
<xsl:value-of select="php:function('lang', 'entry_date')"/> <xsl:value-of
select="entity/entry_date"/><xsl:value-of select="php:function('lang',
'of')"/><xsl:value-of select="entity/user_name"/>
- </li>
- <li class="entity_detail">
- <img
src="frontend/templates/base/images/16x16/timeline_marker.png"
class="list_image"/> <xsl:value-of select="php:function('lang', 'status')"/>:
<xsl:value-of select="entity/status_name"/>
- </li>
- <xsl:choose>
- <xsl:when
test="entity/value_vendor_name">
- <li
class="entity_detail">
- <img
src="frontend/templates/base/images/16x16/user_suit.png" class="list_image"/>
<xsl:value-of select="php:function('lang', 'vendor')"/>: <xsl:value-of
select="entity/value_vendor_name"/>
- </li>
- </xsl:when>
- </xsl:choose>
- <xsl:choose>
- <xsl:when
test="entity/assigned_to_name">
- <li
class="entity_detail">
- <img
src="frontend/templates/base/images/16x16/user_red.png" class="list_image"/>
<xsl:value-of select="php:function('lang', 'assigned_to')"/>: <xsl:value-of
select="entity/assigned_to_name"/>
- </li>
- </xsl:when>
- </xsl:choose>
- <xsl:choose>
- <xsl:when
test="entity/value_contact_name">
- <li
class="entity_detail">
- <img
src="frontend/templates/base/images/16x16/user_green.png" class="list_image"/>
<xsl:value-of select="php:function('lang', 'contact')"/>: <xsl:value-of
select="entity/value_contact_name"/>
-
Telefon: <xsl:value-of select="entity/value_contact_tel"/>
- E-post:
<xsl:value-of select="entity/value_contact_email"/>
- </li>
- </xsl:when>
- </xsl:choose>
- <xsl:choose>
- <xsl:when
test="entity/publish_note = 1">
- <li
class="entity_detail">
- <img
src="frontend/templates/base/images/16x16/page_white_edit.png"
class="list_image"/><xsl:value-of select="php:function('lang', 'message')"/>:
<xsl:value-of select="entity/details"/>
- </li>
- </xsl:when>
- </xsl:choose>
- <li class="entity_detail">
- <img
src="frontend/templates/base/images/16x16/comments.png" class="list_image"/>
<xsl:value-of select="php:function('lang', 'comments')"/>:<br/>
- <hr/>
- <ul>
- <xsl:for-each
select="entityhistory/*[starts-with(name(), 'record')]">
- <li
class="entity_detail">
- <img
src="frontend/templates/base/images/16x16/page_white_edit.png"
class="list_image"/> <xsl:value-of select="date"/> -
- <img
src="frontend/templates/base/images/16x16/user_gray.png" class="list_image"/>
<xsl:value-of select="user"/><br/>
- <p
style="padding: 10px;"><xsl:value-of select="note"/></p>
- </li>
- </xsl:for-each>
- </ul>
- </li>
- </ul>
+ <xsl:choose>
+ <xsl:when
test="location_data!=''">
+ <li>
+
<b><xsl:value-of select="php:function('lang', 'location')"/></b>
+ </li>
+ <div
id="location">
+ <table>
+
<xsl:call-template name="location_view"/>
+ </table>
+ </div>
+ </xsl:when>
+ </xsl:choose>
+ </li>
+ <li>
+ <xsl:apply-templates
select="custom_attributes/attributes"/>
+ <hr/>
</li>
+ <xsl:choose>
+ <xsl:when test="files!=''">
+ <li>
+ <div
id="datatable-container_0"></div>
+ </li>
+ </xsl:when>
+ </xsl:choose>
</ul>
</div>
</div>
Modified: branches/Version-1_0-branch/phpgwapi/inc/class.xslttemplates.inc.php
===================================================================
--- branches/Version-1_0-branch/phpgwapi/inc/class.xslttemplates.inc.php
2011-06-27 13:32:14 UTC (rev 7433)
+++ branches/Version-1_0-branch/phpgwapi/inc/class.xslttemplates.inc.php
2011-06-27 13:36:06 UTC (rev 7434)
@@ -395,6 +395,7 @@
if (!$html || $html == '<?xml version="1.0"?>')
{
+ _debug_array(libxml_get_last_error());
echo "<h2>xml-data</h2>";
$this->list_lineno($this->xmldata, true);
Modified: branches/Version-1_0-branch/property/inc/class.boentity.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.boentity.inc.php
2011-06-27 13:32:14 UTC (rev 7433)
+++ branches/Version-1_0-branch/property/inc/class.boentity.inc.php
2011-06-27 13:36:06 UTC (rev 7434)
@@ -52,10 +52,10 @@
var $public_functions = array
(
'read' => true,
- 'read_single' => true,
+ 'read_single' => true,
'save' => true,
'delete' => true,
- 'check_perms' => true
+ 'check_perms' => true
);
var $type_app = array();
@@ -211,10 +211,32 @@
}
$filter = array('list' => ''); // translates to "list
IS NULL"
$columns =
$this->custom->find($this->type_app[$this->type],".{$this->type}.{$entity_id}.{$cat_id}",
0, '','','',true, false, $filter);
+ $columns = array_merge( $columns,
$this->get_column_list() );
$column_list=$this->bocommon->select_multi_list($selected,$columns);
return $column_list;
}
+ function get_column_list()
+ {
+ $columns = array();
+ $columns['user_id'] = array
+ (
+ 'id' => 'user_id',
+ 'input_type' => 'text',
+ 'name' => 'user_id',
+ 'descr' => lang('User'),
+ 'statustext' => lang('User'),
+ 'align' => '',
+ 'datatype' => 'user',
+ 'sortable' => false,
+ 'exchange' => false,
+ 'formatter' => '',
+ 'classname' => ''
+ );
+
+ return $columns;
+ }
+
function select_category_list($format='',$selected='',
$required = '')
{
switch($format)
@@ -316,10 +338,28 @@
$this->total_records = $this->so->total_records;
$this->uicols = $this->so->uicols;
+
+ $user_columns =
isset($GLOBALS['phpgw_info']['user']['preferences'][$this->type_app[$this->type]]["{$this->type}_columns_{$this->entity_id}_{$this->cat_id}"])?$GLOBALS['phpgw_info']['user']['preferences'][$this->type_app[$this->type]]["{$this->type}_columns_{$this->entity_id}_{$this->cat_id}"]:array();
+ $custom_cols = $this->get_column_list();
+//_debug_array($user_columns);
+//_debug_array($column_list);
+/*
+ foreach ($custom_cols as $col_id => $col_info)
+ {
+ if( in_array( $col_id, $user_columns ) )
+ {
+ $cols_extra[] = array
+ (
+ 'name' => $col_id,
+ 'datatype' =>
$column_list[$col_id]['datatype']
+ );
+ }
+ }
+*/
$cols_extra = $this->so->cols_extra;
$cols_return_lookup =
$this->so->cols_return_lookup;
//_debug_array($entity);
- //_debug_array($cols_extra);
+// _debug_array($cols_extra);
//_debug_array($cols_return_lookup);
// if(isset($data['lookup']) && $data['lookup'])
@@ -412,9 +452,12 @@
else
{
$values['files'][] = array
- (
- 'name' =>
$file['name']
- );
+ (
+ 'name' =>
$file['name'],
+ 'directory' =>
$file['directory'],
+ 'file_id' =>
$file['file_id'],
+ 'mime_type' =>
$file['mime_type']
+ );
}
}
Modified: branches/Version-1_0-branch/property/inc/class.soentity.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.soentity.inc.php
2011-06-27 13:32:14 UTC (rev 7433)
+++ branches/Version-1_0-branch/property/inc/class.soentity.inc.php
2011-06-27 13:36:06 UTC (rev 7434)
@@ -210,16 +210,6 @@
$cols .= ", {$entity_table}.user_id";
$cols_return[] =
'user_id';
- $uicols['input_type'][] = 'text';
- $uicols['name'][] =
'user_id';
- $uicols['descr'][] =
lang('User');
- $uicols['statustext'][] = lang('User');
- $uicols['align'][] = '';
- $uicols['datatype'][] = 'user';
- $uicols['sortable'][] = false;
- $uicols['exchange'][] = false;
- $uicols['formatter'][] = '';
- $uicols['classname'][] = '';
$cols_return_extra[]= array
(
@@ -259,11 +249,20 @@
{
//-------------------
- $user_columns =
isset($GLOBALS['phpgw_info']['user']['preferences'][$this->type_app[$this->type]]['entity_columns_'.$entity_id.'_'.$cat_id])?$GLOBALS['phpgw_info']['user']['preferences'][$this->type_app[$this->type]]['entity_columns_'.$entity_id.'_'.$cat_id]:'';
+ $user_columns =
isset($GLOBALS['phpgw_info']['user']['preferences'][$this->type_app[$this->type]]['entity_columns_'.$entity_id.'_'.$cat_id])?$GLOBALS['phpgw_info']['user']['preferences'][$this->type_app[$this->type]]['entity_columns_'.$entity_id.'_'.$cat_id]:array();
+
+ $_user_columns = array();
+ foreach ($user_columns as $user_column_id)
+ {
+ if(ctype_digit($user_column_id))
+ {
+ $_user_columns[] =
$user_column_id;
+ }
+ }
$user_column_filter = '';
if (isset($user_columns) AND
is_array($user_columns) AND $user_columns[0])
{
- $user_column_filter = " OR
($attribute_filter AND id IN (" . implode(',',$user_columns) .'))';
+ $user_column_filter = " OR
($attribute_filter AND id IN (" . implode(',',$_user_columns) .'))';
}
$this->db->query("SELECT * FROM
$attribute_table WHERE list=1 AND $attribute_filter $user_column_filter ORDER
BY group_id, attrib_sort ASC");
@@ -277,6 +276,10 @@
$uicols['statustext'][] =
$this->db->f('statustext');
$uicols['datatype'][$i] =
$this->db->f('datatype');
$uicols['sortable'][$i] = true;
+ $uicols['exchange'][$i] = false;
+ $uicols['formatter'][$i] = '';
+ $uicols['classname'][$i] = '';
+
$uicols['cols_return_extra'][$i] = array
(
'name' =>
$this->db->f('column_name'),
@@ -300,6 +303,10 @@
$uicols['statustext'][] = lang('entry
date' );
$uicols['datatype'][] = 'timestamp';
$uicols['sortable'][] = true;
+ $uicols['exchange'][] = false;
+ $uicols['formatter'][] = '';
+ $uicols['classname'][] = '';
+
$uicols['cols_return_extra'][$i] = array
(
'name' => 'entry_date',
Modified: branches/Version-1_0-branch/property/inc/class.solocation.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.solocation.inc.php
2011-06-27 13:32:14 UTC (rev 7433)
+++ branches/Version-1_0-branch/property/inc/class.solocation.inc.php
2011-06-27 13:36:06 UTC (rev 7434)
@@ -248,16 +248,15 @@
return $owners;
}
- function check_location($location_code='',$type_id='')
+ function check_location($location_code, $type_id = 0)
{
- $this->db->query("SELECT count(*) AS cnt FROM
fm_location$type_id where location_code='$location_code'");
-
- $this->db->next_record();
-
- if ( $this->db->f('cnt'))
+ if(!$type_id)
{
- return true;
+ $type_id = count(explode('-',$location_code));
}
+ $this->db->query("SELECT location_code FROM
fm_location{$type_id} WHERE location_code='{$location_code}'");
+
+ return $this->db->next_record();
}
function read($data)
Modified: branches/Version-1_0-branch/property/inc/class.uientity.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.uientity.inc.php
2011-06-27 13:32:14 UTC (rev 7433)
+++ branches/Version-1_0-branch/property/inc/class.uientity.inc.php
2011-06-27 13:36:06 UTC (rev 7434)
@@ -1118,7 +1118,7 @@
{
$id = phpgw::get_var('id', 'int');
- if(!$this->acl_add && !$this->acl_edit)
+ if($mode == 'edit' && (!$this->acl_add &&
!$this->acl_edit))
{
$GLOBALS['phpgw']->redirect_link('/index.php',array
(
@@ -1572,13 +1572,6 @@
//
$GLOBALS['phpgw']->js->validate_file('overlib','overlib','property');
- $table_apply[] = array
- (
- 'lang_save'
=> lang('save'),
- 'lang_cancel'
=> lang('cancel'),
- 'lang_apply'
=> lang('apply'),
- );
-
$pdf_data = array
(
'menuaction' =>
'property.uientity.print_pdf',
@@ -1797,7 +1790,14 @@
for($z=0; $z<count($values['files']); $z++)
{
$content_files[$z]['file_name'] = '<a
href="'.$GLOBALS['phpgw']->link('/index.php',$link_file_data).'&file_name='.$values['files'][$z]['name'].'"
target="_blank" title="'.lang('click to view
file').'">'.$values['files'][$z]['name'].'</a>';
- $content_files[$z]['delete_file'] = '<input
type="checkbox" name="values[file_action][]"
value="'.$values['files'][$z]['name'].'" title="'.lang('Check to delete
file').'">';
+ if($mode == 'edit')
+ {
+ $content_files[$z]['delete_file'] =
'<input type="checkbox" name="values[file_action][]"
value="'.$values['files'][$z]['name'].'" title="'.lang('Check to delete
file').'">';
+ }
+ else
+ {
+ $content_files[$z]['delete_file'] = '';
+ }
}
$datavalues[0] = array
@@ -1985,14 +1985,11 @@
'value_id'
=> $values['id'],
'value_num'
=> $values['num'],
'error_flag'
=> isset($error_id)?$error_id:'',
- 'lang_done_statustext'
=> lang('Back to the list'),
- 'lang_save_statustext'
=> lang('Save the entity'),
'lang_history'
=> lang('history'),
'lang_history_help'
=> lang('history of this attribute'),
'lang_history_date_statustext' =>
lang('Enter the date for this reading'),
'lang_date'
=> lang('date'),
- 'table_apply'
=> $table_apply,
'textareacols'
=>
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['textareacols'])
&& $GLOBALS['phpgw_info']['user']['preferences']['property']['textareacols'] ?
$GLOBALS['phpgw_info']['user']['preferences']['property']['textareacols'] : 40,
'textarearows'
=>
isset($GLOBALS['phpgw_info']['user']['preferences']['property']['textarearows'])
&& $GLOBALS['phpgw_info']['user']['preferences']['property']['textarearows'] ?
$GLOBALS['phpgw_info']['user']['preferences']['property']['textarearows'] : 6,
'tabs'
=> phpgwapi_yui::tabview_generate($tabs, $active_tab),
Modified: branches/Version-1_0-branch/property/inc/class.uiimport.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.uiimport.inc.php
2011-06-27 13:32:14 UTC (rev 7433)
+++ branches/Version-1_0-branch/property/inc/class.uiimport.inc.php
2011-06-27 13:36:06 UTC (rev 7434)
@@ -91,11 +91,11 @@
}
$result = $this->import(); // Do import step,
result determines if finished for this area
- echo '<li class="info">Aktiviteter: finished
step ' .$result. '</li>';
+ echo '<li class="info">Import: finished step '
.$result. '</li>';
while($result != '1')
{
$result = $this->import();
- echo '<li class="info">Aktiviteter:
finished step ' .$result. '</li>';
+ echo '<li class="info">Import: finished
step ' .$result. '</li>';
flush();
}
Modified: branches/Version-1_0-branch/property/inc/class.uilocation.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.uilocation.inc.php
2011-06-27 13:32:14 UTC (rev 7433)
+++ branches/Version-1_0-branch/property/inc/class.uilocation.inc.php
2011-06-27 13:36:06 UTC (rev 7434)
@@ -239,7 +239,7 @@
foreach ($_config as $_config_section =>
$_config_section_data)
{
$integrationurl = '';
- if(isset($_config_section_data['url']))
+ if(isset($_config_section_data['url']) &&
!isset($_config_section_data['tab']))
{
if(isset($_config_section_data['auth_hash_name']) &&
$_config_section_data['auth_hash_name'] &&
isset($_config_section_data['auth_url']) && $_config_section_data['auth_url'])
{
@@ -2157,6 +2157,7 @@
$documents = array();
$file_tree = array();
+ $integration = array();
if($location_code)
{
$_role_criteria = array
@@ -2279,7 +2280,6 @@
integration_auth_hash_value
integration_location_data
*/
- $integration = array();
foreach ($_config as $_config_section =>
$_config_section_data)
{
if(isset($_config_section_data['tab']))
Modified: branches/Version-1_0-branch/property/inc/class.uitts.inc.php
===================================================================
--- branches/Version-1_0-branch/property/inc/class.uitts.inc.php
2011-06-27 13:32:14 UTC (rev 7433)
+++ branches/Version-1_0-branch/property/inc/class.uitts.inc.php
2011-06-27 13:36:06 UTC (rev 7434)
@@ -1836,7 +1836,7 @@
}
//--------------end files
$GLOBALS['phpgw']->session->appsession('receipt','property',$receipt);
-
$GLOBALS['phpgw']->session->appsession('session_data','fm_tts','');
+ //
$GLOBALS['phpgw']->session->appsession('session_data','fm_tts','');
if ((isset($values['save']) &&
$values['save']))
{
@@ -2059,7 +2059,7 @@
{
$receipt = $this->bo->add($values);
$GLOBALS['phpgw']->session->appsession('receipt','property',$receipt);
-
$GLOBALS['phpgw']->session->appsession('session_data','fm_tts','');
+ //
$GLOBALS['phpgw']->session->appsession('session_data','fm_tts','');
$GLOBALS['phpgw']->redirect_link('/index.php',array('menuaction'=>
'property.uitts.index'));
}
else
Modified:
branches/Version-1_0-branch/property/inc/import/default/cvs_import_kunstoversikt_bkb
===================================================================
---
branches/Version-1_0-branch/property/inc/import/default/cvs_import_kunstoversikt_bkb
2011-06-27 13:32:14 UTC (rev 7433)
+++
branches/Version-1_0-branch/property/inc/import/default/cvs_import_kunstoversikt_bkb
2011-06-27 13:36:06 UTC (rev 7434)
@@ -55,12 +55,6 @@
$id = (int)$data[2];
- $this->db->query("SELECT id FROM {$table} WHERE id =
{$id}",__LINE__,__FILE__);
- if($this->db->next_record())
- {
- $this->errors[] = "ID finnes fra før: {$id}";
- return true;
- }
$this->messages[] = "Dagens dato er lagt inn som
registreringsdato for {$id} (mangler info)";
$entry_date = time();
@@ -69,7 +63,7 @@
//_debug_array($entry_date);
$value_set = array();
- $value_set['id']
= $id;
+
$value_set['num']
= sprintf('%04s',$id);
$value_set['loc1'] =
$location_data['loc1'];
$value_set['loc2'] =
$location_data['loc2'];
@@ -82,10 +76,21 @@
$value_set['beskrivelse'] =
$this->db->db_addslashes($data[4]);
$value_set['tilstand'] =
$this->db->db_addslashes($data[5]);
- $cols = implode(',', array_keys($value_set));
- $values =
$this->db->validate_insert(array_values($value_set));
+ $this->db->query("SELECT id FROM {$table} WHERE id =
{$id}",__LINE__,__FILE__);
+ if($this->db->next_record())
+ {
+ $this->warnings[] = "ID finnes fra før: {$id},
oppdaterer";
+ $value_set =
$this->db->validate_update($value_set);
+ $sql = "UPDATE {$table} SET {$value_set} WHERE
id = {$id}";
+ }
+ else
+ {
+ $value_set['id'] = $id;
+ $cols = implode(',', array_keys($value_set));
+ $values =
$this->db->validate_insert(array_values($value_set));
- $sql = "INSERT INTO {$table} ({$cols}) VALUES
({$values})";
+ $sql = "INSERT INTO {$table} ({$cols}) VALUES
({$values})";
+ }
if($debug)
{
Copied:
branches/Version-1_0-branch/property/inc/import/default/cvs_import_romdata_bkb
(from rev 7433, trunk/property/inc/import/default/cvs_import_romdata_bkb)
===================================================================
---
branches/Version-1_0-branch/property/inc/import/default/cvs_import_romdata_bkb
(rev 0)
+++
branches/Version-1_0-branch/property/inc/import/default/cvs_import_romdata_bkb
2011-06-27 13:36:06 UTC (rev 7434)
@@ -0,0 +1,200 @@
+<?php
+ class import_conversion
+ {
+ protected $db;
+ public $messages = array();
+ public $warnings = array();
+ public $errors = array();
+ protected $debug = false;
+
+ public function __construct()
+ {
+ set_time_limit(10000); //Set the time limit for this
request
+ $this->account =
(int)$GLOBALS['phpgw_info']['user']['account_id'];
+ $this->db = & $GLOBALS['phpgw']->db;
+ $this->solocation =
CreateObject('property.solocation');
+ }
+
+ public function add($data)
+ {
+ $location_code = $this->decode($data[0]);
+ if(!$location_code)
+ {
+ $this->errors[] = "Mangler objekt, hopper over:
{$data[1]}";
+ return false;
+ }
+
+ $location_arr = explode('-',$location_code);
+ $_test_floor =
"{$location_arr[0]}-{$location_arr[1]}-{$location_arr[2]}";
+ $_test_zone =
"{$location_arr[0]}-{$location_arr[1]}-{$location_arr[2]}-{$location_arr[3]}";
+
+ $ok = true;
+ if(!$this->solocation->check_location($_test_floor))
+ {
+ $_ok =
$this->add_location(array('location_code' => $_test_floor, 'name' => "etasje
{{$location_arr[2]}}", 'area' => 0));
+ $ok = $_ok ? $_ok : false;
+ }
+
+ if(!$this->solocation->check_location($_test_zone))
+ {
+ $_ok =
$this->add_location(array('location_code' => $_test_zone, 'name' => "sone
{{$location_arr[3]}}", 'area' => 0));
+ $ok = $_ok && $ok ? $_ok : false;
+ }
+
+ if(!$this->solocation->check_location($location_code))
+ {
+ $_ok =
$this->add_location(array('location_code' => $location_code, 'name' =>
$this->decode($data[6]), 'area' => $this->decode($data[7])));
+ $ok = $_ok && $ok ? $_ok : false;
+ }
+ else
+ {
+ $this->warnings[] = "location_code finnes fra
før: {$location_code}, oppdaterer";
+ $_ok =
$this->update_location(array('location_code' => $location_code, 'name' =>
$this->decode($data[6]), 'area' => $this->decode($data[7])));
+ $ok = $_ok && $ok ? $_ok : false;
+ }
+
+ return $ok;
+ }
+
+ protected function add_location($data)
+ {
+ $debug = $this->debug;
+ $error = false;
+ $ok = true;
+ $value_set = array();
+
+ $location_arr = explode('-',$data['location_code']);
+ $type_id = count($location_arr);
+
+ $formatting = array
+ (
+ '%04s',
+ '%02s',
+ '%02s',
+ '%02s',
+ '%03s'
+ );
+
+ $value_set['location_code'] =
$data['location_code'];
+ foreach ($location_arr as $_key => $_loc)
+ {
+ $i = $_key +1;
+ $value_set["loc{$i}"] =
sprintf($formatting[$_key],$location_arr[$_key]);
+ }
+
+ $value_set["loc{$type_id}_name"] =
$this->db->db_addslashes($data['name']);
+ $value_set['category'] = 1;
+ $value_set['user_id'] =
$this->account;
+ $value_set['entry_date'] =
time();
+ $value_set['area_net'] =
$data['area'] ? str_replace(',','.',$data['area']) : 0;
+ $value_set['merknader'] =
'Opprettet fra tegning: ' . date('d/m/Y');
+
+ $cols = implode(',', array_keys($value_set));
+ $values =
$this->db->validate_insert(array_values($value_set));
+
+ $table = "fm_location{$type_id}";
+
+ $sql = "INSERT INTO {$table} ({$cols}) VALUES
({$values})";
+
+ $sql2 = "INSERT INTO fm_locations (level,
location_code) VALUES ({$type_id}, '{$data['location_code']}')";
+
+ if($debug)
+ {
+ _debug_array($sql);
+ }
+ else
+ {
+ $_ok = $this->db->query($sql,__LINE__,__FILE__);
+ $ok = $_ok ? $_ok : false;
+ $_ok =
$this->db->query($sql2,__LINE__,__FILE__);
+ $ok = $_ok ? $_ok : false;
+ }
+
+ if(!$error && $ok)
+ {
+ $this->messages[] = "Successfully imported
location: {$data['location_code']}";
+ }
+ else
+ {
+ $this->errors[] = "Error importing location:
{$data['location_code']}";
+ }
+ return $ok;
+ }
+
+ protected function update_location($data)
+ {
+ $debug = $this->debug;
+ $ok = false;
+ $value_set = array();
+
+ $location_arr = explode('-',$data['location_code']);
+ $type_id = count($location_arr);
+ $table = "fm_location{$type_id}";
+
+ $value_set["loc{$type_id}_name"] =
$this->db->db_addslashes($data['name']);
+ $value_set['area_net'] =
$data['area'] ? str_replace(',','.',$data['area']) : 0;
+
+ $this->db->query("SELECT merknader FROM {$table} WHERE
location_code = '{$data['location_code']}'",__LINE__,__FILE__);
+ $this->db->next_record();
+
+ $merknader = $this->db->f('merknader',true);
+
+ $value_set['merknader'] = '';
+ if($merknader)
+ {
+ $value_set['merknader'] = "{$merknader}\n";
+ }
+ $value_set['merknader'] .=
"Oppdatert fra tegning: " . date('d/m/Y');
+
+ $value_set =
$this->db->validate_update($value_set);
+ $sql = "UPDATE {$table} SET {$value_set} WHERE
location_code = '{$data['location_code']}'";
+
+ if($debug)
+ {
+ _debug_array($sql);
+ $ok = true;
+ }
+ else
+ {
+ $ok = $this->db->query($sql,__LINE__,__FILE__);
+ }
+
+ if($ok)
+ {
+ $this->messages[] = "Successfully updated
location: {$data['location_code']}";
+ }
+ else
+ {
+ $this->errors[] = "Error update location:
{$data['location_code']}";
+ }
+ return $ok;
+ }
+
+ /**
+ * Convert from the locale encoding to UTF-8 encoding and
escape single quotes
+ *
+ * @param string $value The value to convert
+ * @return string
+ */
+ protected function decode($value)
+ {
+ $converted = $value;// mb_convert_encoding($value,
'UTF-8');
+ if ($this->is_null(trim($converted)))
+ {
+ return null;
+ }
+ return stripslashes($converted);
+ }
+
+ /**
+ * Test a value for null according to several formats that can
exist in the export.
+ * Returns true if the value is null according to these rules,
false otherwise.
+ *
+ * @param string $value The value to test
+ * @return bool
+ */
+ protected function is_null($value)
+ {
+ return ((trim($value) == "") || ($data == "<NULL>") ||
($data == "''"));
+ }
+ }
Modified: branches/Version-1_0-branch/property/setup/phpgw_no.lang
===================================================================
--- branches/Version-1_0-branch/property/setup/phpgw_no.lang 2011-06-27
13:32:14 UTC (rev 7433)
+++ branches/Version-1_0-branch/property/setup/phpgw_no.lang 2011-06-27
13:36:06 UTC (rev 7434)
@@ -166,6 +166,8 @@
apartment id property no leilighet ID
applications property no Applikasjoner
apply the values property no Bruke verdier
+apply property no Mellomlagre
+save and stay in form property no Lagre og bli stående i skjemaet
approval property no Godkjenning
approvals property no Godkjenninger
approvals request property no Anmodninger om godkjenning
@@ -289,7 +291,7 @@
choose a category property no Velg en kategori
choose an id property no Velg en ID
choose charge tenant if the tenant i to pay for this project property
no Kryss av for å belaste leietaker dersom leietakeren skal betale for
arbeidene
-choose columns property no Velg kolonner
+choose columns common no Velg kolonner
choose copy hour to copy this hour to a new hour property no
Kryss av for å kopiere denne posten til en ny post
choose copy project to copy this project to a new project property
no Kryss av for å kopiere dette prosjektet til et nytt prosjekt
choose copy request to copy this request to a new request property
no Kryss av for å kopiere denne anmodningen til en ny anmodning
@@ -333,7 +335,7 @@
column description property no Beskrivelse av kolonne
column name property no Kolonnenavn
column name not entered! property no Manglende kolonnenavn
-columns property no kolonner
+columns common no kolonner
columns is updated property no Kolonner er oppdatert
common costs property no Fellsekostnader
communication descriptions manager property no Kommunikasjons
beskrivelse
@@ -527,8 +529,8 @@
do not add this invoice property no Ikke legg til denne
fakturaen
do not import this invoice property no Ikke importer dette
bilaget
down property no Ned
-download property no Last ned
-download table to your browser property no Last ned tabell til din
nettleser
+download common no Last ned
+download table to your browser common no Last ned tabell til din
nettleser
do you really want to change the status to %1 property no Vil du
virkelig endre status til %1
do you really want to delete this entry property no Vil du
virkelig slette denne posten
do you really want to update the categories property no vil du
virkelig oppdatere kategoriene
@@ -735,8 +737,8 @@
entrance has been edited property no inngang er rettet
entrance has been saved property no inngang er lagret
entrance id property no inngang ID
-entry date property no Registrert dato
-entry_date property no Registrert dato
+entry date common no Registrert dato
+entry_date common no Registrert dato
equipment property no Utstyr
equipment %1 has been edited property no utstyr %1 er rettet
equipment %1 has been saved property no utstyr %1 er lagret
@@ -1355,6 +1357,7 @@
save the voucher property no lagre bilag
save the workorder property no lagre bestilling
save this workorder as a template for later use property no
lagre denne bestillingen som mal for senere bruk
+save values and exit property no Lagre verdier og gå til liste
scale property no Scale
schedule property no planlegge (tid)
scheduled events property no Planlagte oppgaver
@@ -1563,6 +1566,7 @@
shared use property no Delt bruk
shift down property no Skift ned
shift up property no Skift opp
+show all entities common no Vis alle poster
show calculated cost property no Vis sum
show calculated cost on the printview property no Vis sum på
utskrift
show details property no Vis detaljer
Modified: branches/Version-1_0-branch/property/templates/base/entity.xsl
===================================================================
--- branches/Version-1_0-branch/property/templates/base/entity.xsl
2011-06-27 13:32:14 UTC (rev 7433)
+++ branches/Version-1_0-branch/property/templates/base/entity.xsl
2011-06-27 13:36:06 UTC (rev 7434)
@@ -76,7 +76,7 @@
<xsl:when test="mode = 'edit'">
<tr>
<td colspan =
"2" align = "center">
-
<xsl:apply-templates select="table_apply"/>
+
<xsl:call-template name="table_apply"/>
</td>
</tr>
</xsl:when>
@@ -316,7 +316,7 @@
<table cellpadding="2"
cellspacing="2" width="80%" align="center">
<tr height="50">
<td colspan="2"
align = "center">
-
<xsl:apply-templates select="table_apply"/>
+
<xsl:call-template name="table_apply"/>
</td>
</tr>
</table>
@@ -383,30 +383,31 @@
</xsl:template>
- <xsl:template match="table_apply">
+ <xsl:template name="table_apply" xmlns:php="http://php.net/xsl">
<table>
<tr>
<td valign="bottom">
- <xsl:variable
name="lang_save"><xsl:value-of select="lang_save"/></xsl:variable>
+ <xsl:variable
name="lang_save"><xsl:value-of select="php:function('lang', 'save')"
/></xsl:variable>
<input type="submit"
name="values[save]" value="{$lang_save}">
<xsl:attribute name="title">
- <xsl:value-of
select="lang_save_statustext"/>
+ <xsl:value-of
select="php:function('lang', 'save values and exit')" />
</xsl:attribute>
</input>
</td>
+
<td valign="bottom">
- <xsl:variable
name="lang_apply"><xsl:value-of select="lang_apply"/></xsl:variable>
+ <xsl:variable
name="lang_apply"><xsl:value-of select="php:function('lang', 'apply')"
/></xsl:variable>
<input type="submit"
name="values[apply]" value="{$lang_apply}">
<xsl:attribute name="title">
- <xsl:value-of
select="lang_apply_statustext"/>
+ <xsl:value-of
select="php:function('lang', 'save and stay in form')" />
</xsl:attribute>
</input>
</td>
<td align="right" valign="bottom">
- <xsl:variable
name="lang_cancel"><xsl:value-of select="lang_cancel"/></xsl:variable>
+ <xsl:variable
name="lang_cancel"><xsl:value-of select="php:function('lang', 'cancel')"
/></xsl:variable>
<input type="submit"
name="values[cancel]" value="{$lang_cancel}">
<xsl:attribute name="title">
- <xsl:value-of
select="lang_cancel_statustext"/>
+ <xsl:value-of
select="php:function('lang', 'Back to the list')" />
</xsl:attribute>
</input>
</td>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [7434] Merge 7403:7433 from trunk,
Sigurd Nes <=