fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [8098]


From: Erik Holm-Larsen
Subject: [Fmsystem-commits] [8098]
Date: Mon, 14 Nov 2011 08:04:28 +0000

Revision: 8098
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=8098
Author:   erikhl
Date:     2011-11-14 08:04:28 +0000 (Mon, 14 Nov 2011)
Log Message:
-----------


Modified Paths:
--------------
    trunk/activitycalendar/templates/base/activity.php

Modified: trunk/activitycalendar/templates/base/activity.php
===================================================================
--- trunk/activitycalendar/templates/base/activity.php  2011-11-14 07:11:42 UTC 
(rev 8097)
+++ trunk/activitycalendar/templates/base/activity.php  2011-11-14 08:04:28 UTC 
(rev 8098)
@@ -37,6 +37,45 @@
 {
        get_available_groups();
 });
+
+function allOK()
+{
+       if(document.getElementById('title').value == null || 
document.getElementById('title').value == '')
+       {
+               alert("Tittel må fylles ut!");
+               return false;
+       } 
+       if(document.getElementById('organization_id').value == null || 
document.getElementById('organization_id').value == '')
+       {
+               alert("Organisasjon må fylles ut!");
+               return false;
+       }
+       if(document.getElementById('internal_arena_id').value == null || 
document.getElementById('internal_arena_id').value == 0)
+       {
+               if(document.getElementById('arena_id').value == null || 
document.getElementById('arena_id').value == 0)
+               {
+                       alert("Arena må fylles ut!");
+                       return false;
+               }
+       }
+       if(document.getElementById('time').value == null || 
document.getElementById('time').value == '')
+       {
+               alert("Tid må fylles ut!");
+               return false;
+       }
+       if(document.getElementById('category').value == null || 
document.getElementById('category').value == 0)
+       {
+               alert("Kategori må fylles ut!");
+               return false;
+       }
+       if(document.getElementById('office').value == null || 
document.getElementById('office').value == 0)
+       {
+               alert("Hocedansvarlig kulturkontor må fylles ut!");
+               return false;
+       }
+       else
+               return true;
+}
 </script>
 <?php echo activitycalendar_uicommon::get_page_message($message) ?>
 <div class="yui-content">
@@ -212,7 +251,7 @@
                                        if ($editable)
                                        {
                                                ?>
-                                               <select 
name="internal_arena_id">
+                                               <select 
name="internal_arena_id" id="internal_arena_id">
                                                        <option value="0">Ingen 
kommunale bygg valgt</option>
                                                        <?php
                                                        foreach($buildings as 
$building_id => $building_name)
@@ -242,7 +281,7 @@
                                        if ($editable)
                                        {
                                                ?>
-                                               <select name="arena_id">
+                                               <select name="arena_id" 
id="arena_id">
                                                        <option value="0">Ingen 
arena valgt</option>
                                                        <?php
                                                        foreach($arenas as 
$arena)
@@ -291,7 +330,7 @@
                                        if ($editable)
                                        {
                                                ?>
-                                               <select name="category">
+                                               <select name="category" 
id="category">
                                                        <option value="0">Ingen 
kategori valgt</option>
                                                        <?php
                                                        foreach($categories as 
$category)
@@ -325,7 +364,7 @@
                                                foreach($targets as $t)
                                                {
                                                ?>
-                                                       <input name="target[]" 
type="checkbox" value="<?php echo $t->get_id()?>" <?php echo 
(in_array($t->get_id(), $current_target_id_array) ? 'checked' : "")?>/><?php 
echo $t->get_name()?><br/>
+                                                       <input name="target[]" 
id="target[]" type="checkbox" value="<?php echo $t->get_id()?>" <?php echo 
(in_array($t->get_id(), $current_target_id_array) ? 'checked' : "")?>/><?php 
echo $t->get_name()?><br/>
                                                <?php
                                                }
                                        }
@@ -386,7 +425,7 @@
                                        {
                                                $selected_office = 
$activity->get_office();
                                        ?>
-                                               <select name="office">
+                                               <select name="office" 
id="office">
                                                        <option value="0">Ingen 
kontor valgt</option>
                                                        <?php
                                                        foreach($offices as 
$office)
@@ -480,7 +519,7 @@
                        <div class="form-buttons">
                                <?php
                                        if ($editable) {
-                                               echo '<input type="submit" 
name="save_activity" value="' . lang('save') . '"/>';
+                                               echo '<input type="submit" 
name="save_activity" value="' . lang('save') . '" onclick="return allOK();"/>';
                                                echo '<a href="' . $cancel_link 
. '">' . lang('back_to_list') . '</a>';
                                        }
                                        else




reply via email to

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