fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [7355]


From: Erik Holm-Larsen
Subject: [Fmsystem-commits] [7355]
Date: Tue, 07 Jun 2011 09:22:53 +0000

Revision: 7355
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=7355
Author:   erikhl
Date:     2011-06-07 09:22:53 +0000 (Tue, 07 Jun 2011)
Log Message:
-----------


Modified Paths:
--------------
    trunk/activitycalendarfrontend/inc/class.uiactivity.inc.php
    trunk/activitycalendarfrontend/setup/phpgw_no.lang

Added Paths:
-----------
    trunk/activitycalendarfrontend/templates/base/base.css

Modified: trunk/activitycalendarfrontend/inc/class.uiactivity.inc.php
===================================================================
--- trunk/activitycalendarfrontend/inc/class.uiactivity.inc.php 2011-06-07 
06:06:54 UTC (rev 7354)
+++ trunk/activitycalendarfrontend/inc/class.uiactivity.inc.php 2011-06-07 
09:22:53 UTC (rev 7355)
@@ -14,6 +14,14 @@
                        'index'                 =>      true
                );
                
+               /**
+                * Public method. Forwards the user to edit mode.
+                */
+               public function add()
+               {
+                       $GLOBALS['phpgw']->redirect_link('/index.php', 
array('menuaction' => 'activitycalendarfrontend.uiactivity.edit', 'action' => 
'new_activity'));
+               }
+               
                function view()
                {
                        $errorMsgs = array();
@@ -31,24 +39,24 @@
                                'errorMsgs' => $errorMsgs,
                                'infoMsgs' => $infoMsgs
                        );
+                       
+                       $GLOBALS['phpgw_info']['flags']['noframework'] = true;
                        $this->render('activity.php', $data);
                }
 
                function edit()
                {
                        $id = intval(phpgw::get_var('id', 'GET'));
+                       $action = phpgw::get_var('action', 'GET');
                        //var_dump($id);
-                       $so = activitycalendar_soactivity::get_instance();
-                       $activity = $so->get_single($id);
+                       $so_activity = 
activitycalendar_soactivity::get_instance();
+                       //$activity = $so->get_single($id);
                        
                        //var_dump(phpgw::get_var('secret', 'GET'));
                        //var_dump($activity->get_secret());
 
-                       if($activity->get_secret() != phpgw::get_var('secret', 
'GET'))
-                       {
-                               $this->redirect(array('menuaction' => 
'bookingfrontend.uisearch.index'));
-                       }
                        
+                       
                        //var_dump($activity->get_title());
                        //$this->redirect(array('menuaction' => 
'activitycalendar.uiactivities.edit', 'id' => $id, 'frontend' => 'true'));
                                                
@@ -59,13 +67,97 @@
                        $audience = $audience['results'];
                        self::render_template('application', 
array('application' => $application, 'audience' => $audience, 'agegroups' => 
$agegroups, 'frontend'=>'true'));
 */
-                       $categories = $so->get_categories();
-                       $targets = $so->get_targets();
-                       $offices = $so->select_district_list();
-                       $districts = $so->get_districts();
+                       $categories = $so_activity->get_categories();
+                       $targets = $so_activity->get_targets();
+                       $offices = $so_activity->select_district_list();
+                       $districts = $so_activity->get_districts();
                        $arenas = 
activitycalendar_soarena::get_instance()->get(null, null, null, null, null, 
null, null);
                        $organizations = 
activitycalendar_soorganization::get_instance()->get(null, null, null, null, 
null, null, null);
                        $groups = 
activitycalendar_sogroup::get_instance()->get(null, null, null, null, null, 
null, null);
+                       
+                       // Retrieve the activity object or create a new one
+                       if(isset($id) && $id > 0)
+                       {       
+                               $activity = $so_activity->get_single($id); 
+                       }
+                       else
+                       {
+                               $activity = new activitycalendar_activity();
+                       }
+                       
+                       if($activity->get_secret() != phpgw::get_var('secret', 
'GET'))
+                       {
+                               if($action != 'new_activity')
+                               {
+                                       $this->redirect(array('menuaction' => 
'bookingfrontend.uisearch.index'));
+                               }
+                       }
+                       
+                       $g_id = phpgw::get_var('group_id');
+                       $o_id = phpgw::get_var('organization_id');
+                       if(isset($g_id) && $g_id > 0)
+                       {
+                               $persons = 
activitycalendar_sogroup::get_instance()->get_contacts($g_id);
+                               $desc = 
activitycalendar_sogroup::get_instance()->get_description($g_id);
+                       }
+                       else if(isset($o_id) && $o_id > 0)
+                       {
+                               $persons = 
activitycalendar_soorganization::get_instance()->get_contacts($o_id);
+                               $desc = 
activitycalendar_soorganization::get_instance()->get_description($o_id);
+                       }
+                       
+                       if(isset($_POST['save_activity'])) // The user has 
pressed the save button
+                       {
+                               if(isset($activity)) // If an activity object 
is created
+                               {
+                                       $old_state = $activity->get_state();
+                                       $new_state = phpgw::get_var('state');
+       
+                                       // ... 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'));
+                                       $district_array = 
phpgw::get_var('district');
+                                       $activity->set_district(implode(",", 
$district_array));
+                                       
$activity->set_office(phpgw::get_var('office'));
+                                       $activity->set_state($new_state);
+                                       
$activity->set_category(phpgw::get_var('category'));
+                                       $target_array = 
phpgw::get_var('target');
+                                       $activity->set_target(implode(",", 
$target_array));
+                                       $activity->set_description($desc);
+                                       
$activity->set_time(phpgw::get_var('time'));
+                                       
$activity->set_contact_persons($persons);
+                                       
$activity->set_special_adaptation(phpgw::get_var('special_adaptation'));
+                                       
+                                       if($so_activity->store($activity)) // 
... and then try to store the object
+                                       {
+                                               $message = 
lang('messages_saved_form'); 
+                                       }
+                                       else
+                                       {
+                                               $error = 
lang('messages_form_error');
+                                       }
+       
+                                       if($new_state == 3 || $new_state == 4 
|| $new_state == 5 )
+                                       {
+                                               $kontor = 
$so_activity->get_office_name($activity->get_office());
+                                               $subject = "Melding fra 
AktivBy";
+                                               $body = lang('mail_body_state_' 
. $new_state, $kontor);
+                                               
+                                               if(isset($g_id) && $g_id > 0)
+                                               {
+                                                       
activitycalendar_uiactivities::send_mailnotification_to_group($activity->get_contact_person_2(),$subject,$body);
+                                               }
+                                               else if (isset($o_id) && $o_id 
> 0)
+                                               {
+                                                       
activitycalendar_uiactivities::send_mailnotification_to_organization($activity->get_contact_person_2(),$subject,$body);
+                                               }
+                                       }
+                               }
+                       }
+                       
+                       $GLOBALS['phpgw_info']['flags']['noframework'] = true;
 
                        $this->render('activity.php', array
                                                (

Modified: trunk/activitycalendarfrontend/setup/phpgw_no.lang
===================================================================
--- trunk/activitycalendarfrontend/setup/phpgw_no.lang  2011-06-07 06:06:54 UTC 
(rev 7354)
+++ trunk/activitycalendarfrontend/setup/phpgw_no.lang  2011-06-07 09:22:53 UTC 
(rev 7355)
@@ -45,4 +45,5 @@
 state_4        activitycalendarfrontend        no      Behandlet
 state_5        activitycalendarfrontend        no      Avvist
 district       activitycalendarfrontend        no      Bydel
-title  activitycalendarfrontend        no      Tittel
\ No newline at end of file
+title  activitycalendarfrontend        no      Tittel
+activity_helptext      activitycalendarfrontend        no      Før ny 
aktivitet kan registreres må du sjekke at organisasjon/gruppe finnes og er 
oppdatert, og at arena finnes og er oppdatert.
\ No newline at end of file

Added: trunk/activitycalendarfrontend/templates/base/base.css
===================================================================
--- trunk/activitycalendarfrontend/templates/base/base.css                      
        (rev 0)
+++ trunk/activitycalendarfrontend/templates/base/base.css      2011-06-07 
09:22:53 UTC (rev 7355)
@@ -0,0 +1,243 @@
address@hidden "UTF-8";
+
+dl.proplist,
+dl.proplist-col {
+    margin: 1em 0;
+    padding-left: 2em;
+}
+dl.proplist dt,
+dl.proplist-col dt { 
+    font-style: italic; 
+    font-weight: bolder; 
+    font-size: 90%; 
+    margin: .8em 0 .1em 0;
+}
+
+dl.proplist-col,
+dl.form-col {
+    width: 18em;
+    float: left;
+}
+
+
+table#header {
+       margin: 2em;
+       
+       }
+
+div#unit_selector {
+       
+}
+
+div#all_units_key_data {
+       padding-left: 2em;
+       }
+
+div#unit_image {
+       margin-left: 2em;
+       }
+
+div#unit_image img {
+       height:170px;
+}
+
+div.yui-navset {
+       padding-left: 2em;
+       padding-right: 2em;
+       }
+       
+div#contract_selector {
+       padding-left: 1em;
+       padding-top: 1em;
+       }
+       
+img.list_image {
+       margin-right: 5px;
+       float:left;
+       }
+
+a.list_image {
+       float:left;
+       display:inline;
+       }
+
+ol.list_image {
+       float: left;
+       }
+       
+ol.list_image li {
+       padding: 1px;
+}
+       
+dl#key_data  {
+       padding: 2px;
+       }
+       
+       
+dl#key_data dd {
+       padding-bottom: 1em;
+}
+
+table#key_data td {
+       padding-right: 1em;
+       padding: 5px;
+       }
+
+
+.user_menu {
+       list-style:none;
+       height: 100%;
+       padding: 2px;
+       border-style: none none none solid;
+       border-width: 1px;
+       border-color: grey;
+       padding-left: 5px;
+}
+
+.user_menu li {
+       margin: 13px;
+       }
+       
+#area_and_price {
+       list-style:none;
+       height: 100%;
+       padding: 2px;
+       padding-left: 5px;
+       float:right;
+       padding:0.5em 1em 0 0;
+}
+
+#area_and_price li {
+       margin: 13px;
+       }
+       
+#org_units {
+       list-style: none;
+       height: 100%;
+       padding: 2px;
+       padding-left: 5px;
+       float:right;
+       padding:0.5em 1em 0 0;
+}
+
+#org_units li {
+       margin: 13px;
+       }
+       
+#information {
+       list-style:none;
+       height: 100%;
+       padding: 2px;
+       padding-left: 5px;
+       float:right;
+       padding:0.5em 1em 0 0;
+}
+
+#information li {
+       margin: 13px;
+       }
+
+a.header_link {
+       text-decoration: none;
+       float: none;
+       }
+       
+#logo_holder {
+       border: 0 none;
+       font-family:Arial,sans-serif;
+font-size:65%;
+line-height:1.166;
+position: absolute;
+padding:2em;
+}
+
+em#bold {
+       font-weight: bold;
+       }
+
+div#header a {
+       float: none;
+}
+
+.yui-skin-sam .yui-navset .yui-nav, .yui-skin-sam .yui-navset .yui-navset-top 
.yui-nav {
+       border-color: #BF0005;
+       border-width:0 0 2px;
+       }
+       
+.yui-skin-sam .yui-navset .yui-content {
+       background: none repeat scroll 0 0 #F4F2ED;
+}
+
+.yui-skin-sam .yui-navset .yui-nav .selected a, .yui-skin-sam .yui-navset 
.yui-nav .selected a:focus, .yui-skin-sam .yui-navset .yui-nav .selected 
a:hover {
+       background:url("../../../../assets/skins/sam/sprite.png") repeat-x 
scroll left -1400px #2647A0;
+       }
+       
+div.tickets {
+       margin-top: 1em;
+       }
+
+em.select_header {
+       font-size: larger;
+       padding-top: 10px;
+       }
+
+#contract_price_and_area {
+       float: left;
+       margin: 1em 2em 0 0;
+}
+
+#contract_price_and_area li {
+               margin-bottom: 1em;
+       }
+
+#contract_essentials {
+       float: left;
+       margin: 1em 2em 0 2em;
+       }
+       
+#composites {
+       float: left;
+       margin: 1em 2em 0 2em;
+       }
+       
+       
+#comment {
+       float: left;
+       margin: 1em 2em 0 2em;
+       }
+       
+       #contract_essentials li {
+               margin-bottom: 1em;
+       }
+       
+#contract_parts {
+       float: left;
+       margin: 1em 2em 0 2em;
+       }
+       
+div.toolbar {
+background-color:#EEEEEE;
+border:1px solid #BBBBBB;
+float:left;
+width:100%;
+}
+
+div.toolbar_manual {
+background-color:#EEEEEE;
+border:1px solid #BBBBBB;
+float:left;
+width:100%;
+}
+
+.yui-pg-container {
+       white-space: normal;
+       }
+       
+li.ticket_detail {
+       padding: 5px;
+       margin-left: 5px;
+       }
+
+
+
+


Property changes on: trunk/activitycalendarfrontend/templates/base/base.css
___________________________________________________________________
Added: svn:mime-type
   + text/plain




reply via email to

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