fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [17077] more on eventplanner


From: sigurdne
Subject: [Fmsystem-commits] [17077] more on eventplanner
Date: Thu, 14 Sep 2017 15:11:55 -0400 (EDT)

Revision: 17077
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=17077
Author:   sigurdne
Date:     2017-09-14 15:11:55 -0400 (Thu, 14 Sep 2017)
Log Message:
-----------
more on eventplanner

Modified Paths:
--------------
    trunk/eventplanner/inc/class.uivendor.inc.php
    trunk/eventplanner/inc/hook_config.inc.php
    trunk/eventplanner/setup/phpgw_no.lang
    trunk/eventplanner/templates/base/config.tpl
    trunk/eventplannerfrontend/inc/class.hook_helper.inc.php
    trunk/eventplannerfrontend/js/portico/application.edit.js
    trunk/eventplannerfrontend/templates/base/application.xsl
    trunk/eventplannerfrontend/templates/base/css/base.css
    trunk/eventplannerfrontend/templates/base/vendor.xsl

Modified: trunk/eventplanner/inc/class.uivendor.inc.php
===================================================================
--- trunk/eventplanner/inc/class.uivendor.inc.php       2017-09-14 14:01:55 UTC 
(rev 17076)
+++ trunk/eventplanner/inc/class.uivendor.inc.php       2017-09-14 19:11:55 UTC 
(rev 17077)
@@ -176,7 +176,7 @@
                public function add()
                {
                        
self::set_active_menu("{$this->currentapp}::vendor::new_vendor");
-                       parent::add();  
+                       parent::add();
                }
 
                /*
@@ -231,7 +231,7 @@
                                array('key' => 'author', 'label' => 
lang('User'), 'sortable' => true, 'resizeable' => true),
                                array('key' => 'comment', 'label' => 
lang('Note'), 'sortable' => true, 'resizeable' => true)
                        );
- 
+
                        $datatable_def[] = array(
                                'container' => 'datatable-container_0',
                                'requestUrl' => "''",
@@ -277,12 +277,16 @@
                                )
                        );
 
+                       $config = CreateObject('phpgwapi.config', 
'eventplanner')->read();
+                       $default_category = 
!empty($config['default_vendor_category']) ? $config['default_vendor_category'] 
: null;
+
+                       $vendor->organization_number = 
$vendor->organization_number ? $vendor->organization_number :  
phpgw::get_var('org_id','int' , 'SESSION');
                        $data = array(
                                'datatable_def' => $datatable_def,
                                'form_action' => self::link(array('menuaction' 
=> "{$this->currentapp}.uivendor.save")),
                                'cancel_url' => self::link(array('menuaction' 
=> "{$this->currentapp}.uivendor.index",)),
                                'vendor' => $vendor,
-                               'category_list' => array('options' => 
$this->get_category_options( $vendor->category_id )),
+                               'category_list' => array('options' => 
$this->get_category_options( $vendor->category_id ? $vendor->category_id : 
$default_category )),
                                'mode' => $mode,
                                'tabs' => 
phpgwapi_jquery::tabview_generate($tabs, $active_tab),
                                'value_active_tab' => $active_tab
@@ -292,7 +296,7 @@
                        self::add_javascript($this->currentapp, 'portico', 
'vendor.edit.js');
                        self::render_template_xsl(array('vendor', 
'datatable_inline'), array($mode => $data));
                }
-               
+
                /*
                 * Get the vendor with the id given in the http variable 'id'
                 */

Modified: trunk/eventplanner/inc/hook_config.inc.php
===================================================================
--- trunk/eventplanner/inc/hook_config.inc.php  2017-09-14 14:01:55 UTC (rev 
17076)
+++ trunk/eventplanner/inc/hook_config.inc.php  2017-09-14 19:11:55 UTC (rev 
17077)
@@ -42,3 +42,22 @@
                return $cat_select;
        }
 
+       function default_vendor_category( $config )
+       {
+               $selected = isset($config['default_vendor_category']) ? 
$config['default_vendor_category'] : null;
+
+               $status_entries = execMethod('eventplanner.bogeneric.get_list', 
array('type' => 'vendor_category',
+                       'selected' => $selected));
+
+               $out = '<option value="">' . lang('none selected') . 
'</option>' . "\n";
+               foreach ($status_entries as $status)
+               {
+                       $selected = $status['selected'] ? ' selected = 
"selected"' : '';
+
+                       $out .= <<<HTML
+                       <option 
value='{$status['id']}'{$selected}>{$status['name']}</option>
+HTML;
+               }
+               return $out;
+       }
+

Modified: trunk/eventplanner/setup/phpgw_no.lang
===================================================================
--- trunk/eventplanner/setup/phpgw_no.lang      2017-09-14 14:01:55 UTC (rev 
17076)
+++ trunk/eventplanner/setup/phpgw_no.lang      2017-09-14 19:11:55 UTC (rev 
17077)
@@ -45,7 +45,7 @@
 rig up min before      eventplanner    no      Antatt oppriggingstid
 rig down min after     eventplanner    no      Antatt nedriggingstid
 technical support      eventplanner    no      Teknisk støtte
-charge per unit        eventplanner    no      Betaling pr 
forestilling/kurs/omvisning
+charge per unit        eventplanner    no      Betaling pr arrangement
 event timespan eventplanner    no      Programvarighet (minutter)
 number of units        eventplanner    no      Antall arrangement
 integer        eventplanner    no      Heltall
@@ -70,7 +70,7 @@
 depth  eventplanner    no      Dybde
 wardrobe       eventplanner    no      Kryss av for behov for utøvergarderobe
 audience limit eventplanner    no      Maksimum antall publikum
-raider eventplanner    no      Andre raiderønsker – (valgfri)
+raider eventplanner    no      Andre ønsker
 vendor report  eventplanner    no      Tilbakemelding fra utøver
 calendar       eventplanner    no      Kalender
 from   eventplanner    no      Fra
@@ -141,7 +141,7 @@
 completed      eventplanner    no      fullført
 custom field groups    eventplanner    no      Gruppe av tilpassede felt
 customer category      eventplanner    no      Tilpasset kategory
-minute eventplanner    no      Minutt
+minute eventplanner    no      Minutter
 select date    eventplanner    no      Velg dato
 type   eventplanner    no      Type
 vendor category        eventplanner    no      Leverandør kategori
@@ -161,4 +161,8 @@
 application public type public eventplanner    no       Breddetilbud (et 
arrangement der alle brukere/beboere på en institusjon kan delta)
 my applications        eventplanner    no      Mine søknader
 new application        eventplanner    no      Ny søknad
-new vendor     eventplanner    no      Ny utøver
\ No newline at end of file
+new vendor     eventplanner    no      Ny utøver
+default vendor category        eventplanner    no      Default utøverkategori
+default application category   eventplanner    no      Default søknadskategori
+vendor name    eventplanner    no      Artistnavn/utøver/gruppe
+sum    eventplanner    no      Sum
\ No newline at end of file

Modified: trunk/eventplanner/templates/base/config.tpl
===================================================================
--- trunk/eventplanner/templates/base/config.tpl        2017-09-14 14:01:55 UTC 
(rev 17076)
+++ trunk/eventplanner/templates/base/config.tpl        2017-09-14 19:11:55 UTC 
(rev 17077)
@@ -15,6 +15,14 @@
                        </td>
                </tr>
                <tr>
+                       <td>{lang_default_vendor_category}:</td>
+                       <td>
+                               <select 
name="newsettings[default_vendor_category]">
+                                       {hook_default_vendor_category}
+                               </select>
+                       </td>
+               </tr>
+               <tr>
                        <td>{lang_booking_interval}:</td>
                        <td>
                                <input type="number" 
name="newsettings[booking_interval]" value="{value_booking_interval}">

Modified: trunk/eventplannerfrontend/inc/class.hook_helper.inc.php
===================================================================
--- trunk/eventplannerfrontend/inc/class.hook_helper.inc.php    2017-09-14 
14:01:55 UTC (rev 17076)
+++ trunk/eventplannerfrontend/inc/class.hook_helper.inc.php    2017-09-14 
19:11:55 UTC (rev 17077)
@@ -124,9 +124,22 @@
                        {
                                return;
                        }
-                       $session_org_id = phpgw::get_var('session_org_id','int' 
, 'POST');
-                       if($session_org_id)
+
+                       $orgs = array();
+                       if(!empty($_SESSION['orgs']) && 
is_array($_SESSION['orgs']))
                        {
+                               $orgs = phpgw::get_var('orgs', 'string', 
'SESSION');
+                       }
+
+                       $session_org_id = 
phpgw::get_var('session_org_id','int', 'GET');
+
+                       function get_ids_from_array($org)
+                       {
+                               return $org['id'];
+                       }
+
+                       if($session_org_id && in_array($session_org_id, 
array_map("get_ids_from_array", $orgs)))
+                       {
                                try
                                {
                                        $_SESSION['org_id'] = 
createObject('booking.sfValidatorNorwegianOrganizationNumber')->clean($session_org_id);
@@ -133,12 +146,12 @@
                                }
                                catch (sfValidatorError $e)
                                {
-                                       $_SESSION['org_id'] = '';
+                                       $_SESSION['org_id'] = -1;
                                }
                        }
-                       else if ($_POST['session_org_id'])
+                       else if ($_GET['session_org_id'])
                        {
-                               $_SESSION['org_id'] = '';
+                               $_SESSION['org_id'] = -1;
                        }
 
                        /**
@@ -145,10 +158,8 @@
                         * $_SESSION['orgs'] is set in 
eventplannerfrontend_external_user::get_user_org_id()
                         */
 
-                       $orgs = array();
                        if(!empty($_SESSION['orgs']) && 
is_array($_SESSION['orgs']))
                        {
-                               $orgs = phpgw::get_var('orgs', 'string', 
'SESSION');
                                $org_id = phpgw::get_var('org_id','int' , 
'SESSION');
                        }
                        else
@@ -183,10 +194,14 @@
                                                        'menuaction' => 
phpgw::get_var('menuaction')
                                                )
                                        );
+                                       $base = '/eventplannerfrontend/';
+                                       $oArgs = '{menuaction:"' . 
phpgw::get_var('menuaction') .'"}';
                                }
                                else
                                {
                                        $action = 
$GLOBALS['phpgw']->link('/eventplannerfrontend/home.php');
+                                       $base = 
'/eventplannerfrontend/home.php';
+                                       $oArgs = '{}';
                                }
 
                                $message = 'Velg organisasjon';
@@ -193,8 +208,8 @@
 
                                $org_select = <<<HTML
                                
-                                       <label for="org_id">Velg 
Organisasjon:</label>
-                                       <select name="session_org_id" 
id="org_id" onChange="this.form.submit();">
+                                       <label for="session_org_id">Velg 
Organisasjon:</label>
+                                       <select name="session_org_id" 
id="session_org_id">
                                                {$org_option}
                                        </select>
                                
@@ -204,13 +219,32 @@
                        $html = <<<HTML
 
                        <div id="organsation_select">
-                               <form action="{$action}" method="POST">
-                                       $org_select
-                               </form>
+                               $org_select
                        </div>
 HTML;
 
+
                        echo $html;
+
+
+                       $js = <<<JS
+       <script type="text/javascript">
+               $(document).ready(function ()
+               {
+
+                       $("#session_org_id").change(function ()
+                       {
+                               var session_org_id = $(this).val();
+                               var oArgs = {$oArgs};
+                               oArgs.session_org_id = session_org_id;
+                               var requestUrl = phpGWLink('{$base}', oArgs);
+                               window.open(requestUrl, "_self");
+                       });
+               });
+       </script>
+JS;
+                       echo $js;
+
                }
 
                /**

Modified: trunk/eventplannerfrontend/js/portico/application.edit.js
===================================================================
--- trunk/eventplannerfrontend/js/portico/application.edit.js   2017-09-14 
14:01:55 UTC (rev 17076)
+++ trunk/eventplannerfrontend/js/portico/application.edit.js   2017-09-14 
19:11:55 UTC (rev 17077)
@@ -199,7 +199,7 @@
 
        if (tab === 'calendar')
        {
-               $("#floating-box").hide();
+//             $("#floating-box").hide();
                $("#submit_group_bottom").hide();
        }
        else if (tab === 'first_tab')
@@ -206,15 +206,15 @@
        {
                if (id > 0)
                {
-                       $("#save_button").val(lang['save']);
+       //              $("#save_button").val(lang['save']);
                        $("#save_button_bottom").val(lang['save']);
                }
                else
                {
-                       $("#save_button").val(lang['next']);
+       //              $("#save_button").val(lang['next']);
                        $("#save_button_bottom").val(lang['next']);
                }
-               $("#floating-box").show();
+//             $("#floating-box").show();
                $("#submit_group_bottom").show();
        }
        else if (tab === 'demands')
@@ -221,22 +221,22 @@
        {
                if (id > 0)
                {
-                       $("#save_button").val(lang['save']);
+//                     $("#save_button").val(lang['save']);
                        $("#save_button_bottom").val(lang['save']);
                }
                else
                {
-                       $("#save_button").val(lang['next']);
+//                     $("#save_button").val(lang['next']);
                        $("#save_button_bottom").val(lang['next']);
                }
-               $("#floating-box").show();
+//             $("#floating-box").show();
                $("#submit_group_bottom").show();
        }
        else
        {
-               $("#save_button").val(lang['save']);
+//             $("#save_button").val(lang['save']);
                $("#save_button_bottom").val(lang['save']);
-               $("#floating-box").show();
+//             $("#floating-box").show();
                $("#submit_group_bottom").show();
        }
 };

Modified: trunk/eventplannerfrontend/templates/base/application.xsl
===================================================================
--- trunk/eventplannerfrontend/templates/base/application.xsl   2017-09-14 
14:01:55 UTC (rev 17076)
+++ trunk/eventplannerfrontend/templates/base/application.xsl   2017-09-14 
19:11:55 UTC (rev 17077)
@@ -44,6 +44,7 @@
                        <form id="form" name="form" method="post" 
action="{$form_action}" class="pure-form pure-form-aligned">
                                <div id="tab-content">
                                        <xsl:value-of 
disable-output-escaping="yes" select="tabs"/>
+                                       <!--
                                        <div id="floating-box">
                                                <div id="submitbox">
                                                        <xsl:variable 
name="lang_cancel">
@@ -77,6 +78,7 @@
                                                        </table>
                                                </div>
                                        </div>
+                                       -->
                                        <input type="hidden" id="active_tab" 
name="active_tab" value="{value_active_tab}"/>
                                        <div id="first_tab">
                                        <xsl:value-of 
disable-output-escaping="yes" select="application_condition"/>
@@ -154,8 +156,8 @@
                                                                                
<xsl:text>required</xsl:text>
                                                                        
</xsl:attribute>
                                                                </input>
-                                                       
-                                                               
+
+
                                                                <xsl:text> 
</xsl:text>
                                                                <a 
href="{new_vendor_url}" target="_blank">
                                                                        
<xsl:value-of select="php:function('lang', 'new')"/>
@@ -218,6 +220,12 @@
                                                                        
<xsl:value-of select="php:function('lang', 'other participants')"/>
                                                                </label>
                                                                <textarea 
cols="47" rows="7" name="other_participants" class="pure-input-1-2" >
+                                                                       
<xsl:attribute name="data-validation">
+                                                                               
<xsl:text>required</xsl:text>
+                                                                       
</xsl:attribute>
+                                                                       
<xsl:attribute name="data-validation-error-msg">
+                                                                               
<xsl:value-of select="php:function('lang', 'other participants')"/>
+                                                                       
</xsl:attribute>
                                                                        
<xsl:value-of select="application/other_participants"/>
                                                                </textarea>
                                                        </div>
@@ -302,6 +310,12 @@
                                                                        
<xsl:value-of select="php:function('lang', 'application public type')"/>
                                                                </label>
                                                                <select 
id="non_public" name="non_public" class="pure-input-1-2" >
+                                                                       
<xsl:attribute name="data-validation">
+                                                                               
<xsl:text>required</xsl:text>
+                                                                       
</xsl:attribute>
+                                                                       
<xsl:attribute name="data-validation-error-msg">
+                                                                               
<xsl:value-of select="php:function('lang', 'application public type')"/>
+                                                                       
</xsl:attribute>
                                                                        
<xsl:apply-templates select="list_public_types/options"/>
                                                                </select>
                                                        </div>
@@ -417,7 +431,7 @@
                                                                </textarea>
                                                        </div>
                                                </fieldset>
-                                               
+
                                        </div>
                                        <div id="demands">
                                                <fieldset>
@@ -429,31 +443,56 @@
                                                                <label>
                                                                        
<xsl:value-of select="php:function('lang', 'size of stage')"/>
                                                                </label>
-                                                               <input 
type="text" id="stage_width" name="stage_width" 
value="{application/stage_width}" size="2">
-                                                                       
<xsl:attribute name="title">
-                                                                               
<xsl:value-of select="php:function('lang', 'width')"/>
-                                                                       
</xsl:attribute>
-                                                                       
<xsl:attribute name="data-validation">
-                                                                               
<xsl:text>number</xsl:text>
-                                                                       
</xsl:attribute>
-                                                                       
<xsl:attribute name="data-validation-optional">
-                                                                               
<xsl:text>true</xsl:text>
-                                                                       
</xsl:attribute>
-                                                               </input>
-                                                               <xsl:text> X 
</xsl:text>
-                                                               <input 
type="text" id="stage_depth" name="stage_depth" 
value="{application/stage_depth}" size="2">
-                                                                       
<xsl:attribute name="data-validation">
-                                                                               
<xsl:text>number</xsl:text>
-                                                                       
</xsl:attribute>
-                                                                       
<xsl:attribute name="title">
-                                                                               
<xsl:value-of select="php:function('lang', 'depth')"/>
-                                                                       
</xsl:attribute>
-                                                                       
<xsl:attribute name="data-validation-optional">
-                                                                               
<xsl:text>true</xsl:text>
-                                                                       
</xsl:attribute>
-                                                               </input>
-                                                               <xsl:text> M 
</xsl:text>
-                                                               <input 
id="stage_size" type="text" disabled="disabled" size="3"/>
+                                                               <div 
class="pure-custom">
+                                                                       <table 
class="pure-table" border="0" cellspacing="2" cellpadding="2">
+                                                                               
<thead>
+                                                                               
        <tr>
+                                                                               
                <th>
+                                                                               
                        <xsl:value-of select="php:function('lang', 'width')"/>
+                                                                               
                </th>
+                                                                               
                <th>
+                                                                               
                        <xsl:value-of select="php:function('lang', 'depth')"/>
+                                                                               
                </th>
+                                                                               
                <th>
+                                                                               
                        <xsl:value-of select="php:function('lang', 'sum')"/>
+                                                                               
                </th>
+                                                                               
        </tr>
+                                                                               
</thead>
+                                                                               
<tbody id="application_stage_size">
+                                                                               
        <tr>
+                                                                               
                <td>
+                                                                               
                        <input type="text" id="stage_width" name="stage_width" 
value="{application/stage_width}" size="2">
+                                                                               
                                <xsl:attribute name="title">
+                                                                               
                                        <xsl:value-of 
select="php:function('lang', 'width')"/>
+                                                                               
                                </xsl:attribute>
+                                                                               
                                <xsl:attribute name="data-validation">
+                                                                               
                                        <xsl:text>number</xsl:text>
+                                                                               
                                </xsl:attribute>
+                                                                               
                                <xsl:attribute name="data-validation-optional">
+                                                                               
                                        <xsl:text>true</xsl:text>
+                                                                               
                                </xsl:attribute>
+                                                                               
                        </input>
+                                                                               
                </td>
+                                                                               
                <td>
+                                                                               
                        <input type="text" id="stage_depth" name="stage_depth" 
value="{application/stage_depth}" size="2">
+                                                                               
                                <xsl:attribute name="data-validation">
+                                                                               
                                        <xsl:text>number</xsl:text>
+                                                                               
                                </xsl:attribute>
+                                                                               
                                <xsl:attribute name="title">
+                                                                               
                                        <xsl:value-of 
select="php:function('lang', 'depth')"/>
+                                                                               
                                </xsl:attribute>
+                                                                               
                                <xsl:attribute name="data-validation-optional">
+                                                                               
                                        <xsl:text>true</xsl:text>
+                                                                               
                                </xsl:attribute>
+                                                                               
                        </input>
+                                                                               
                </td>
+                                                                               
                <td>
+                                                                               
                        <input id="stage_size" type="text" disabled="disabled" 
size="3"/>
+                                                                               
                </td>
+                                                                               
        </tr>
+                                                                               
</tbody>
+                                                                       </table>
+                                                               </div>
                                                        </div>
                                                        <div 
class="pure-control-group">
                                                                <label>
@@ -617,7 +656,7 @@
 
                                                                                
        </tr>
                                                                                
        <tr>
-                                                                               
                <td>Anna utstyr (prosjektor, lerret mm)</td>
+                                                                               
                <td>Annet utstyr (prosjektor, lerret mm)</td>
                                                                                
                <td>
                                                                                
                </td>
                                                                                
                <td>
@@ -651,7 +690,7 @@
                                                <xsl:value-of 
disable-output-escaping="yes" select="application_condition"/>
                                                <fieldset>
                                                        <legend>
-                                                               
<xsl:text>Curriculum vitae</xsl:text>
+                                                               
<xsl:text>CV</xsl:text>
                                                        </legend>
                                                        <xsl:call-template 
name="file_upload">
                                                                <xsl:with-param 
name="section">cv</xsl:with-param>
@@ -678,7 +717,7 @@
                                                </fieldset>
                                                <fieldset>
                                                        <legend>
-                                                               <xsl:value-of 
select="php:function('lang', 'documents')"/>
+                                                               <xsl:value-of 
select="php:function('lang', 'program description')"/>
                                                        </legend>
                                                        <xsl:call-template 
name="file_upload">
                                                                <xsl:with-param 
name="section">documents</xsl:with-param>

Modified: trunk/eventplannerfrontend/templates/base/css/base.css
===================================================================
--- trunk/eventplannerfrontend/templates/base/css/base.css      2017-09-14 
14:01:55 UTC (rev 17076)
+++ trunk/eventplannerfrontend/templates/base/css/base.css      2017-09-14 
19:11:55 UTC (rev 17077)
@@ -7,7 +7,7 @@
     z-index:100;
  }
 
-#org_id{
+#session_org_id{
     padding-top:0.2em;
     padding-bottom:0.1em;
        padding-right: 0.6em;
@@ -22,6 +22,6 @@
 }
 
 
-#organsation_select > form > label{
+#organsation_select > label{
  color:white
 }

Modified: trunk/eventplannerfrontend/templates/base/vendor.xsl
===================================================================
--- trunk/eventplannerfrontend/templates/base/vendor.xsl        2017-09-14 
14:01:55 UTC (rev 17076)
+++ trunk/eventplannerfrontend/templates/base/vendor.xsl        2017-09-14 
19:11:55 UTC (rev 17077)
@@ -72,7 +72,7 @@
                                                                        
<xsl:text>required</xsl:text>
                                                                </xsl:attribute>
                                                                <xsl:attribute 
name="placeholder">
-                                                                       
<xsl:value-of select="php:function('lang', 'name')"/>
+                                                                       
<xsl:value-of select="php:function('lang', 'vendor name')"/>
                                                                </xsl:attribute>
                                                        </input>
                                                </div>




reply via email to

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