fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [13725] controller: alternative homescreen, and publi


From: Sigurd Nes
Subject: [Fmsystem-commits] [13725] controller: alternative homescreen, and publish to mobilefrontend
Date: Sun, 16 Aug 2015 10:59:14 +0000

Revision: 13725
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=13725
Author:   sigurdne
Date:     2015-08-16 10:59:14 +0000 (Sun, 16 Aug 2015)
Log Message:
-----------
controller: alternative homescreen, and publish to mobilefrontend

Modified Paths:
--------------
    trunk/controller/inc/class.hook_helper.inc.php
    trunk/controller/inc/class.uicomponent.inc.php
    trunk/controller/inc/class.uicontrol.inc.php
    trunk/controller/templates/base/config.tpl
    trunk/phpgwapi/templates/mobilefrontend/footer.tpl
    trunk/phpgwapi/templates/mobilefrontend/navbar.inc.php
    trunk/property/inc/class.hook_helper.inc.php

Added Paths:
-----------
    trunk/mobilefrontend/controller/class.uicomponent.inc.php

Modified: trunk/controller/inc/class.hook_helper.inc.php
===================================================================
--- trunk/controller/inc/class.hook_helper.inc.php      2015-08-15 17:21:17 UTC 
(rev 13724)
+++ trunk/controller/inc/class.hook_helper.inc.php      2015-08-16 10:59:14 UTC 
(rev 13725)
@@ -39,6 +39,17 @@
         */
        class controller_hook_helper
        {
+               private $home_alternative;
+               private $skip_portalbox_controls;
+
+
+               public function __construct()
+               {
+                       $config  = CreateObject('phpgwapi.config', 
'controller');
+                       $config->read();
+                       $this->home_alternative = 
isset($config->config_data['home_alternative']) && 
$config->config_data['home_alternative'] == 1 ? true : false;
+               }
+
                /**
                 * Show info for homepage - called from backend
                 *
@@ -46,7 +57,14 @@
                 */
                public function home_backend()
                {
-                       $this->home();
+                       if($this->home_alternative)
+                       {
+                               $this->status_componants();
+                       }
+                       else
+                       {
+                               $this->home();
+                       }
                }
                /**
                 * Show info for homepage - called from mobilefrontend
@@ -55,8 +73,82 @@
                 */
                public function home_mobilefrontend()
                {
-                       $this->home();
+                       if($this->home_alternative)
+                       {
+                               $this->skip_portalbox_controls = true;
+                               $this->status_componants();
+                       }
+                       else
+                       {
+                               $this->home();
+                       }
                }
+
+               private function status_componants()
+               {
+
+                               $portalbox = CreateObject('phpgwapi.listbox', 
array
+                               (
+                                       'title'         => lang('controller'),
+                                       'primary'       => 
$GLOBALS['phpgw_info']['theme']['navbar_bg'],
+                                       'secondary'     => 
$GLOBALS['phpgw_info']['theme']['navbar_bg'],
+                                       'tertiary'      => 
$GLOBALS['phpgw_info']['theme']['navbar_bg'],
+                                       'width' => '100%',
+                                       'outerborderwidth'      => '0',
+                                       'header_background_image'       => 
$GLOBALS['phpgw']->common->image('phpgwapi','bg_filler', '.png', False)
+                               ));
+
+                               $app_id = 
$GLOBALS['phpgw']->applications->name2id('controller');
+                               if( !isset($GLOBALS['portal_order']) 
||!in_array($app_id, $GLOBALS['portal_order']) )
+                               {
+                                       $GLOBALS['portal_order'][] = $app_id;
+                               }
+
+                               $var = $this->get_controls($app_id);
+
+                               foreach ( $var as $key => $value )
+                               {
+                                       $portalbox->set_controls($key,$value);
+                               }
+/*
+                               $url_component  = 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'controller.uicomponent.index', 'noframework' => true));
+
+                               $extra_data = <<<HTML
+                                <iframe src="{$url_component}" width="100%" 
height="400" style="border:none"></iframe>
+HTML;
+*/
+                               $lang_status_components =  
$GLOBALS['phpgw']->translation->translate('status components', array(), false, 
'controller');
+                               $url_component  = 
$GLOBALS['phpgw']->link('/index.php', array('menuaction'=> 
'controller.uicomponent.index'));
+                                
+                                $extra_data = <<<HTML
+                                <a 
href="{$url_component}">{$lang_status_components}</a>
+HTML;
+
+                                $portalbox->data = array();
+
+                               echo "\n".'<!-- BEGIN ticket info -->'."\n<div 
class='property_tickets' style='padding-left: 
10px;'>".$portalbox->draw($extra_data)."</div>\n".'<!-- END ticket info 
-->'."\n";
+
+                               unset($portalbox);
+                       
+               }
+
+               private function get_controls($app_id)
+               {
+                       if($this->skip_portalbox_controls)
+                       {
+                               return array();
+                       }
+                       $var = array
+                       (
+                               'up'    => array('url'  => '/set_box.php', 
'app'        => $app_id),
+                               'down'  => array('url'  => '/set_box.php', 
'app'        => $app_id),
+//                             'close' => array('url'  => '/set_box.php', 
'app'        => $app_id),
+//                             'question'      => array('url'  => 
'/set_box.php', 'app'        => $app_id),
+//                             'edit'  => array('url'  => '/set_box.php', 
'app'        => $app_id)
+                       );
+                       return $var;
+               }
+
                /**
                 * Show info for homepage
                 *

Modified: trunk/controller/inc/class.uicomponent.inc.php
===================================================================
--- trunk/controller/inc/class.uicomponent.inc.php      2015-08-15 17:21:17 UTC 
(rev 13724)
+++ trunk/controller/inc/class.uicomponent.inc.php      2015-08-16 10:59:14 UTC 
(rev 13725)
@@ -82,6 +82,11 @@
 
                        self::set_active_menu('controller::status_components');
                        $this->account                  = 
$GLOBALS['phpgw_info']['user']['account_id'];
+
+                       if(phpgw::get_var('noframework', 'bool'))
+                       {
+                               $GLOBALS['phpgw_info']['flags']['noframework'] 
= true;
+                       }
                }
 
                public function add_controll_from_master()

Modified: trunk/controller/inc/class.uicontrol.inc.php
===================================================================
--- trunk/controller/inc/class.uicontrol.inc.php        2015-08-15 17:21:17 UTC 
(rev 13724)
+++ trunk/controller/inc/class.uicontrol.inc.php        2015-08-16 10:59:14 UTC 
(rev 13725)
@@ -64,7 +64,9 @@
     private $add;
     private $edit;
     private $delete;
+       private $home_alternative;
 
+
     public $public_functions = array
     (
                        'index'                                                 
=>      true,
@@ -107,6 +109,7 @@
                        $config = CreateObject('phpgwapi.config','controller');
                        $config->read();
                        $this->_category_acl = 
isset($config->config_data['acl_at_control_area']) && 
$config->config_data['acl_at_control_area'] == 1 ? true : false;
+                       $this->home_alternative = 
isset($config->config_data['home_alternative']) && 
$config->config_data['home_alternative'] == 1 ? true : false;
 
                        self::set_active_menu('controller::control');
                }
@@ -260,17 +263,20 @@
                                                array(
                                                        'key' => 'link',
                                                        'hidden' => true
-                                               ),
-                                               array(
+                                               )
+                                       )
+                               )
+                       );
+
+                       if(!$this->home_alternative)
+                       {
+                               $data['datatable']['field'][] = array(
                                                        'key' => 
'show_locations',
                                                        'label' => '',
                                                        'sortable' => false,
                                                        'formatter' => 
'YAHOO.portico.formatGenericLink'
-                                               )
-                                       )
-                               ),
-                       );
-
+                                               );
+                       }
                        self::render_template_xsl(array( 'datatable_common' ), 
$data);
                }
                

Modified: trunk/controller/templates/base/config.tpl
===================================================================
--- trunk/controller/templates/base/config.tpl  2015-08-15 17:21:17 UTC (rev 
13724)
+++ trunk/controller/templates/base/config.tpl  2015-08-16 10:59:14 UTC (rev 
13725)
@@ -17,8 +17,8 @@
                        <td>{lang_Use_ACL_for_control_areas}.</td>
                        <td>
                                <select name="newsettings[acl_at_control_area]">
-                                       <option value="2" 
{selected_acl_at_control_area_2}>NO</option>
-                                       <option value="1" 
{selected_acl_at_control_area_1}>YES</option>
+                                       <option value="2" 
{selected_acl_at_control_area_2}>{lang_no}</option>
+                                       <option value="1" 
{selected_acl_at_control_area_1}>{lang_yes}</option>
                                </select>
                        </td>
                </tr>
@@ -26,8 +26,8 @@
                        <td>{lang_required_actual_hours}.</td>
                        <td>
                                <select 
name="newsettings[required_actual_hours]">
-                                       <option value="" 
{selected_required_actual_hours_}>NO</option>
-                                       <option value="1" 
{selected_required_actual_hours_1}>YES</option>
+                                       <option value="" 
{selected_required_actual_hours_}>{lang_no}</option>
+                                       <option value="1" 
{selected_required_actual_hours_1}>{lang_yes}</option>
                                </select>
                        </td>
                </tr>
@@ -44,6 +44,16 @@
                        </td>
                </tr>
                <tr class="row_on">
+                       <td>{lang_home_alternative}</td>
+                       <td>
+                               <select name="newsettings[home_alternative]">
+                                       <option value="" 
{selected_home_alternative_}>{lang_no}</option>
+                                       <option value="1" 
{selected_home_alternative_1}>{lang_yes}</option>
+                               </select>
+                       </td>
+               </tr>
+
+               <tr class="row_off">
                        <td>{lang_document_category}:</td>
                        <td>
                <!--to be able to blank the setting - need an empty value-->

Added: trunk/mobilefrontend/controller/class.uicomponent.inc.php
===================================================================
--- trunk/mobilefrontend/controller/class.uicomponent.inc.php                   
        (rev 0)
+++ trunk/mobilefrontend/controller/class.uicomponent.inc.php   2015-08-16 
10:59:14 UTC (rev 13725)
@@ -0,0 +1,41 @@
+<?php
+
+       /**
+        * phpGroupWare - controller: a part of a Facilities Management System.
+        *
+        * @author Erik Holm-Larsen <address@hidden>
+        * @author Torstein Vadla <address@hidden>
+        * @copyright Copyright (C) 2011,2012 Free Software Foundation, Inc. 
http://www.fsf.org/
+        * This file is part of phpGroupWare.
+        *
+        * phpGroupWare is free software; you can redistribute it and/or modify
+        * it under the terms of the GNU General Public License as published by
+        * the Free Software Foundation; either version 2 of the License, or
+        * (at your option) any later version.
+        *
+        * phpGroupWare is distributed in the hope that it will be useful,
+        * but WITHOUT ANY WARRANTY; without even the implied warranty of
+        * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+        * GNU General Public License for more details.
+        *
+        * You should have received a copy of the GNU General Public License
+        * along with phpGroupWare; if not, write to the Free Software
+        * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  
02110-1301  USA
+        *
+        * @license http://www.gnu.org/licenses/gpl.html GNU General Public 
License
+        * @internal Development of this application was funded by 
http://www.bergen.kommune.no/
+        * @package property
+        * @subpackage controller
+        * @version $Id: class.uicalendar.inc.php 11511 2013-12-08 20:57:07Z 
sigurdne $
+        */
+
+       phpgw::import_class('controller.uicomponent');
+
+       class mobilefrontend_uicomponent extends controller_uicomponent
+       {
+               public function __construct()
+               {
+                       parent::__construct();
+                       $GLOBALS['phpgw_info']['flags']['nonavbar'] = true;
+               }
+       }

Modified: trunk/phpgwapi/templates/mobilefrontend/footer.tpl
===================================================================
--- trunk/phpgwapi/templates/mobilefrontend/footer.tpl  2015-08-15 17:21:17 UTC 
(rev 13724)
+++ trunk/phpgwapi/templates/mobilefrontend/footer.tpl  2015-08-16 10:59:14 UTC 
(rev 13725)
@@ -3,7 +3,7 @@
 
 </div>
 <div id="footer_address">
-Bergen kommune | R&aring;dhusgt 10 | Postboks 7700 | 5020 Bergen
+{site_title}
 </div>
 
        </body>

Modified: trunk/phpgwapi/templates/mobilefrontend/navbar.inc.php
===================================================================
--- trunk/phpgwapi/templates/mobilefrontend/navbar.inc.php      2015-08-15 
17:21:17 UTC (rev 13724)
+++ trunk/phpgwapi/templates/mobilefrontend/navbar.inc.php      2015-08-16 
10:59:14 UTC (rev 13725)
@@ -194,6 +194,7 @@
                $var = array
                (
                        'powered_by'    => lang('Powered by phpGroupWare 
version %1', $GLOBALS['phpgw_info']['server']['versions']['phpgwapi']),
+                       'site_title'    => 
"{$GLOBALS['phpgw_info']['server']['site_title']}",
                );
 
                $GLOBALS['phpgw']->template->set_var($var);

Modified: trunk/property/inc/class.hook_helper.inc.php
===================================================================
--- trunk/property/inc/class.hook_helper.inc.php        2015-08-15 17:21:17 UTC 
(rev 13724)
+++ trunk/property/inc/class.hook_helper.inc.php        2015-08-16 10:59:14 UTC 
(rev 13725)
@@ -34,6 +34,7 @@
         */
        class property_hook_helper
        {
+               private $skip_portalbox_controls;
                /**
                 * Clear ACL-based userlists
                 *
@@ -104,11 +105,16 @@
                 */
                public function home_mobilefrontend()
                {
+                       $this->skip_portalbox_controls = true;
                        $this->home_ticket();
                }
 
                private function get_controls($app_id)
                {
+                       if($this->skip_portalbox_controls)
+                       {
+                               return array();
+                       }
                        $var = array
                        (
                                'up'    => array('url'  => '/set_box.php', 
'app'        => $app_id),




reply via email to

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