Public Member Functions | |
| ilPaymentObject (&$user_obj, $a_pobject_id=null) | |
| getPobjectId () | |
| setRefId ($a_ref_id) | |
| getRefId () | |
| setStatus ($a_status) | |
| getStatus () | |
| setPayMethod ($a_method) | |
| getPayMethod () | |
| setVendorId ($a_vendor_id) | |
| getVendorId () | |
| add () | |
| delete () | |
| update () | |
| _lookupPobjectId ($a_ref_id) | |
| _getCountObjectsByPayMethod ($a_type) | |
| _getObjectsData ($a_user_id) | |
| _getAllObjectsData () | |
| _getObjectData ($a_id) | |
| _isPurchasable ($a_ref_id, $a_vendor_id=0) | |
| _hasAccess ($a_ref_id) | |
| _getActivation ($a_ref_id) | |
| _isBuyable ($a_ref_id) | |
| _isInCart ($a_ref_id) | |
| __read () | |
Data Fields | |
| $db = null | |
| $user_obj = null | |
| $pobject_id = null | |
| $ref_id = null | |
| $status = null | |
| $pay_method = null | |
| $vendor_id = null | |
Definition at line 38 of file class.ilPaymentObject.php.
| ilPaymentObject::__read | ( | ) |
Definition at line 432 of file class.ilPaymentObject.php.
References $res, getPobjectId(), setPayMethod(), setRefId(), setStatus(), and setVendorId().
Referenced by ilPaymentObject().
{
if($this->getPobjectId())
{
$query = "SELECT * FROM payment_objects ".
"WHERE pobject_id = '".$this->getPobjectId()."'";
$res = $this->db->query($query);
while($row =& $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$this->setRefId($row->ref_id);
$this->setStatus($row->status);
$this->setPayMethod($row->pay_method);
$this->setVendorId($row->vendor_id);
return true;
}
}
return false;
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilPaymentObject::_getActivation | ( | $ | a_ref_id | ) |
Definition at line 385 of file class.ilPaymentObject.php.
References $res.
{
include_once './payment/classes/class.ilPaymentBookings.php';
global $rbacsystem,$ilDB;
$query = "SELECT * FROM payment_objects ".
"WHERE ref_id = '".$a_ref_id."' ".
"AND (status = '1' OR status = '2')";
$res = $ilDB->query($query);
$row = $res->fetchRow(DB_FETCHMODE_OBJECT);
return ilPaymentBookings::_getActivation($row->pobject_id);
}
| ilPaymentObject::_getAllObjectsData | ( | ) |
Definition at line 246 of file class.ilPaymentObject.php.
References $_SESSION, and $res.
Referenced by ilObjPaymentSettingsGUI::objectsObject().
{
global $ilDB;
$query = "SELECT * FROM payment_objects ";
if ($_SESSION["pay_objects"]["title_value"] != "")
{
$query .= ", object_reference AS obr ";
$query .= ", object_data AS od ";
}
if ($_SESSION['pay_objects']['vendor'] != "")
{
$query .= ", usr_data AS ud ";
}
$query .= " WHERE 1 ";
if ($_SESSION["pay_objects"]["title_value"])
{
$query .= " AND obr.ref_id = payment_objects.ref_id AND od.obj_id = obr.obj_id ";
$search_string = "";
$title_search = explode(" ", trim($_SESSION["pay_objects"]["title_value"]));
for ($i = 0; $i < count($title_search); $i++)
{
$title_search[$i] = trim($title_search[$i]);
if ($title_search[$i] != "")
{
$search_string .= " od.title LIKE ".$ilDB->quote("%".$title_search[$i]."%")." ";
switch ($_SESSION["pay_objects"]["title_type"])
{
case "or" :
if ($i < count($title_search) - 1) $search_string .= " OR ";
break;
case "and" :
if ($i < count($title_search) - 1) $search_string .= " AND ";
break;
}
}
}
if ($search_string != "")
{
$query .= " AND (" . $search_string . ") ";
}
}
if ($_SESSION['pay_objects']['vendor'] != "")
{
$query .= " AND ud.usr_id = payment_objects.vendor_id AND login = ".$ilDB->quote($_SESSION["pay_objects"]["vendor"])." ";
}
if ($_SESSION["pay_objects"]["pay_method"] == "1" ||
$_SESSION["pay_objects"]["pay_method"] == "2" ||
$_SESSION["pay_objects"]["pay_method"] == "3")
{
$query .= " AND pay_method = '" . $_SESSION["pay_objects"]["pay_method"] . "' ";
}
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$objects[$row->pobject_id]['pobject_id'] = $row->pobject_id;
$objects[$row->pobject_id]['ref_id'] = $row->ref_id;
$objects[$row->pobject_id]['status'] = $row->status;
$objects[$row->pobject_id]['pay_method'] = $row->pay_method;
$objects[$row->pobject_id]['vendor_id'] = $row->vendor_id;
}
return $objects ? $objects : array();
}
Here is the caller graph for this function:| ilPaymentObject::_getCountObjectsByPayMethod | ( | $ | a_type | ) |
Definition at line 174 of file class.ilPaymentObject.php.
References $res.
Referenced by ilObjPaymentSettingsGUI::savePayMethodsObject().
{
global $ilDB;
switch($a_type)
{
case 'pm_bill':
$pm = 1;
break;
case 'pm_bmf':
$pm = 2;
break;
case 'pm_paypal':
$pm = 3;
break;
default:
$pm = -1;
}
$query = 'SELECT count(pay_method) as pm FROM payment_objects '.
"WHERE pay_method = '".$pm."'";
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
return $row->pm;
}
return 0;
}
Here is the caller graph for this function:| ilPaymentObject::_getObjectData | ( | $ | a_id | ) |
Definition at line 323 of file class.ilPaymentObject.php.
References $res.
Referenced by ilPurchasePaypal::__saveTransaction().
{
global $ilDB;
$query = "SELECT * FROM payment_objects ".
"WHERE pobject_id = '".$a_id."'";
$res = $ilDB->query($query);
if (is_object($res))
{
return $res->fetchRow(DB_FETCHMODE_ASSOC);
}
return false;
}
Here is the caller graph for this function:| ilPaymentObject::_getObjectsData | ( | $ | a_user_id | ) |
Definition at line 208 of file class.ilPaymentObject.php.
References $res, ilPaymentTrustees::_getVendorsForObjects(), and ilPaymentVendors::_isVendor().
Referenced by ilPaymentObjectGUI::showObjects().
{
global $ilDB;
// get all vendors user is assigned to
include_once './payment/classes/class.ilPaymentTrustees.php';
include_once './payment/classes/class.ilPaymentVendors.php';
$vendors = ilPaymentTrustees::_getVendorsForObjects($a_user_id);
if(ilPaymentVendors::_isVendor($a_user_id))
{
$vendors[] = $a_user_id;
}
if(!count($vendors))
{
return array();
}
$in = " IN ('";
$in .= implode("','",$vendors);
$in .= "')";
$query = "SELECT * FROM payment_objects ".
"WHERE vendor_id ".$in;
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
$objects[$row->pobject_id]['pobject_id'] = $row->pobject_id;
$objects[$row->pobject_id]['ref_id'] = $row->ref_id;
$objects[$row->pobject_id]['status'] = $row->status;
$objects[$row->pobject_id]['pay_method'] = $row->pay_method;
$objects[$row->pobject_id]['vendor_id'] = $row->vendor_id;
}
return $objects ? $objects : array();
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilPaymentObject::_hasAccess | ( | $ | a_ref_id | ) |
Definition at line 359 of file class.ilPaymentObject.php.
References $res, and ilPaymentBookings::_hasAccess().
Referenced by ilSearch::_checkParentConditions(), ilSAHSPresentationGUI::executeCommand(), ilLMPresentationGUI::executeCommand(), ilObjCourseGUI::executeCommand(), ilObjSAHSLearningModuleListGUI::getCommandFrame(), ilObjLearningModuleListGUI::getCommandFrame(), ilObjDlBookListGUI::getCommandFrame(), ilObjFileBasedLMListGUI::getCommandFrame(), ilObjLearningModuleListGUI::getProperties(), ilObjectListGUI::insertCommands(), and ilObjectListGUI::insertPayment().
{
include_once './payment/classes/class.ilPaymentBookings.php';
global $rbacsystem,$ilDB;
// check write access
if($rbacsystem->checkAccess('write',$a_ref_id))
{
return true;
}
$query = "SELECT * FROM payment_objects ".
"WHERE ref_id = '".$a_ref_id."' ".
"AND (status = '1' OR status = '2')";
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
if(!ilPaymentBookings::_hasAccess($row->pobject_id))
{
return false;
}
}
return true;
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilPaymentObject::_isBuyable | ( | $ | a_ref_id | ) |
Definition at line 399 of file class.ilPaymentObject.php.
References $res.
Referenced by ilObjectGUI::confirmedDeleteObject(), ilObjSAHSLearningModuleListGUI::getCommandFrame(), ilObjLearningModuleListGUI::getCommandFrame(), ilObjDlBookListGUI::getCommandFrame(), ilObjFileBasedLMListGUI::getCommandFrame(), ilObjLearningModuleListGUI::getProperties(), ilObjectListGUI::insertCommands(), and ilObjectListGUI::insertPayment().
{
global $ilDB;
$query = "SELECT * FROM payment_objects ".
"WHERE ref_id = '".$a_ref_id."' ".
"AND (status = 1 or status = 2)";
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
return true;
}
return false;
}
Here is the caller graph for this function:| ilPaymentObject::_isInCart | ( | $ | a_ref_id | ) |
Definition at line 414 of file class.ilPaymentObject.php.
References $res.
Referenced by ilObjLearningModuleListGUI::getProperties(), and ilObjectListGUI::insertPayment().
{
global $ilDB, $ilUser;
$query = "SELECT psc_id FROM payment_objects AS po, payment_shopping_cart AS psc ".
"WHERE ref_id = '".$a_ref_id."' ".
"AND customer_id = '".$ilUser->getId()."' ".
"AND po.pobject_id = psc.pobject_id";
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
return true;
}
return false;
}
Here is the caller graph for this function:| ilPaymentObject::_isPurchasable | ( | $ | a_ref_id, | |
| $ | a_vendor_id = 0 | |||
| ) |
Definition at line 340 of file class.ilPaymentObject.php.
References $res.
Referenced by ilPaymentObjectGUI::addObject(), ilPaymentObjectSelector::isClickable(), and ilPaymentObjectSelector::showChilds().
{
global $ilDB;
// In the moment it's not possible to sell one object twice
$query = "SELECT * FROM payment_objects ".
"WHERE ref_id = '".$a_ref_id."' ";
if ($a_vendor_id > 0)
{
$query .= "AND vendor_id = '".$a_vendor_id."' ";
}
#"AND status = '1' OR status = '3' ";
$res = $ilDB->query($query);
return $res->numRows() ? false : true;
}
Here is the caller graph for this function:| ilPaymentObject::_lookupPobjectId | ( | $ | a_ref_id | ) |
Definition at line 159 of file class.ilPaymentObject.php.
References $res.
Referenced by ilPaymentPurchaseGUI::__initPaymentObject(), ilPaymentStatisticGUI::addCustomer(), ilObjPaymentSettingsGUI::addCustomerObject(), ilPaymentStatisticGUI::saveCustomer(), and ilObjPaymentSettingsGUI::saveCustomerObject().
{
global $ilDB;
$query = "SELECT * FROM payment_objects ".
"WHERE ref_id = '".$a_ref_id."'";
$res = $ilDB->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
return $row->pobject_id;
}
return 0;
}
Here is the caller graph for this function:| ilPaymentObject::add | ( | ) |
Definition at line 111 of file class.ilPaymentObject.php.
References $res, getPayMethod(), getRefId(), getStatus(), and getVendorId().
{
$query = "INSERT INTO payment_objects ".
"VALUES('','".
$this->getRefId()."','".
$this->getStatus()."',' ".
$this->getPayMethod()."',' ".
$this->getVendorId()."')";
$this->db->query($query);
$query = "SELECT LAST_INSERT_ID() as new_id";
$res = $this->db->query($query);
while($row = $res->fetchRow(DB_FETCHMODE_OBJECT))
{
return $row->new_id;
}
return false;
}
Here is the call graph for this function:| ilPaymentObject::delete | ( | ) |
Definition at line 131 of file class.ilPaymentObject.php.
References getPobjectId().
{
if($this->getPobjectId())
{
$query = "DELETE FROM payment_objects ".
"WHERE pobject_id = '".$this->getPobjectId()."'";
$this->db->query($query);
return true;
}
return false;
}
Here is the call graph for this function:| ilPaymentObject::getPayMethod | ( | ) |
Definition at line 95 of file class.ilPaymentObject.php.
Referenced by add().
{
return $this->pay_method;
}
Here is the caller graph for this function:| ilPaymentObject::getPobjectId | ( | ) |
Definition at line 70 of file class.ilPaymentObject.php.
Referenced by __read(), and delete().
{
return $this->pobject_id;
}
Here is the caller graph for this function:| ilPaymentObject::getRefId | ( | ) |
Definition at line 79 of file class.ilPaymentObject.php.
Referenced by add().
{
return $this->ref_id;
}
Here is the caller graph for this function:| ilPaymentObject::getStatus | ( | ) |
Definition at line 87 of file class.ilPaymentObject.php.
Referenced by add().
{
return $this->status;
}
Here is the caller graph for this function:| ilPaymentObject::getVendorId | ( | ) |
Definition at line 103 of file class.ilPaymentObject.php.
Referenced by add().
{
return $this->vendor_id;
}
Here is the caller graph for this function:| ilPaymentObject::ilPaymentObject | ( | &$ | user_obj, | |
| $ | a_pobject_id = null | |||
| ) |
Definition at line 49 of file class.ilPaymentObject.php.
References $user_obj, and __read().
{
global $ilDB;
$this->db =& $ilDB;
$this->user_obj =& $user_obj;
$this->STATUS_NOT_BUYABLE = 0;
$this->STATUS_BUYABLE = 1;
$this->STATUS_EXPIRES = 2;
$this->PAY_METHOD_NOT_SPECIFIED = PAY_METHOD_NOT_SPECIFIED;
$this->PAY_METHOD_BILL = PAY_METHOD_BILL;
$this->PAY_METHOD_BMF = PAY_METHOD_BMF;
$this->PAY_METHOD_PAYPAL = PAY_METHOD_PAYPAL;
$this->pobject_id = $a_pobject_id;
$this->__read();
}
Here is the call graph for this function:| ilPaymentObject::setPayMethod | ( | $ | a_method | ) |
Definition at line 91 of file class.ilPaymentObject.php.
Referenced by __read().
{
$this->pay_method = $a_method;
}
Here is the caller graph for this function:| ilPaymentObject::setRefId | ( | $ | a_ref_id | ) |
Definition at line 75 of file class.ilPaymentObject.php.
Referenced by __read().
{
$this->ref_id = $a_ref_id;
}
Here is the caller graph for this function:| ilPaymentObject::setStatus | ( | $ | a_status | ) |
Definition at line 83 of file class.ilPaymentObject.php.
Referenced by __read().
{
$this->status = $a_status;
}
Here is the caller graph for this function:| ilPaymentObject::setVendorId | ( | $ | a_vendor_id | ) |
Definition at line 99 of file class.ilPaymentObject.php.
Referenced by __read().
{
$this->vendor_id= $a_vendor_id;
}
Here is the caller graph for this function:| ilPaymentObject::update | ( | ) |
Definition at line 145 of file class.ilPaymentObject.php.
{
$query = "UPDATE payment_objects ".
"SET ref_id = '".$this->getRefId()."', ".
"status = '".$this->getStatus()."', ".
"pay_method = '".$this->getPayMethod()."', ".
"vendor_id = '".$this->getVendorId()."' ".
"WHERE pobject_id = '".$this->getPobjectId()."'";
$this->db->query($query);
return true;
}
| ilPaymentObject::$db = null |
Definition at line 40 of file class.ilPaymentObject.php.
| ilPaymentObject::$pay_method = null |
Definition at line 46 of file class.ilPaymentObject.php.
| ilPaymentObject::$pobject_id = null |
Definition at line 42 of file class.ilPaymentObject.php.
| ilPaymentObject::$ref_id = null |
Definition at line 44 of file class.ilPaymentObject.php.
| ilPaymentObject::$status = null |
Definition at line 45 of file class.ilPaymentObject.php.
| ilPaymentObject::$user_obj = null |
Definition at line 41 of file class.ilPaymentObject.php.
Referenced by ilPaymentObject().
| ilPaymentObject::$vendor_id = null |
Definition at line 47 of file class.ilPaymentObject.php.
1.7.1