fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [17293] Added erorr messages on add check list


From: erikhl
Subject: [Fmsystem-commits] [17293] Added erorr messages on add check list
Date: Fri, 10 Nov 2017 06:52:31 -0500 (EST)

Revision: 17293
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=17293
Author:   erikhl
Date:     2017-11-10 06:52:31 -0500 (Fri, 10 Nov 2017)
Log Message:
-----------
Added erorr messages on add check list
Added constraint on checklist due date. If due date is passed by 14 days 
checklist cannot be saved.

Modified Paths:
--------------
    trunk/controller/inc/class.uicheck_list.inc.php
    trunk/controller/setup/phpgw_no.lang
    trunk/controller/templates/base/check_list/edit_check_list.xsl

Modified: trunk/controller/inc/class.uicheck_list.inc.php
===================================================================
--- trunk/controller/inc/class.uicheck_list.inc.php     2017-11-10 10:40:18 UTC 
(rev 17292)
+++ trunk/controller/inc/class.uicheck_list.inc.php     2017-11-10 11:52:31 UTC 
(rev 17293)
@@ -222,6 +222,7 @@
                                $original_deadline_date_ts = 
phpgw::get_var('deadline_ts');
                                $deadline_current = 
phpgw::get_var('deadline_current', 'bool');
                                $serie_id = phpgw::get_var('serie_id', 'int');
+                               $check_list_error_array = 
phpgw::get_var('check_list_errors');
 
                                if ($deadline_current)
                                {
@@ -247,6 +248,7 @@
                                $check_list->set_control_id($control_id);
                                $check_list->set_deadline($deadline_ts);
                                
$check_list->set_original_deadline($original_deadline_date_ts);
+                               
$check_list->set_error_msg_array($check_list_error_array);
                        }
                        else
                        {
@@ -433,7 +435,17 @@
                                $check_list_id = 
phpgw::get_var('check_list_id');
                                $check_list = 
$this->so->get_single($check_list_id);
                        }
-
+                       
+                       $current_time = time();
+                       $absolute_deadline = time() + (14 * 24 * 60 * 60);
+                       $check_list_locked = false;
+                       if($check_list->get_deadline() < $absolute_deadline)
+                       {
+                               //check list was due two weeks ago, and is 
locked
+                               $check_list_locked = true;
+                       }
+//                     echo 'tid: '.$current_time.'abs: '.$absolute_deadline;
+                       
                        $repeat_descr = '';
                        if ($serie = 
$this->so_control->get_serie($check_list->get_serie_id()))
                        {
@@ -550,6 +562,7 @@
                                'current_year' => $year,
                                'current_month_nr' => $month,
                                'current_month_name' => lang("month {$month} 
capitalized"),
+                               'check_list_locked' => $check_list_locked,
                                'building_location_code' => 
$building_location_code,
                                'location_level' => $level,
                                'required_actual_hours' => 
$required_actual_hours,
@@ -956,6 +969,7 @@
                                                'type' => $type,
                                                'assigned_to' => $assigned_to,
                                                'status' => $status,
+                                               'check_list_errors' => 
$check_list->get_error_msg_array(),
                                                //      'billable_hours' => 
$billable_hours
                                        ));
                                }

Modified: trunk/controller/setup/phpgw_no.lang
===================================================================
--- trunk/controller/setup/phpgw_no.lang        2017-11-10 10:40:18 UTC (rev 
17292)
+++ trunk/controller/setup/phpgw_no.lang        2017-11-10 11:52:31 UTC (rev 
17293)
@@ -378,6 +378,7 @@
 error_msg_9    controller      no      Utførtdato kan ikke være etter fristdato
 error_msg_no_controls_in_period        controller      no      Ingen 
kontroller for bygg i denne perioden
 error_msg_no_controls_for_component    controller      no      Ingen 
kontroller for komponent i denne perioden
+error_msg_control_passed_due_date      controller      no      Sjekkliste kan 
ikke lagres da frist er overskredet
 role at location       controller      no      Tildeling av rolle
 Register new message   controller      no      Registrer ny melding
 Show message   controller      no      Vis melding

Modified: trunk/controller/templates/base/check_list/edit_check_list.xsl
===================================================================
--- trunk/controller/templates/base/check_list/edit_check_list.xsl      
2017-11-10 10:40:18 UTC (rev 17292)
+++ trunk/controller/templates/base/check_list/edit_check_list.xsl      
2017-11-10 11:52:31 UTC (rev 17293)
@@ -17,7 +17,11 @@
                        <form id="frm_update_check_list" action="{$action_url}" 
method="post">  
                        <xsl:variable name="check_list_id"><xsl:value-of 
select="check_list/id"/></xsl:variable>
                        <input id="check_list_id" type="hidden" 
name="check_list_id" value="{$check_list_id}" />
-                       
+                       <xsl:if test="check_list_locked">
+                               <div class='input_error_msg'>
+                                       <xsl:value-of 
select="php:function('lang', 'error_msg_control_passed_due_date')" />
+                               </div>
+                       </xsl:if>
                        <fieldset class="col_1">
                        <div class="row">
                                <label>Status</label>
@@ -144,10 +148,12 @@
                                </textarea>
                        </div>
                        
-                       <div class="form-buttons">
-                               <xsl:variable name="lang_save"><xsl:value-of 
select="php:function('lang', 'save_check_list')" /></xsl:variable>
-                               <input class="btn" type="submit" 
name="save_control" value="Lagre detaljer" />
-                       </div>
+                       <xsl:if test="check_list_locked = 'true'">
+                               <div class="form-buttons">
+                                       <xsl:variable 
name="lang_save"><xsl:value-of select="php:function('lang', 'save_check_list')" 
/></xsl:variable>
+                                       <input class="btn" type="submit" 
name="save_control" value="Lagre detaljer" />
+                               </div>
+                       </xsl:if>
                        </form>
                </div>
                <xsl:for-each select="integration">




reply via email to

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