Marius Cramer
2013-11-14 b1a6a5a3991cec5cd08873b01376e45d0b247f18
interface/lib/classes/tform_base.inc.php
@@ -58,6 +58,7 @@
*
*/
class tform_base {
      /**
@@ -124,24 +125,24 @@
   function loadFormDef($file,$module = '') {
            global $app,$conf;
            include($file);
      include $file;
            $this->formDef = $form;
            $this->module = $module;
            $wb = array();
            include_once(ISPC_ROOT_PATH.'/lib/lang/'.$_SESSION['s']['language'].'.lng');
      include_once ISPC_ROOT_PATH.'/lib/lang/'.$_SESSION['s']['language'].'.lng';
            if(is_array($wb)) $wb_global = $wb;
            if($module == '') {
               $lng_file = "lib/lang/".$_SESSION["s"]["language"]."_".$this->formDef["name"].".lng";
               if(!file_exists($lng_file)) $lng_file = "lib/lang/en_".$this->formDef["name"].".lng";
               include($lng_file);
         include $lng_file;
            } else {
               $lng_file = "../$module/lib/lang/".$_SESSION["s"]["language"]."_".$this->formDef["name"].".lng";
               if(!file_exists($lng_file)) $lng_file = "../$module/lib/lang/en_".$this->formDef["name"].".lng";
               include($lng_file);
         include $lng_file;
            }
            if(is_array($wb_global)) {
@@ -228,6 +229,7 @@
      return $new_record;
      }
      /**
      * Converts the data in the array to human readable format
      * Datatype conversion e.g. to show the data in lists
@@ -248,7 +250,6 @@
      * @param record = Dataset as array
      * @return key => value array for the value field of a form
      */
      protected function _getDatasourceData($field, $record, $api = false) {
            global $app;
@@ -310,6 +311,7 @@
      }
      /**
        * Get the key => value array of a form filled from a datasource definitiom
        *
@@ -317,7 +319,6 @@
        * @param record = Dataset as array
        * @return key => value array for the value field of a form
        */
        function getDatasourceData($field, $record) {
         return $this->_getDatasourceData($field, $record, false);
        }
@@ -757,6 +758,7 @@
            return $new_record;
      }
      /**
      * Rewrite the record data to be stored in the database
      * and check values with regular expressions.
@@ -771,6 +773,7 @@
         return $this->_encode($record, $tab, $dbencode, false);
      }
      /**
      * process the filters for a given field.
      *
@@ -780,7 +783,6 @@
      * @param filter_event = 'SAVE'or 'SHOW'
      * @return record
      */
      function filterField($field_name, $field_value, $filters, $filter_event) {
         global $app;
@@ -811,6 +813,7 @@
         return $returnval;
      }
      /**
      * process the validators for a given field.
      *
@@ -819,7 +822,6 @@
      * @param validatoors = Array of validators
      * @return record
      */
      function validateField($field_name, $field_value, $validators) {
            global $app;
@@ -966,7 +968,7 @@
                        if(preg_match("/^[0-9]{1,3}(\.)[0-9]{1,3}(\.)[0-9]{1,3}(\.)[0-9]{1,3}$/", $field_value)){
                        $groups=explode(".",$field_value);
                        foreach($groups as $group){
                           if($group<0 OR $group>255)
                  if($group<0 or $group>255)
                           $vip=0;
                        }
                        }else{$vip=0;}
@@ -1217,6 +1219,7 @@
            return $sql;
      }
      /**
      * Create SQL statement
      *
@@ -1246,6 +1249,7 @@
            return $this->_getSQL($record, $tab, $action, $primary_id, $sql_ext_where, false);
      }
      /**
      * Debugging arrays.
@@ -1352,6 +1356,7 @@
               return $sql;
            }
      }
}
?>