* @version 0.1 (auto-set)
*/

 global $session;
  if ($this->owner->name=='panel') {
   $out['CONTROLPANEL']=1;
  }
  $qry="1";
  // search filters
  if (IsSet($this->class_id)) {
   $class_id=$this->class_id;
   $qry.=" AND CLASS_ID='".$this->class_id."'";

   include_once(DIR_MODULES.'classes/classes.class.php');
   $cl=new classes();
   $out['PARENT_PROPERTIES']=$cl->getParentProperties($this->class_id);
   if (!$out['PARENT_PROPERTIES'][0]['ID']) {
    unset($out['PARENT_PROPERTIES']);
   }

  } else {
   global $class_id;
  }
  // QUERY READY
  global $save_qry;
  if ($save_qry) {
   $qry=$session->data['properties_qry'];
  } else {
   $session->data['properties_qry']=$qry;
  }
  if (!$qry) $qry="1";
Ejemplo n.º 2
0
         $tmp = array();
         $tmp['TITLE'] = $new_property;
         $tmp['OBJECT_ID'] = $rec['ID'];
         $tmp['ID'] = SQLInsert('properties', $tmp);
         if ($new_value != '') {
             $tmp2 = array();
             $tmp2['PROPERTY_ID'] = $tmp['ID'];
             $tmp2['OBJECT_ID'] = $rec['ID'];
             $tmp2['VALUE'] = $new_value;
             SQLInsert('pvalues', $tmp2);
         }
     }
 }
 include_once DIR_MODULES . 'classes/classes.class.php';
 $cl = new classes();
 $props = $cl->getParentProperties($rec['CLASS_ID'], '', 1);
 $my_props = SQLSelect("SELECT * FROM properties WHERE OBJECT_ID='" . $rec['ID'] . "'");
 if ($my_props[0]['ID']) {
     foreach ($my_props as $p) {
         $props[] = $p;
     }
 }
 $total = count($props);
 //print_R($props);exit;
 for ($i = 0; $i < $total; $i++) {
     if (!$props[$i]['KEEP_HISTORY'] && $rec['KEEP_HISTORY'] > 0) {
         $props[$i]['KEEP_HISTORY'] = $rec['KEEP_HISTORY'];
     }
     $value = SQLSelectOne("SELECT * FROM pvalues WHERE PROPERTY_ID='" . $props[$i]['ID'] . "' AND OBJECT_ID='" . $rec['ID'] . "'");
     if ($this->mode == 'update') {
         global ${"value" . $props[$i]['ID']};
Ejemplo n.º 3
0
/**
* Title
*
* Description
*
* @access public
*/
 function getPropertyByName($name, $class_id, $object_id) {
  $rec=SQLSelectOne("SELECT ID FROM properties WHERE OBJECT_ID='".(int)$object_id."' AND TITLE LIKE '".DBSafe($name)."'");
  if ($rec['ID']) {
   return $rec['ID'];
  }

  include_once(DIR_MODULES.'classes/classes.class.php');
  $cl=new classes();
  $props=$cl->getParentProperties($class_id, '', 1);

  $total=count($props);
  for($i=0;$i<$total;$i++) {
   if (strtolower($props[$i]['TITLE'])==strtolower($name)) {
    return $props[$i]['ID'];
   }
  }

 return false;

 }