61 $this->_aViewData[
"oxpaymentid"] = $this->
getPaymentId();
63 $this->_aViewData[
"edituser"] = $this->
getUser();
67 $this->_aViewData[
'readonly'] =
true;
70 return "user_payment.tpl";
88 if ( isset( $aDynvalues ) ) {
93 if ( $aParams[
'oxuserpayments__oxid'] ==
"-1" ) {
94 $aParams[
'oxuserpayments__oxid'] = null;
97 $oAdress =
oxNew(
"oxuserpayment" );
98 $oAdress->assign( $aParams );
113 if ( $aParams[
'oxuserpayments__oxid'] !=
"-1") {
114 $oAdress =
oxNew(
"oxuserpayment" );
115 if ( $oAdress->load( $aParams[
'oxuserpayments__oxid'] ) ) {
116 $this->_blDelete = ( bool ) $oAdress->delete();
129 if ( $this->_oActiveUser == null ) {
130 $this->_oActiveUser =
false;
132 if ( $sOxId !=
"-1" && isset( $sOxId)) {
134 $this->_oActiveUser =
oxNew(
"oxuser" );
135 $this->_oActiveUser->load( $sOxId);
148 if ( $this->_sPaymentId == null ) {
150 if ( !$this->_sPaymentId || $this->_blDelete ) {
151 if ( $oUser = $this->
getUser() ) {
152 $oUserPayments = $oUser->getUserPayments();
153 if ( isset( $oUserPayments[0]) ) {
154 $this->_sPaymentId = $oUserPayments[0]->oxuserpayments__oxid->value;
158 if ( !$this->_sPaymentId ) {
159 $this->_sPaymentId =
"-1";
172 if ( $this->_oPaymentTypes == null ) {
175 $this->_oPaymentTypes =
oxNew(
"oxlist" );
176 $this->_oPaymentTypes->init(
"oxpayment");
177 $oListObject = $this->_oPaymentTypes->getBaseObject();
179 $this->_oPaymentTypes->getList();
191 if ( $this->_oUserPayment == null ) {
192 $this->_oUserPayment =
false;
194 if ( $sPaymentId !=
"-1" && isset( $sPaymentId ) ) {
195 $this->_oUserPayment =
oxNew(
"oxuserpayment" );
196 $this->_oUserPayment->load( $sPaymentId );
197 $sTemplate = $this->_oUserPayment->oxuserpayments__oxvalue->value;
201 foreach ( $oPaymentTypes as $oPayment ) {
202 if ( $oPayment->oxpayments__oxid->value == $this->_oUserPayment->oxuserpayments__oxpaymentsid->value) {
203 $oPayment->selected = 1;
206 $sTemplate = $oPayment->oxpayments__oxvaldesc->value;
210 $this->_oUserPayment->setDynValues(
oxRegistry::getUtils()->assignValuesFromText( $sTemplate ) );
223 if ( $this->_oUserPayments == null ) {
224 $this->_oUserPayments =
false;
225 if ( $oUser = $this->
getUser() ) {
228 $this->_oUserPayments = $oUser->getUserPayments();
230 foreach ( $this->_oUserPayments as $oUserPayment ) {
231 $oPayment =
oxNew(
'oxpayment' );
232 $oPayment->setLanguage( $sTplLang );
233 $oPayment->load( $oUserPayment->oxuserpayments__oxpaymentsid->value );
234 $oUserPayment->oxpayments__oxdesc = clone $oPayment->oxpayments__oxdesc;
235 if ( $oUserPayment->oxuserpayments__oxid->value == $sPaymentId ) {
236 $oUserPayment->selected = 1;