fmsystem-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fmsystem-commits] [16888] more on eventplanner


From: sigurdne
Subject: [Fmsystem-commits] [16888] more on eventplanner
Date: Wed, 28 Jun 2017 09:57:36 -0400 (EDT)

Revision: 16888
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=16888
Author:   sigurdne
Date:     2017-06-28 09:57:36 -0400 (Wed, 28 Jun 2017)
Log Message:
-----------
more on eventplanner

Modified Paths:
--------------
    trunk/eventplanner/inc/class.boevents.inc.php
    trunk/eventplanner/inc/class.soevents.inc.php
    trunk/eventplanner/inc/class.uievents.inc.php
    trunk/eventplanner/inc/model/class.events.inc.php

Modified: trunk/eventplanner/inc/class.boevents.inc.php
===================================================================
--- trunk/eventplanner/inc/class.boevents.inc.php       2017-06-28 13:36:28 UTC 
(rev 16887)
+++ trunk/eventplanner/inc/class.boevents.inc.php       2017-06-28 13:57:36 UTC 
(rev 16888)
@@ -89,11 +89,13 @@
                        $dateformat = 
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
                        foreach ($values['results'] as &$entry)
                        {
+                               $date_end =  
eventplanner_soevents::get_instance()->get_date_end($entry['id']);
+
                                $entry['status'] = 
$status_text[$entry['status']];
                                $entry['created'] = 
$GLOBALS['phpgw']->common->show_date($entry['created']);
                                $entry['modified'] = 
$GLOBALS['phpgw']->common->show_date($entry['modified']);
                                $entry['date_start'] = 
$GLOBALS['phpgw']->common->show_date($entry['date_start'], $dateformat);
-                               $entry['date_end'] = 
$GLOBALS['phpgw']->common->show_date($entry['date_end'], $dateformat);
+                               $entry['date_end'] = 
$GLOBALS['phpgw']->common->show_date($date_end, $dateformat);
                                $entry['case_officer_id'] = 
$entry['case_officer_id'] ? 
$GLOBALS['phpgw']->accounts->get($entry['case_officer_id'])->__toString() : '';
                        }
                        return $values;

Modified: trunk/eventplanner/inc/class.soevents.inc.php
===================================================================
--- trunk/eventplanner/inc/class.soevents.inc.php       2017-06-28 13:36:28 UTC 
(rev 16887)
+++ trunk/eventplanner/inc/class.soevents.inc.php       2017-06-28 13:57:36 UTC 
(rev 16888)
@@ -60,4 +60,12 @@
                {
                        //nothing;
                }
+
+               public function get_date_end( $application_id )
+               {
+                       $sql = "SELECT max(to_) as date_end FROM 
eventplanner_calendar WHERE application_id = " . (int) $application_id;
+                       $this->db->query($sql,__LINE__,__FILE__);
+                       $this->db->next_record();
+                       return $this->db->f('date_end');
+               }
        }
\ No newline at end of file

Modified: trunk/eventplanner/inc/class.uievents.inc.php
===================================================================
--- trunk/eventplanner/inc/class.uievents.inc.php       2017-06-28 13:36:28 UTC 
(rev 16887)
+++ trunk/eventplanner/inc/class.uievents.inc.php       2017-06-28 13:57:36 UTC 
(rev 16888)
@@ -51,10 +51,6 @@
                        $this->bo = createObject('eventplanner.boevents');
                        $this->cats = & $this->bo->cats;
                        $this->fields = eventplanner_events::get_fields();
-                       unset($this->fields['modified']);
-                       unset($this->fields['created']);
-                       unset($this->fields['contact_email']);
-                       unset($this->fields['case_officer_name']);
                        $this->permissions = 
eventplanner_events::get_instance()->get_permission_array();
                        $this->currentapp = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
                        self::set_active_menu("{$this->currentapp}::events");

Modified: trunk/eventplanner/inc/model/class.events.inc.php
===================================================================
--- trunk/eventplanner/inc/model/class.events.inc.php   2017-06-28 13:36:28 UTC 
(rev 16887)
+++ trunk/eventplanner/inc/model/class.events.inc.php   2017-06-28 13:57:36 UTC 
(rev 16888)
@@ -51,4 +51,65 @@
                {
                        return new eventplanner_events();
                }
+               public static function get_fields($debug = true)
+               {
+                       $currentapp = 
$GLOBALS['phpgw_info']['flags']['currentapp'];
+
+                       $fields = array(
+                               'id' => array('action'=> PHPGW_ACL_READ,
+                                       'type' => 'int',
+                                       'label' => 'id',
+                                       'sortable'=> true,
+                                       'formatter' => 
'JqueryPortico.formatLink',
+                                       'public' => true,
+                                       ),
+                               'title' => array('action'=> PHPGW_ACL_READ | 
PHPGW_ACL_ADD | PHPGW_ACL_EDIT,
+                                       'type' => 'string',
+                                       'label' => 'title',
+                                       'sortable' => false,
+                                       'query' => true,
+                                       'public' => true,
+                                       ),
+                               'contact_email' => array(
+                                       'action'=> PHPGW_ACL_READ | 
PHPGW_ACL_ADD | PHPGW_ACL_EDIT,
+                                       'type' => 'string',
+                                       'required' => true,
+                                       'query' => true,
+                                       'sf_validator' => 
createObject('booking.sfValidatorEmail', array(), array('invalid' => '%field% 
is invalid')),
+                                       'label' => 'contact email',
+                                       'history' => true,
+                                       ),
+                               'vendor_name' => array('action'=>  
PHPGW_ACL_READ,
+                                       'type' => 'string',
+                                       'query' => true,
+                                       'label' => 'vendor',
+                                       'join' => array(
+                                               'table' => 
'eventplanner_vendor',
+                                               'fkey' => 'vendor_id',
+                                               'key' => 'id',
+                                               'column' => 'name'
+                                               )
+                                       ),
+                               'date_start' => array('action'=> PHPGW_ACL_READ 
| PHPGW_ACL_ADD | PHPGW_ACL_EDIT,
+                                       'type' => 'date',
+                                       'label' => 'date start',
+                                       'sortable' => true,
+                                       'history' => true
+                                       ),
+                               'date_end' => array('action'=> PHPGW_ACL_READ | 
PHPGW_ACL_ADD | PHPGW_ACL_EDIT,
+                                       'type' => 'date',
+                                       'label' => 'date end',
+                                       'history' => true
+                                       ),
+                               'number_of_units' => array('action'=> 
PHPGW_ACL_READ | PHPGW_ACL_ADD | PHPGW_ACL_EDIT,
+                                       'type' => 'int',
+                                       'label' => 'number of units',
+                                       'required' => true,
+                                       'history' => true
+                                       )
+                       );
+
+                       return $fields;
+               }
+
        }




reply via email to

[Prev in Thread] Current Thread [Next in Thread]