24 include_once
'payment/classes/class.ilPaymentObject.php';
25 include_once
'payment/classes/class.ilPaymentBookings.php';
26 include_once
'Services/Payment/classes/class.ilFileDataShop.php';
27 include_once
'Services/Payment/classes/class.ilShopVatsList.php';
51 $this->lng->loadLanguageModule(
'crs');
62 $ilTabs->setTabActive(
'paya_header');
63 $ilTabs->setSubTabActive(
'paya_object');
68 $cmd = $this->ctrl->getCmd();
69 switch($this->ctrl->getNextClass($this))
71 case 'ilpageobjectgui':
76 $this->tpl->setContent(
$ret);
81 if(!
$cmd = $this->ctrl->getCmd())
95 if(!(
int)
$_GET[
'pobject_id'])
100 $this->ctrl->setParameter($this,
'pobject_id', (
int)$_GET[
'pobject_id']);
103 $this->lng->loadLanguageModule(
'content');
105 $ilTabs->clearTargets();
106 $ilTabs->clearSubTabs();
107 $ilTabs->setBackTarget($this->lng->txt(
'back'), $this->ctrl->getLinkTarget($this,
'editDetails'),
'_top');
110 include_once
'Services/COPage/classes/class.ilPageObject.php';
111 include_once
'Services/COPage/classes/class.ilPageObjectGUI.php';
112 include_once(
'./Services/Style/classes/class.ilObjStyleSheet.php');
120 $new_page_object->setParentId(0);
121 $new_page_object->setId($this->pobject->getPobjectId());
122 $new_page_object->createFromXML();
125 $this->ctrl->setReturnByClass(
'ilpageobjectgui',
'edit');
127 $page_gui =
new ilPageObjectGUI(
'shop', $this->pobject->getPobjectId());
128 $this->ctrl->setParameter($page_gui,
'pobject_id', (
int)$_GET[
'pobject_id']);
130 $page_gui->setTemplateTargetVar(
'ADM_CONTENT');
131 $page_gui->setLinkXML(
'');
132 $page_gui->setFileDownloadLink($this->ctrl->getLinkTargetByClass(array(
'ilpageobjectgui'),
'downloadFile'));
133 $page_gui->setFullscreenLink($this->ctrl->getLinkTargetByClass(array(
'ilpageobjectgui'),
'displayMediaFullscreen'));
134 $page_gui->setSourcecodeDownloadScript($this->ctrl->getLinkTargetByClass(array(
'ilpageobjectgui'),
'download_paragraph'));
135 $page_gui->setPresentationTitle(
'');
136 $page_gui->setTemplateOutput(
false);
137 $page_gui->setHeader(
'');
138 $page_gui->setEnabledRepositoryObjects(
false);
139 $page_gui->setEnabledFileLists(
true);
140 $page_gui->setEnabledMaps(
true);
141 $page_gui->setEnabledPCTabs(
true);
143 return $this->ctrl->forwardCommand($page_gui);
148 $this->
showButton(
'showObjectSelector', $this->lng->txt(
'paya_sell_object'));
150 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.paya_objects.html',
'payment');
162 $img_change =
"<img src=\"".ilUtil::getImagePath(
"edit.gif").
"\" alt=\"".
163 $this->lng->txt(
"edit").
"\" title=\"".$this->lng->txt(
"edit").
164 "\" border=\"0\" vspace=\"0\"/>";
167 foreach($objects as
$data)
178 $trash =
'('.$this->lng->txt(
'object_deleted').
')';
180 $f_result[$counter][] = $tmp_obj->getTitle().
' '.$trash;
185 $f_result[$counter][] = $this->lng->txt(
'object_not_found');
189 switch($data[
'status'])
191 case $this->pobject->STATUS_BUYABLE:
192 $f_result[$counter][] = $this->lng->txt(
'paya_buyable');
195 case $this->pobject->STATUS_NOT_BUYABLE:
196 $f_result[$counter][] = $this->lng->txt(
'paya_not_buyable');
199 case $this->pobject->STATUS_EXPIRES:
200 $f_result[$counter][] = $this->lng->txt(
'paya_expires');
203 switch($data[
'pay_method'])
205 case $this->pobject->PAY_METHOD_NOT_SPECIFIED:
206 $f_result[$counter][] = $this->lng->txt(
'paya_pay_method_not_specified');
209 case $this->pobject->PAY_METHOD_BILL:
210 $f_result[$counter][] = $this->lng->txt(
'pays_bill');
213 case $this->pobject->PAY_METHOD_BMF:
214 $f_result[$counter][] = $this->lng->txt(
'pays_bmf');
217 case $this->pobject->PAY_METHOD_PAYPAL:
218 $f_result[$counter][] = $this->lng->txt(
'pays_paypal');
221 case $this->pobject->PAY_METHOD_EPAY:
222 $f_result[$counter][] = $this->lng->txt(
'pays_epay');
226 if($data[
'vat_id'] <= 0)
229 $vat_rate = $this->lng->txt(
'payment_vat_has_to_be_defined_by_administration_short');
241 $vat_rate = $this->lng->txt(
'payment_vat_has_to_be_defined_by_administration_short');
247 $f_result[$counter][] = $vat_rate;
251 $f_result[$counter][] = $tmp_user->getFullname().
' ['.$tmp_user->getLogin().
']';
259 $this->ctrl->setParameter($this,
'pobject_id',$data[
'pobject_id']);
260 # $link_change = "<a href=\"".$this->ctrl->getLinkTarget($this,"editDetails")."\"> ".
261 # $img_change."</a>";
262 $link_change =
"<div class=\"il_ContainerItemCommands\"><a class=\"il_ContainerItemCommand\" href=\"".$this->ctrl->getLinkTarget($this,
"editDetails").
"\">".$this->lng->txt(
"edit").
"</a></div>";
264 $f_result[$counter][] = $link_change;
278 if(!(
int)
$_GET[
'pobject_id'])
286 $this->ctrl->setParameter($this,
'pobject_id', (
int)$_GET[
'pobject_id']);
288 $this->
showButton(
'editDetails', $this->lng->txt(
'paya_edit_details'));
290 $this->
showButton(
'editPrices', $this->lng->txt(
'paya_edit_prices'));
292 $ilToolbar->addButton($this->lng->txt(
'pay_edit_abstract'), $this->ctrl->getLinkTargetByClass(array(
'ilpageobjectgui'),
'edit'));
294 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.paya_edit.html',
'payment');
295 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.shop_content.html',
'Services/Payment');
299 $this->tpl->setCurrentBlock(
'confirm_delete');
300 $this->tpl->setVariable(
'CONFIRM_FORMACTION',$this->ctrl->getFormAction($this));
301 $this->tpl->setVariable(
'TXT_CANCEL',$this->lng->txt(
'cancel'));
302 $this->tpl->setVariable(
'CONFIRM_CMD',
'performDelete');
303 $this->tpl->setVariable(
'TXT_CONFIRM',$this->lng->txt(
'confirm'));
304 $this->tpl->parseCurrentBlock();
310 $tmp_object[
'title'] = $tmp_obj->getTitle();
311 $tmp_object[
'type'] = $tmp_obj->getType();
315 $tmp_object[
'title'] = $this->lng->txt(
'object_not_found');
316 $tmp_object[
'type'] =
'';
318 include_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
320 $oForm->setFormAction($this->ctrl->getFormAction($this,
'updateDetails'));
322 $oForm->setTitle($tmp_object[
'title']);
328 $oForm->addItem($oPathGUI);
333 $oForm->addItem($oPurchasersGUI);
336 $oVendorsGUI =
new ilSelectInputGUI($this->lng->txt(
'paya_vendor'),
'vendor');
338 $oVendorsGUI->setValue($this->pobject->getVendorId());
339 $oForm->addItem($oVendorsGUI);
344 $oStatusGUI->setValue($this->pobject->getStatus());
345 $oForm->addItem($oStatusGUI);
348 $oPayMethodsGUI =
new ilSelectInputGUI($this->lng->txt(
'paya_pay_method'),
'pay_method');
350 $oPayMethodsGUI->setValue($this->pobject->getPayMethod());
351 $oForm->addItem($oPayMethodsGUI);
358 include_once
'Services/Payment/classes/class.ilShopTopics.php';
360 $topic_options = array();
361 $topic_options[
''] = $this->lng->txt(
'please_choose');
363 foreach($topics as $oTopic)
365 $topic_options[$oTopic->getId()] = $oTopic->getTitle();
368 $oTopicsGUI->setOptions($topic_options);
369 $oTopicsGUI->setValue($this->pobject->getTopicId());
370 $oForm->addItem($oTopicsGUI);
375 $oShopVatsList->read();
376 if($oShopVatsList->hasItems())
380 $vats_options = array();
381 foreach($oShopVatsList as $oVAT)
386 $oVatsGUI->setOptions($vats_options);
387 $oVatsGUI->setValue($this->pobject->getVatId());
388 $oForm->addItem($oVatsGUI);
393 $oVatsGUI->
setValue($this->lng->txt(
'paya_no_vats_assigned'));
394 $oForm->addItem($oVatsGUI);
399 if(($webpath_file = $oFile->getCurrentImageWebPath()) !==
false)
401 $oThumbnail->setImage($webpath_file);
403 $oForm->addItem($oThumbnail);
406 $oForm->addCommandButton(
'updateDetails', $this->lng->txt(
'save'));
407 $oForm->addCommandButton(
'deleteObject', $this->lng->txt(
'delete'));
409 $this->tpl->setVariable(
'PAYMENT_OBJECT_FORM', $oForm->getHTML());
414 include_once
'./payment/classes/class.ilPaymentBookings.php';
416 if(!
$_GET[
'pobject_id'])
441 include_once
'./payment/classes/class.ilPaymentPrices.php';
442 include_once
'./payment/classes/class.ilPaymentBillVendor.php';
444 if(!
$_GET[
'pobject_id'])
454 $this->pobject->delete();
458 $price_obj->deleteAllPrices();
477 switch($this->pobject->getPayMethod())
479 case $this->pobject->PAY_METHOD_NOT_SPECIFIED:
480 ilUtil::sendFailiure($this->lng->txt(
'paya_select_pay_method_first'));
484 case $this->pobject->PAY_METHOD_BILL:
489 case $this->pobject->PAY_METHOD_BMF:
494 case $this->pobject->PAY_METHOD_PAYPAL:
508 if($a_show_delete ==
false) unset(
$_SESSION[
'price_ids']);
510 include_once
'./payment/classes/class.ilPaymentPrices.php';
511 include_once
'./payment/classes/class.ilPaymentCurrency.php';
512 include_once
'./Services/Table/classes/class.ilTableGUI.php';
513 include_once
'./payment/classes/class.ilGeneralSettings.php';
519 if(!
$_GET[
'pobject_id'])
523 $this->objectsObject();
526 $this->ctrl->setParameter($this,
'pobject_id',(
int)
$_GET[
'pobject_id']);
529 $this->
__showButton(
'showObjects',$this->lng->txt(
'back'));
530 $this->
__showButton(
'editDetails',$this->lng->txt(
'paya_edit_details'));
531 $this->
__showButton(
'editPrices',$this->lng->txt(
'paya_edit_prices'));
534 $this->tpl->setCurrentBlock(
'btn_cell');
535 $this->tpl->setVariable(
'BTN_LINK', $this->ctrl->getLinkTargetByClass(array(
'ilpageobjectgui'),
'edit'));
536 $this->tpl->setVariable(
'BTN_TXT', $this->lng->txt(
'pay_edit_abstract'));
537 $this->tpl->parseCurrentBlock();
541 $this->tpl->addBlockfile(
"ADM_CONTENT",
"adm_content",
'tpl.paya_edit_prices.html',
'payment');
543 $prices = $price_obj->getPrices();
550 $this->tpl->setCurrentBlock(
'price_info');
551 $this->tpl->setVariable(
'CONFIRM_FORMACTION',$this->ctrl->getFormAction($this));
552 $this->tpl->setVariable(
'CONFIRM_CMD',
'addPrice');
553 $this->tpl->setVariable(
'TXT_CONFIRM',$this->lng->txt(
'paya_add_price'));
554 $this->tpl->parseCurrentBlock();
563 $this->tpl->setCurrentBlock(
'cancel');
564 $this->tpl->setVariable(
'CANCEL_CMD',
'editPrices');
565 $this->tpl->setVariable(
'TXT_CANCEL',$this->lng->txt(
'cancel'));
566 $this->tpl->parseCurrentBlock();
568 $this->tpl->setCurrentBlock(
'price_info');
569 $this->tpl->setVariable(
'CONFIRM_FORMACTION',$this->ctrl->getFormAction($this));
570 $this->tpl->setVariable(
'CONFIRM_CMD',
'performDeletePrice');
571 $this->tpl->setVariable(
'TXT_CONFIRM',$this->lng->txt(
'paya_delete_price'));
572 $this->tpl->parseCurrentBlock();
580 $tpl->setCurrentBlock(
'tbl_form_header');
582 $tpl->setVariable(
'FORMACTION',$this->ctrl->getFormAction($this));
583 $tpl->parseCurrentBlock();
586 foreach($prices as $price)
589 if($a_show_delete ==
true )
591 $this->ctrl->setParameter($this,
'show_delete',
'true');
593 if(in_array($price[
'price_id'],
$_SESSION[
'price_ids']))
596 $data[$counter][
'price_id'] =
'';
597 $data[$counter][
'duration'] =$price[
'duration'] ;
598 $data[$counter][
'month'] = $this->lng->txt(
'paya_months');
600 $data[$counter][
'unlimited_duration'] = ilUtil::formCheckBox($price[
'unlimited_duration'] ? 1 : 0,
601 'duration_ids[]', (
int)$price[
'price_id']);
604 $data[$counter][
'currency_unit'] = $genSet->get(
'currency_unit');
609 $data[$counter][
'price_id'] = ilUtil::formCheckBox(in_array($price[
'price_id'],
$_SESSION[
'price_ids']) ? 1 : 0,
610 'price_ids[]', $price[
'price_id']);
612 $data[$counter][
'duration'] =
ilUtil::formInput(
'prices['.$price[
'price_id'].
'][duration]',$price[
'duration']);
613 $data[$counter][
'month'] = $this->lng->txt(
'paya_months');
615 $data[$counter][
'unlimited_duration'] = ilUtil::formCheckBox($price[
'unlimited_duration'] ? 1 : 0,
616 'duration_ids[]', (
int)$price[
'price_id']);
619 $data[$counter][
'currency_unit'] = $genSet->get(
'currency_unit');
632 $parmeter = $this->ctrl->getParameterArray($this,
'show_delete');
634 if(!$parmeter[
'show_delete'])
637 $tpl->setCurrentBlock(
"tbl_action_btn");
638 $tpl->setVariable(
"BTN_NAME",
"deletePrice");
639 $tpl->setVariable(
"BTN_VALUE",$this->lng->txt(
"paya_delete_price"));
640 $tpl->parseCurrentBlock();
642 $tpl->setCurrentBlock(
"plain_buttons");
643 $tpl->setVariable(
"PBTN_NAME",
"addPrice");
644 $tpl->setVariable(
"PBTN_VALUE",$this->lng->txt(
"paya_add_price"));
645 $tpl->parseCurrentBlock();
647 $tpl->setCurrentBlock(
"plain_buttons");
648 $tpl->setVariable(
"PBTN_NAME",
"updatePrice");
649 $tpl->setVariable(
"PBTN_VALUE",$this->lng->txt(
"paya_update_price"));
650 $tpl->parseCurrentBlock();
652 $tpl->setCurrentBlock(
"tbl_action_row");
653 $tpl->setVariable(
"TPLPATH",$this->tpl->tplPath);
654 $tpl->setVariable(
"COLUMN_COUNTS",6);
656 $tpl->parseCurrentBlock();
659 $tbl->setTemplate(
$tpl);
662 $tpl->setCurrentBlock(
"tbl_form_header");
663 $this->ctrl->setParameter($this,
'cmd',
'editprices');
665 $tpl->setVariable(
"FORMACTION",$this->ctrl->getFormAction($this));
666 $tpl->parseCurrentBlock();
671 $tbl->setTitle($tmp_obj->getTitle(),
672 'icon_'.$tmp_obj->getType().
'_b.gif',
673 $this->lng->txt(
'objs_'.$tmp_obj->getType()));
677 $tbl->setTitle($this->lng->txt(
'object_not_found'));
679 $tbl->setHeaderNames(array(
'',
680 $this->lng->txt(
"duration"),
682 $this->lng->txt(
"unlimited_duration"),
683 $this->lng->txt(
"price_a"),
686 $header_params = $this->ctrl->getParameterArray($this,
'');
687 $tbl->setHeaderVars(array(
"price_id",
690 "unlimited_duration",
693 "options"),$header_params);
694 $tbl->setColumnWidth(array(
'5%',
"10%",
"10%",
"15%",
"15%",
"50%"));
696 $offset =
$_GET[
"offset"];
697 if(
$_GET[
"sort_by"] == NULL) $order =
'duration';
698 else $order =
$_GET[
"sort_by"];
699 $direction =
$_GET[
"sort_order"];
701 $tbl->setOrderColumn($order);
702 $tbl->setOrderDirection($direction);
703 $tbl->setOffset($offset);
704 $tbl->setLimit(
$_GET[
"limit"]);
705 $tbl->setMaxCount(count($a_result_set));
706 $tbl->setFooter(
"tblfooter",$this->lng->txt(
"previous"),$this->lng->txt(
"next"));
707 $tbl->setData($a_result_set);
711 $this->tpl->setVariable(
"PRICES_TABLE",$tbl->tpl->get());
719 if(!
$_GET[
'pobject_id'])
727 include_once
'./payment/classes/class.ilGeneralSettings.php';
731 $this->ctrl->setParameter($this,
'pobject_id',(
int)
$_GET[
'pobject_id']);
735 $this->
showButton(
'editDetails',$this->lng->txt(
'paya_edit_details'));
736 $this->
showButton(
'editPrices',$this->lng->txt(
'paya_edit_prices'));
737 # $this->__showPayMethodLink();
739 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.paya_add_price.html',
'payment');
741 $this->tpl->setVariable(
'ADD_FORMACTION',$this->ctrl->getFormAction($this));
747 $this->tpl->setVariable(
'ALT_IMG',$this->lng->txt(
'obj_'.$tmp_obj->getType()));
748 $this->tpl->setVariable(
'TITLE',$tmp_obj->getTitle());
749 $this->tpl->setVariable(
'DESCRIPTION',$this->lng->txt(
'paya_add_price_title'));
753 $this->tpl->setVariable(
'TITLE',$this->lng->txt(
'object_not_found'));
756 # $this->tpl->setVariable('TXT_PRICE_A',$this->lng->txt('currency_euro'));
757 # $this->tpl->setVariable('TXT_PRICE_B',$this->lng->txt('currency_cent'));
758 $this->tpl->setVariable(
'TXT_PRICE_A',$genSet->get(
'currency_unit'));
761 $this->tpl->setVariable(
'MONTH',$this->lng->txt(
'paya_months'));
762 $this->tpl->setVariable(
'TXT_UNLIMITED_DURATION', $this->lng->txt(
'unlimited_duration'));
764 $this->tpl->setVariable(
'TXT_DURATION',$this->lng->txt(
'duration'));
765 $this->tpl->setVariable(
'TXT_PRICE',$this->lng->txt(
'price_a'));
766 $this->tpl->setVariable(
'CANCEL',$this->lng->txt(
'cancel'));
767 $this->tpl->setVariable(
'ADD',$this->lng->txt(
'paya_add_price'));
769 $this->tpl->setVariable(
'DURATION',
$_POST[
'duration']);
770 $this->tpl->setVariable(
'UNLIMITED_DURATION',
$_POST[
'unlimited_duration']);
772 $this->tpl->setVariable(
'PRICE',
$_POST[
'price']);
779 if(!
$_GET[
'pobject_id'])
787 include_once
'./payment/classes/class.ilPaymentPrices.php';
788 include_once
'./payment/classes/class.ilPaymentCurrency.php';
794 $prices->setDuration(
$_POST[
'duration']);
795 $prices->setUnlimitedDuration(
$_POST[
'unlimited_duration']);
796 if(
$_POST[
'unlimited_duration'] ==
'1')
798 $prices->setUnlimitedDuration(1);
801 $prices->setPrice(
$_POST[
'price']);
802 $prices->setCurrency($currency[1][
'currency_id']);
805 if(!$prices->validate())
822 if(!
$_GET[
'pobject_id'])
837 include_once
'./payment/classes/class.ilPaymentPrices.php';
841 foreach(
$_SESSION[
'price_ids'] as $price_id)
843 $prices->delete($price_id);
847 if(!count($prices->getPrices()))
851 $this->pobject->setStatus($this->pobject->STATUS_NOT_BUYABLE);
852 $this->pobject->update();
865 if(!
$_GET[
'pobject_id'])
873 if(!count(
$_POST[
'price_ids']))
888 include_once
'./payment/classes/class.ilPaymentPrices.php';
890 if(!
$_GET[
'pobject_id'])
899 $this->ctrl->setParameter($this,
'pobject_id',(
int) $_GET[
'pobject_id']);
902 foreach(
$_POST[
'prices'] as $price_id => $price)
904 $old_price = $po->getPrice($price_id);
906 $po->setDuration($price[
'duration']);
907 $po->setUnlimitedDuration($price[
'unlimited_duration']);
908 $po->setPrice($price[
'price']);
909 $po->setCurrency($old_price[
'currency']);
923 foreach(
$_POST[
'prices'] as $price_id => $price)
925 $old_price = $po->getPrice($price_id);
926 if(isset(
$_POST[
'duration_ids']))
929 $search = in_array((
string)$price_id,
$_POST[
'duration_ids']);
932 if(
$_POST[
'duration_ids'] == NULL)
934 $po->setUnlimitedDuration(0);
935 $po->setDuration($price[
'duration']);
939 else if( $search = in_array((
string)$price_id,
$_POST[
'duration_ids']))
942 $po->setUnlimitedDuration(1);
947 $po->setUnlimitedDuration(0);
951 $po->setDuration($price[
'duration']);
953 $po->setPrice($price[
'price']);
954 $po->setCurrency($old_price[
'currency']);
956 $po->update($price_id);
969 if(!
$_GET[
'pobject_id'])
977 $this->ctrl->setParameter($this,
'pobject_id', (
int)$_GET[
'pobject_id']);
980 $old_pay_method = $this->pobject->getPayMethod();
981 $old_status = $this->pobject->getStatus();
985 if($old_status == $this->pobject->STATUS_NOT_BUYABLE and
986 (
int)
$_POST[
'status'] != $old_status)
989 switch((
int)
$_POST[
'pay_method'])
991 case $this->pobject->PAY_METHOD_NOT_SPECIFIED:
1001 include_once
'./payment/classes/class.ilPaymentPrices.php';
1004 if(!count($prices_obj->getPrices()))
1014 $this->pobject->setStatus((
int)
$_POST[
'status']);
1015 $this->pobject->setVendorId((
int)$_POST[
'vendor']);
1016 $this->pobject->setPayMethod((
int)$_POST[
'pay_method']);
1017 $this->pobject->setTopicId((
int)$_POST[
'topic_id']);
1018 $this->pobject->setVatId((
int)$_POST[
'vat_id']);
1021 if((
int)$_POST[
'thumbnail_delete'])
1026 else if($_FILES[
'thumbnail'][
'tmp_name'] !=
'')
1028 $this->lng->loadLanguageModule(
'form');
1029 include_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
1031 if($oThumbnail->checkInput())
1034 if(($oFile->storeUploadedFile($_FILES[
'thumbnail'])) !==
false)
1046 $this->pobject->update();
1059 include_once
'./payment/classes/class.ilPaymentObjectSelector.php';
1061 $this->tpl->addBlockFile(
'ADM_CONTENT',
'adm_content',
'tpl.paya_object_selector.html',
'payment');
1062 $this->
showButton(
'showObjects',$this->lng->txt(
'back'));
1067 $exp =
new ilPaymentObjectSelector($this->ctrl->getLinkTarget($this,
'showObjectSelector'), strtolower(get_class($this)));
1068 $exp->
setExpand(
$_GET[
'paya_link_expand'] ?
$_GET[
'paya_link_expand'] : $tree->readRootId());
1069 $exp->setExpandTarget($this->ctrl->getLinkTarget($this,
'showObjectSelector'));
1073 $this->tpl->setVariable(
"EXPLORER",$exp->getOutput());
1080 if(!(
int)
$_GET[
'sell_id'])
1086 $this->
showButton(
'showObjectSelector',$this->lng->txt(
'back'));
1089 $this->ctrl->setParameter($this,
'sell_id', (
int)$_GET[
'sell_id']);
1091 include_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
1093 $oForm->setFormAction($this->ctrl->getFormAction($this,
'updateDetails'));
1094 $oForm->setTitle($this->lng->txt(
'details'));
1098 if(is_object($tmp_obj))
1100 $tmp_object[
'title'] = $tmp_obj->getTitle();
1101 $tmp_object[
'description'] = $tmp_obj->getDescription();
1102 $tmp_object[
'owner'] = $tmp_obj->getOwnerName();
1106 $tmp_object[
'title'] = $this->lng->txt(
'object_not_found');
1107 $tmp_object[
'description'] =
'';
1108 $tmp_object[
'owner'] =
'';
1113 $oTitleGUI->
setValue($tmp_object[
'title']);
1114 $oForm->addItem($oTitleGUI);
1118 $oDescriptionGUI->
setValue($tmp_object[
'description']);
1119 $oForm->addItem($oDescriptionGUI);
1123 $oOwnerGUI->
setValue($tmp_object[
'owner']);
1124 $oForm->addItem($oOwnerGUI);
1129 $oForm->addItem($oPathGUI);
1132 $oVendorsGUI =
new ilSelectInputGUI($this->lng->txt(
'paya_vendor'),
'vendor');
1134 $oForm->addItem($oVendorsGUI);
1137 $oForm->addCommandButton(
'addObject', $this->lng->txt(
'next'));
1138 $oForm->addCommandButton(
'showObjects', $this->lng->txt(
'cancel'));
1140 $this->tpl->setVariable(
'ADM_CONTENT', $oForm->getHTML());
1145 if(!
$_GET[
'sell_id'])
1151 if(!(
int)
$_POST[
'vendor'])
1164 include_once
'payment/classes/class.ilPaymentObject.php';
1168 $p_obj->setRefId((
int)
$_GET[
'sell_id']);
1169 $p_obj->setStatus($p_obj->STATUS_NOT_BUYABLE);
1170 $p_obj->setPayMethod($p_obj->PAY_METHOD_NOT_SPECIFIED);
1171 $p_obj->setVendorId((
int)$_POST[
'vendor']);
1172 $p_obj->setTopicId((
int)$_POST[
'topic_id']);
1174 $p_obj->setVatId((
int)$_POST[
'vat_id']);
1177 if($new_id = $p_obj->add())
1180 $_GET[
'pobject_id'] = $new_id;
1193 include_once
'payment/classes/class.ilPaymentVendors.php';
1199 $vendors[] = $this->user_obj->getId();
1203 $vendors = array_merge($vendors, $vend);
1208 $options[
$vendor] = $tmp_obj->getFullname().
' ['.$tmp_obj->getLogin().
']';
1219 $option[$this->pobject->STATUS_NOT_BUYABLE] = $this->lng->txt(
'paya_not_buyable');
1220 $option[$this->pobject->STATUS_BUYABLE] = $this->lng->txt(
'paya_buyable');
1221 $option[$this->pobject->STATUS_EXPIRES] = $this->lng->txt(
'paya_expires');
1228 include_once
'payment/classes/class.ilPayMethods.php';
1232 $options[$this->pobject->PAY_METHOD_NOT_SPECIFIED] = $this->lng->txt(
'paya_pay_method_not_specified');
1235 $options[$this->pobject->PAY_METHOD_BILL] = $this->lng->txt(
'pays_bill');
1239 $options[$this->pobject->PAY_METHOD_BMF] = $this->lng->txt(
'pays_bmf');
1243 $options[$this->pobject->PAY_METHOD_PAYPAL] = $this->lng->txt(
'pays_paypal');
1247 $options[$this->pobject->PAY_METHOD_EPAY] = $this->lng->txt(
'pays_epay');
1287 $this->tpl->addBlockfile(
'BUTTONS',
'buttons',
'tpl.buttons.html');
1290 $this->tpl->setCurrentBlock(
'btn_cell');
1291 $this->tpl->setVariable(
'BTN_LINK',$this->ctrl->getLinkTarget($this,$a_cmd));
1292 $this->tpl->setVariable(
'BTN_TXT',$a_text);
1295 $this->tpl->setVariable(
'BTN_TARGET',$a_target);
1298 $this->tpl->parseCurrentBlock();
1304 $tpl =& $tbl->getTemplateObject();
1307 $tpl->setCurrentBlock(
'tbl_form_header');
1309 $tpl->setVariable(
'FORMACTION',$this->ctrl->getFormAction($this));
1310 $tpl->parseCurrentBlock();
1329 $tbl->setTitle($this->lng->txt(
'objects'),
'icon_pays.gif',$this->lng->txt(
'objects'));
1330 $tbl->setHeaderNames(array($this->lng->txt(
'title'),
1331 $this->lng->txt(
'status'),
1332 $this->lng->txt(
'paya_pay_method'),
1333 $this->lng->txt(
'vat_rate'),
1334 $this->lng->txt(
'paya_vendor'),
1335 $this->lng->txt(
'paya_count_purchaser'),
1337 $header_params = $this->ctrl->getParameterArray($this,
'');
1338 $tbl->setHeaderVars(array(
'title',
1344 'options'),$header_params);
1350 $tbl->setColumnWidth(array(
'15%',
'15%',
'15%',
'15%',
'20%',
'20%'));
1352 # $this->setTableGUIBasicData($tbl,$a_result_set);
1354 $offset =
$_GET[
'offset'];
1355 $order =
$_GET[
'sort_by'];
1356 $direction =
$_GET[
'sort_order'] ?
$_GET[
'sort_order'] :
'desc';
1358 $tbl->setOrderColumn($order,
'order_date');
1359 $tbl->setOrderDirection($direction);
1360 $tbl->setOffset($offset);
1361 $tbl->setLimit(
$_GET[
'limit']);
1362 $tbl->setMaxCount(count($a_result_set));
1363 $tbl->setFooter(
'tblfooter',$this->lng->txt(
'previous'),$this->lng->txt(
'next'));
1364 $tbl->setData($a_result_set);
1368 $this->tpl->setVariable(
'OBJECTS_TABLE',$tbl->tpl->get());
1379 $path = $tree->getPathFull($a_ref_id);
1383 foreach($path as
$data)
1385 $html .= $data[
'title'].
' > ';
1387 return substr($html,0,-2);
1391 return $this->lng->txt(
'object_deleted');
1397 include_once
'./payment/classes/class.ilPaymentObject.php';