[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [7289] added display of contact person name
From: |
Erik Holm-Larsen |
Subject: |
[Fmsystem-commits] [7289] added display of contact person name |
Date: |
Mon, 23 May 2011 08:16:22 +0000 |
Revision: 7289
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=7289
Author: erikhl
Date: 2011-05-23 08:16:22 +0000 (Mon, 23 May 2011)
Log Message:
-----------
added display of contact person name
Modified Paths:
--------------
trunk/activitycalendar/inc/class.uiactivities.inc.php
trunk/activitycalendar/templates/base/activity.php
Modified: trunk/activitycalendar/inc/class.uiactivities.inc.php
===================================================================
--- trunk/activitycalendar/inc/class.uiactivities.inc.php 2011-05-23
08:14:37 UTC (rev 7288)
+++ trunk/activitycalendar/inc/class.uiactivities.inc.php 2011-05-23
08:16:22 UTC (rev 7289)
@@ -12,6 +12,7 @@
public $public_functions = array
(
'index' => true,
+ 'index_json' => true,
'query' => true,
'view' => true,
'add' => true,
@@ -23,6 +24,8 @@
public function __construct()
{
parent::__construct();
+ $this->bo_org = CreateObject('booking.boorganization');
+ $this->bo_group = CreateObject('booking.bogroup');
self::set_active_menu('activitycalendar::activities');
$config = CreateObject('phpgwapi.config','activitycalendar');
$config->read();
@@ -39,8 +42,29 @@
public function index()
{
$this->render('activity_list.php');
+
}
+/* public function index_json()
+ {
+ $organizations = $this->bo_org->read();
+ //array_walk($organizations["results"], array($this,
"_add_links"), "booking.uiorganization.show");
+
+ foreach($organizations["results"] as &$organization) {
+ $contact = (isset($organization['contacts']) &&
isset($organization['contacts'][0])) ? $organization['contacts'][0] : null;
+
+ if ($contact) {
+ $organization += array(
+ "primary_contact_name"
=> ($contact["name"]) ? $contact["name"] : '',
+ "primary_contact_phone"
=> ($contact["phone"]) ? $contact["phone"] : '',
+ "primary_contact_email"
=> ($contact["email"]) ? $contact["email"] : '',
+ );
+ }
+ }
+
+ return $this->yui_results($organizations);
+ }*/
+
/**
* Displays info about one single billing job.
*/
@@ -74,9 +98,9 @@
$categories =
activitycalendar_soactivity::get_instance()->get_categories();
$targets =
activitycalendar_soactivity::get_instance()->get_targets();
$offices =
activitycalendar_soactivity::get_instance()->select_district_list();
- $districts =
activitycalendar_soactivity::get_instance()->select_district_list();
+ $districts =
activitycalendar_soactivity::get_instance()->get_districts();
- // Retrieve the arena object or create a new one
+ // Retrieve the activity object or create a new one
if(isset($activity_id) && $activity_id > 0)
{
$activity =
activitycalendar_soactivity::get_instance()->get_single($activity_id);
@@ -101,14 +125,15 @@
if(isset($_POST['save_activity'])) // The user has pressed the
save button
{
- if(isset($activity)) // If a activity object is created
+ if(isset($activity)) // If an activity object is created
{
// ... set all parameters
$activity->set_title(phpgw::get_var('title'));
$activity->set_organization_id(phpgw::get_var('organization_id'));
$activity->set_group_id(phpgw::get_var('group_id'));
$activity->set_arena(phpgw::get_var('arena_id'));
-
$activity->set_district(phpgw::get_var('district'));
+ $district_array = phpgw::get_var('district');
+ $activity->set_district(implode(",",
$district_array));
$activity->set_office(phpgw::get_var('office'));
$activity->set_state(phpgw::get_var('state'));
$activity->set_category(phpgw::get_var('category'));
Modified: trunk/activitycalendar/templates/base/activity.php
===================================================================
--- trunk/activitycalendar/templates/base/activity.php 2011-05-23 08:14:37 UTC
(rev 7288)
+++ trunk/activitycalendar/templates/base/activity.php 2011-05-23 08:16:22 UTC
(rev 7289)
@@ -8,6 +8,7 @@
<div class="yui-content">
<div id="details">
<h1><img src="<?php echo ACTIVITYCALENDAR_IMAGE_PATH
?>images/32x32/custom/contact.png" /><?php echo lang('activity') ?></h1>
+ <h4><?php if($editable){echo lang('activity_helptext');}?></h4>
<form action="#" method="post">
<input type="hidden" name="id" value="<?php
if($activity->get_id()){ echo $activity->get_id(); } else { echo '0'; } ?>"/>
<dl class="proplist-col">
@@ -215,7 +216,6 @@
}
?>
</dd>
-
<dt>
<?php if($activity->get_office() ||
$editable) { ?>
<label for="office"><?php echo
lang('office') ?></label>
@@ -247,6 +247,38 @@
?>
</dd>
<dt>
+ <?php if($activity->get_district() ||
$editable) { ?>
+ <label for="district"><?php echo
lang('district') ?></label>
+ <?php } ?>
+ </dt>
+ <dd>
+ <?php
+ $current_district_ids =
$activity->get_district();
+ $current_district_id_array=explode(",",
$current_district_ids);
+ //echo
$current_target_id_array[0]."*".$current_target_id_array[1];
+ if ($editable)
+ {
+ foreach($districts as $d)
+ {
+ ?>
+ <input
name="district[]" type="checkbox" value="<?php echo $d['part_of_town_id']?>"
<?php echo (in_array($d['part_of_town_id'], $current_district_id_array) ?
'checked' : "")?>/><?php echo $d['name']?><br/>
+ <?php
+ }
+ }
+ else
+ {
+ if($activity->get_district()){
+ $current_district_ids =
$activity->get_district();
+
$current_district_id_array=explode(",", $current_district_ids);
+
foreach($current_district_id_array as $curr_district)
+ {
+ echo
$act_so->get_district_name($curr_district).'<br/>';
+ }
+ }
+ }
+ ?>
+ </dd>
+ <dt>
<?php if($activity->get_description()
|| $editable) { ?>
<label for="description"><?php echo
lang('description') ?></label>
<?php } ?>
@@ -291,14 +323,6 @@
</dt>
<dd>
<?php
- if ($editable)
- {
- ?>
- <input type="text"
name="contact_person_1" id="contact_person_1" value="<?php echo
$activity->get_contact_person_1() ?>" readonly="true"/>
- <?php
- }
- else
- {
if($activity->get_group_id())
{
echo
$contpers_so->get_group_contact_name($activity->get_contact_person_1());
@@ -307,8 +331,6 @@
{
echo
$contpers_so->get_org_contact_name($activity->get_contact_person_1());
}
- //echo
$activity->get_contact_person_1();
- }
?>
</dd>
<dt>
@@ -318,14 +340,6 @@
</dt>
<dd>
<?php
- if ($editable)
- {
- ?>
- <input type="text"
name="contact_person_2" id="contact_person_2" value="<?php echo
$activity->get_contact_person_2() ?>" readonly="true"/>
- <?php
- }
- else
- {
if($activity->get_group_id())
{
echo
$contpers_so->get_group_contact_name($activity->get_contact_person_2());
@@ -334,8 +348,6 @@
{
echo
$contpers_so->get_org_contact_name($activity->get_contact_person_2());
}
- //echo
$activity->get_contact_person_2();
- }
?>
</dd>
<dt>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [7289] added display of contact person name,
Erik Holm-Larsen <=