Example #1
0
 function delete($df)
 {
     parent::delete($df);
     //currency id
     $parent_type = new TemplateText();
     $parent_type->name = 'parent_type';
     $parent_type->delete($df);
     $parent_id = new TemplateId();
     $parent_id->name = 'parent_id';
     $parent_id->delete($df);
 }
Example #2
0
 function get_field_def()
 {
     $def = parent::get_field_def();
     $def['dbType'] = 'text';
     $def['massupdate'] = 0;
     $def['importable'] = 0;
     $def['duplicate_merge'] = 0;
     $def['reportable'] = 0;
     //$def['len'] = 1000;
     $def['studio'] = 'visible';
     if (isset($this->ext2) && isset($this->ext3)) {
         $def['width'] = $this->ext2;
         $def['height'] = $this->ext3;
     }
     if (isset($this->ext4)) {
         $def['turn_on'] = $this->ext4;
     }
     if (isset($this->width) && isset($this->height)) {
         $def['width'] = $this->width;
         $def['height'] = $this->height;
     }
     if (isset($this->turn_on)) {
         $def['turn_on'] = $this->turn_on;
     }
     return $def;
 }
 function get_field_def()
 {
     $def = parent::get_field_def();
     $def['dbType'] = 'varchar';
     $def['studio'] = 'hidden';
     return $def;
 }
 function set($values)
 {
     parent::set($values);
     if (!empty($this->ext4)) {
         $this->default_value = $this->ext4;
     }
 }
 function get_xtpl_detail()
 {
     $value = parent::get_xtpl_detail();
     if (!empty($value) && substr_count($value, '://') == 0 && substr($value, 0, 8) != 'index.php') {
         $value = 'http://' . $value;
     }
     return $value;
 }
Example #6
0
 function get_field_def()
 {
     $def = parent::get_field_def();
     if (!empty($def['default'])) {
         $def['display_default'] = $def['default'];
         $def['default'] = '';
     }
     return $def;
 }
 function get_field_def()
 {
     $def = parent::get_field_def();
     $def['dbType'] = 'varchar';
     $def['studio'] = 'hidden';
     // FIXME this is to match default flex relates vardefs. We need to document the rules.
     $def['group'] = 'parent_name';
     return $def;
 }
Example #8
0
 function get_field_def()
 {
     $def = parent::get_field_def();
     //$def['options'] = !empty($this->options) ? $this->options : $this->ext1;
     $def['default'] = !empty($this->default) ? $this->default : $this->default_value;
     $def['len'] = $this->len;
     $def['dbType'] = 'varchar';
     $def['gen'] = !empty($this->gen) ? $this->gen : $this->ext3;
     return $def;
 }
Example #9
0
 function get_field_def()
 {
     $vardef = parent::get_field_def();
     $vardef['disable_num_format'] = $this->ext3;
     if (!empty($this->ext2)) {
         $min = !empty($this->ext1) ? $this->ext1 : 0;
         $max = $this->ext2;
         $vardef['validation'] = array('type' => 'range', 'min' => $min, 'max' => $max);
     }
     return $vardef;
 }
Example #10
0
 function set($values)
 {
     parent::set($values);
     if (!empty($this->ext1)) {
         $this->border = $this->ext1;
     }
     if (!empty($this->ext2)) {
         $this->width = $this->ext2;
     }
     if (!empty($this->ext3)) {
         $this->height = $this->ext3;
     }
 }
Example #11
0
 function get_field_def()
 {
     $def = parent::get_field_def();
     $def['studio'] = 'visible';
     if (isset($this->ext2) && isset($this->ext3)) {
         $def['rows'] = $this->ext2;
         $def['cols'] = $this->ext3;
     }
     if (isset($this->rows) && isset($this->cols)) {
         $def['rows'] = $this->rows;
         $def['cols'] = $this->cols;
     }
     return $def;
 }
Example #12
0
 function save($df)
 {
     //the currency field
     $this->default = unformat_number($this->default);
     $this->default_value = $this->default;
     parent::save($df);
     //currency id
     $currency_id = new TemplateCurrencyId();
     $currency_id->name = 'currency_id';
     $currency_id->vname = 'LBL_CURRENCY';
     $currency_id->label = $currency_id->vname;
     $currency_id->save($df);
     //$df->addLabel($currency_id->vname);
 }
Example #13
0
 function get_field_def()
 {
     $def = parent::get_field_def();
     $def['dbType'] = 'varchar';
     $def['massupdate'] = 0;
     $def['importable'] = 0;
     $def['duplicate_merge'] = 0;
     $def['reportable'] = 0;
     $def['len'] = 255;
     $def['studio'] = 'visible';
     //Max Width
     $def['max_width'] = !empty($this->max_width) ? $this->max_width : $this->ext2;
     //Max Height
     $def['max_height'] = !empty($this->max_height) ? $this->max_height : $this->ext3;
     //Style CSS
     $def['style'] = !empty($this->style) ? $this->style : $this->ext4;
     return $def;
 }
 function get_field_def()
 {
     $def = parent::get_field_def();
     $def['studio'] = 'visible';
     if (isset($this->ext2) && isset($this->ext3)) {
         $def['rows'] = $this->ext2;
         $def['cols'] = $this->ext3;
     }
     if (isset($this->rows) && isset($this->cols)) {
         $def['rows'] = $this->rows;
         $def['cols'] = $this->cols;
     }
     //handle db type
     $def['dbType'] = 'text';
     //handle fts search
     $def['full_text_search']['type'] = 'text';
     return $def;
 }
Example #15
0
 /**
  * @param DynamicField $df
  */
 function delete($df)
 {
     //If a dropdown uses the field that is being delted as a parent dropdown, we need to remove that dependency
     $seed = BeanFactory::getBean($df->getModuleName());
     if ($seed) {
         $fields = $seed->field_defs;
         foreach ($fields as $field => $def) {
             if (!empty($def['visibility_grid']['trigger']) && $def['visibility_grid']['trigger'] == $this->name) {
                 $field = get_widget($def['type']);
                 unset($def['visibility_grid']);
                 $field->populateFromRow($def);
                 if (isset($def['source']) && $def['source'] == "custom_fields") {
                     $field->save($df);
                 } else {
                     //Out of the box field that we need to use a StandardField rather than DynamicFIeld object to save
                     require_once 'modules/ModuleBuilder/parsers/StandardField.php';
                     $sf = new StandardField($df->getModuleName());
                     $sf->setup($seed);
                     $field->module = $seed;
                     $field->save($sf);
                 }
             }
         }
     }
     parent::delete($df);
 }
Example #16
0
 function get_field_def()
 {
     $def = parent::get_field_def();
     $def['studio'] = 'visible';
     return $def;
 }
Example #17
0
 function populateFromRow($row = array())
 {
     parent::populateFromRow($row);
 }
 function save($df)
 {
     parent::save($df);
 }
 /**
  * {@inheritDoc}
  */
 protected function applyVardefRules()
 {
     parent::applyVardefRules();
     if (!empty($this->ext2) && !empty($this->module) && $this->ext2 !== $this->module) {
         $this->module = $this->ext2;
     }
 }
Example #20
0
 function save($df)
 {
     if (!empty($this->default_value) && is_array($this->default_value)) {
         $this->default_value = $this->default_value[0];
     }
     if (!empty($this->default) && is_array($this->default)) {
         $this->default = $this->default[0];
     }
     if (get_class($this) == 'TemplateEnum' && isset($this->dependency)) {
         $this->ext4 = serialize($this->dependency);
     }
     parent::save($df);
 }
Example #21
0
 function save($df)
 {
     $next = false;
     if (!empty($this->auto_increment) && (!empty($this->autoinc_next) || !empty($this->autoinc_start)) && isset($this->module)) {
         if (!empty($this->autoinc_start) && $this->autoinc_start > $this->autoinc_next) {
             $this->autoinc_next = $this->autoinc_start;
         }
         if (isset($this->module->table_name)) {
             global $db;
             $helper = $db->gethelper();
             //Check that the new value is greater than the old value
             $oldNext = $helper->getAutoIncrement($this->module->table_name, $this->name);
             if ($this->autoinc_next > $oldNext) {
                 $helper->setAutoIncrementStart($this->module->table_name, $this->name, $this->autoinc_next);
             }
         }
         $next = $this->autoinc_next;
         $this->autoinc_next = false;
     }
     parent::save($df);
     if ($next) {
         $this->autoinc_next = $next;
     }
 }
 function save($df)
 {
     // create the new ID field associated with this relate field - this will hold the id of the related record
     // this field must have a unique name as the name is used when constructing quicksearches and when saving the field
     //Check if we have not saved this field so we don't create two ID fields.
     //Users should not be able to switch the module after having saved it once.
     if (!$df->fieldExists($this->name)) {
         $id = new TemplateId();
         $id->len = 36;
         $id->label = strtoupper("LBL_{$this->name}_" . BeanFactory::getBeanName($this->ext2) . "_ID");
         $id->vname = $id->label;
         $this->saveIdLabel($id->label, $df);
         $count = 0;
         $basename = strtolower(get_singular_bean_name($this->ext2)) . '_id';
         $idName = $basename . '_c';
         while ($df->fieldExists($idName, 'id')) {
             $idName = $basename . ++$count . '_c';
         }
         $id->name = $idName;
         $id->reportable = false;
         $id->save($df);
         // record the id field's name, and save
         $this->ext3 = $id->name;
         $this->id_name = $id->name;
     }
     parent::save($df);
 }
 function save($df)
 {
     if (!empty($this->default_value) && is_array($this->default_value)) {
         $this->default_value = $this->default_value[0];
     }
     if (!empty($this->default) && is_array($this->default)) {
         $this->default = $this->default[0];
     }
     parent::save($df);
 }
Example #24
0
 function get_field_def()
 {
     $def = parent::get_field_def();
     $def['precision'] = $this->ext1;
     return $def;
 }
Example #25
0
 /**
  * get array of field's properties
  *
  * @return array
  */
 public function get_field_def()
 {
     $defs = parent::get_field_def();
     $defs['source'] = 'non-db';
     return $defs;
 }
Example #26
0
 /**
  * get_field_def
  *
  * @see parent::get_field_def
  * This method checks to see if the enable_range_search key/value entry should be
  * added to the vardef entry representing the module
  */
 function get_field_def()
 {
     $vardef = parent::get_field_def();
     if (!empty($this->enable_range_search)) {
         $vardef['enable_range_search'] = $this->enable_range_search;
         $vardef['options'] = $this->type == 'date' || $this->type == 'datetimecombo' || $this->type == 'datetime' ? 'date_range_search_dom' : 'numeric_range_search_dom';
     } else {
         $vardef['enable_range_search'] = false;
     }
     return $vardef;
 }
Example #27
0
 /**
  * @param DynamicField $df
  */
 function delete($df)
 {
     parent::delete($df);
 }
Example #28
0
 function get_db_modify_alter_table($table)
 {
     return parent::get_db_modify_alter_table($table);
 }