Changeset 17654
- Timestamp:
- 09/22/08 15:17:33 (2 months ago)
- Files:
-
- branches/MidCOM_2_8/midcom.core/midcom/exec/object_test.php (added)
- branches/MidCOM_2_8/midcom.helper.reflector/exec/test.php (modified) (1 diff)
- branches/MidCOM_2_8/net.nemein.favourites/favourite.php (modified) (2 diffs)
- branches/MidCOM_2_8/net.nemein.registrations/registration.php (modified) (1 diff)
- branches/MidCOM_2_8/org.openpsa.projects/resource_midcomdba.php (modified) (3 diffs)
- branches/MidCOM_2_8/org.openpsa.sales/salesproject_member.php (modified) (1 diff)
- branches/MidCOM_2_8/org.routamc.positioning/aerodrome.php (modified) (1 diff)
- branches/MidCOM_2_8/org.routamc.positioning/country.php (modified) (2 diffs)
- branches/MidCOM_2_8/org.routamc.positioning/log.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/MidCOM_2_8/midcom.helper.reflector/exec/test.php
r17647 r17654 23 23 // this will exit 24 24 } 25 $reflector = new midcom_helper_reflector($object);25 $reflector =& midcom_helper_reflector::get($object); 26 26 27 27 echo "Got " . $reflector->get_class_label() . ' "' . $reflector->get_object_label($object) . "\", dump<pre>\n"; branches/MidCOM_2_8/net.nemein.favourites/favourite.php
r16449 r17654 33 33 function get_parent_guid_uncached() 34 34 { 35 return $this->metadata->creator; 35 if ( isset($this->metadata) 36 && isset($this->metadata->creator)) 37 { 38 return $this->metadata->creator; 39 } 36 40 } 37 41 … … 78 82 } 79 83 $qb = net_nemein_favourites_favourite_dba::new_query_builder(); 80 $qb->add_constraint('objectGuid', '=', $this->objectGuid);84 $qb->add_constraint('objectGuid', '=', (string)$this->objectGuid); 81 85 82 86 if ($this->bury) branches/MidCOM_2_8/net.nemein.registrations/registration.php
r17004 r17654 128 128 function _run_pricing_plugin() 129 129 { 130 if ( !isset($this->_config) 131 || !is_object($this->_config)) 132 { 133 // Could not read config 134 return false; 135 } 130 136 // The plugin is likely to update us (perhaps many times if it sets parameters...), thus causing loops unless we take care 131 137 $flag = "net_nemein_registrations_registration_dba__run_pricing_plugin_{$this->guid}"; branches/MidCOM_2_8/org.openpsa.projects/resource_midcomdba.php
r4794 r17654 43 43 $qb = org_openpsa_contacts_buddy::new_query_builder(); 44 44 $user = $_MIDCOM->auth->user->get_storage(); 45 $qb->add_constraint('account', '=', $account->guid);46 $qb->add_constraint('buddy', '=', $this->_personobject->guid);45 $qb->add_constraint('account', '=', (string)$account->guid); 46 $qb->add_constraint('buddy', '=', (string)$this->_personobject->guid); 47 47 $qb->add_constraint('blacklisted', '=', false); 48 48 $buddies = $qb->execute(); … … 62 62 { 63 63 $qb = org_openpsa_projects_task_resource::new_query_builder(); 64 $qb->add_constraint('person', '=', $this->person);65 $qb->add_constraint('task', '=', $this->task);66 $qb->add_constraint('orgOpenpsaObtype', '=', $this->orgOpenpsaObtype);64 $qb->add_constraint('person', '=', (int)$this->person); 65 $qb->add_constraint('task', '=', (int)$this->task); 66 $qb->add_constraint('orgOpenpsaObtype', '=', (int)$this->orgOpenpsaObtype); 67 67 68 68 if ($this->id) 69 69 { 70 $qb->add_constraint('id', '<>', $this->id);70 $qb->add_constraint('id', '<>', (int)$this->id); 71 71 } 72 72 … … 104 104 // Add resource to other resources' buddy lists 105 105 $qb = org_openpsa_projects_task_resource::new_query_builder(); 106 $qb->add_constraint('task', '=', $this->task);106 $qb->add_constraint('task', '=', (int)$this->task); 107 107 $qb->add_constraint('orgOpenpsaObtype', '=', ORG_OPENPSA_OBTYPE_PROJECTRESOURCE); 108 $qb->add_constraint('id', '<>', $this->id);108 $qb->add_constraint('id', '<>', (int)$this->id); 109 109 $resources = $qb->execute(); 110 110 foreach ($resources as $resource) branches/MidCOM_2_8/org.openpsa.sales/salesproject_member.php
r4794 r17654 38 38 $qb = org_openpsa_contacts_buddy::new_query_builder(); 39 39 $user =& $_MIDCOM->auth->user->get_storage(); 40 $qb->add_constraint('account', '=', $owner->guid);41 $qb->add_constraint('buddy', '=', $person->guid);40 $qb->add_constraint('account', '=', (string)$owner->guid); 41 $qb->add_constraint('buddy', '=', (string)$person->guid); 42 42 $qb->add_constraint('blacklisted', '=', false); 43 43 $buddies = $qb->execute(); branches/MidCOM_2_8/org.routamc.positioning/aerodrome.php
r14980 r17654 74 74 } 75 75 76 $qb = org_routamc_positioning_aerodrome_dba::new_query_builder(); 77 $qb->add_constraint('icao', '=', $this->icao); 78 $qb->set_limit(1); 79 $matches = $qb->execute_unchecked(); 80 if (count($matches) > 0) 76 if (!empty($this->icao)) 81 77 { 82 // We don't need to save duplicate entries 83 return false; 78 $qb = org_routamc_positioning_aerodrome_dba::new_query_builder(); 79 $qb->add_constraint('icao', '=', $this->icao); 80 $qb->set_limit(1); 81 $matches = $qb->execute_unchecked(); 82 if (count($matches) > 0) 83 { 84 // We don't need to save duplicate entries 85 mgd_set_errno(MGD_ERR_DUPLICATE); 86 return false; 87 } 84 88 } 85 89 return parent::_on_creating(); branches/MidCOM_2_8/org.routamc.positioning/country.php
r14980 r17654 34 34 { 35 35 $qb = org_routamc_positioning_country_dba::new_query_builder(); 36 $qb->add_constraint('name', '=', $this->name);36 $qb->add_constraint('name', '=', (string)$this->name); 37 37 $qb->set_limit(1); 38 38 $matches = $qb->execute_unchecked(); … … 40 40 { 41 41 // We don't need to save duplicate entries 42 mgd_set_errno(MGD_ERR_DUPLICATE); 42 43 return false; 43 44 } branches/MidCOM_2_8/org.routamc.positioning/log.php
r12901 r17654 69 69 MIDCOM_LOG_WARN); 70 70 debug_pop(); 71 mgd_set_errno(MGD_ERR_DUPLICATE); 71 72 return false; 72 73 } … … 82 83 { 83 84 $qb = org_routamc_positioning_log_dba::new_query_builder(); 84 $qb->add_constraint('person', '=', $this->person);85 $qb->add_constraint('date', '<=', $this->date);85 $qb->add_constraint('person', '=', (int)$this->person); 86 $qb->add_constraint('date', '<=', (int)$this->date); 86 87 $qb->add_order('date', 'DESC'); 87 88 $qb->set_limit(1); … … 102 103 { 103 104 $qb = org_routamc_positioning_log_dba::new_query_builder(); 104 $qb->add_constraint('person', '=', $this->person);105 $qb->add_constraint('date', '>', $this->date);105 $qb->add_constraint('person', '=', (int)$this->person); 106 $qb->add_constraint('date', '>', (int)$this->date); 106 107 $qb->add_order('date', 'ASC'); 107 108 $qb->set_limit(1);
