4 include_once 
'Services/Payment/classes/class.ilPaymentObject.php';
 
    5 include_once 
'Services/Payment/classes/class.ilPaymentBookings.php';
 
    6 include_once 
'Services/Payment/classes/class.ilFileDataShop.php';
 
    7 include_once 
'Services/Payment/classes/class.ilShopVatsList.php';
 
    8 include_once 
'./Services/Payment/classes/class.ilShopTableGUI.php';
 
   32                 $this->lng->loadLanguageModule(
'crs');
 
   43                 $ilTabs->setTabActive(
'paya_header');
 
   44                 $ilTabs->setSubTabActive(
'paya_object');
 
   49                 $cmd = $this->ctrl->getCmd();
 
   50                 switch($this->ctrl->getNextClass($this))
 
   52                         case 'ilpageobjectgui':
 
   57                                         $this->tpl->setContent(
$ret);
 
   62                                 if(!
$cmd = $this->ctrl->getCmd())
 
   76                 if(!(
int)
$_GET[
'pobject_id'])
 
   81                 $this->ctrl->setParameter($this, 
'pobject_id', (
int)$_GET[
'pobject_id']);
 
   84                 $this->lng->loadLanguageModule(
'content');
 
   86                 $ilTabs->clearTargets();
 
   87                 $ilTabs->clearSubTabs();
 
   88                 $ilTabs->setBackTarget($this->lng->txt(
'back'), $this->ctrl->getLinkTarget($this, 
'editDetails'), 
'_top');
 
   91                 include_once 
'Services/COPage/classes/class.ilPageObject.php';
 
   92                 include_once 
'Services/COPage/classes/class.ilPageObjectGUI.php';
 
   93                 include_once(
'./Services/Style/classes/class.ilObjStyleSheet.php');
 
  101                         $new_page_object->setParentId(0);
 
  102                         $new_page_object->setId($this->pobject->getPobjectId());
 
  103                         $new_page_object->createFromXML();
 
  106                 $this->ctrl->setReturnByClass(
'ilpageobjectgui', 
'edit');
 
  108                 $page_gui = 
new ilPageObjectGUI(
'shop', $this->pobject->getPobjectId());
 
  109                 $this->ctrl->setParameter($page_gui, 
'pobject_id', (
int)$_GET[
'pobject_id']);
 
  111                 $page_gui->setTemplateTargetVar(
'ADM_CONTENT');
 
  112                 $page_gui->setLinkXML(
'');
 
  113                 $page_gui->setFileDownloadLink($this->ctrl->getLinkTargetByClass(array(
'ilpageobjectgui'), 
'downloadFile'));
 
  114                 $page_gui->setFullscreenLink($this->ctrl->getLinkTargetByClass(array(
'ilpageobjectgui'), 
'displayMediaFullscreen'));
 
  115                 $page_gui->setSourcecodeDownloadScript($this->ctrl->getLinkTargetByClass(array(
'ilpageobjectgui'), 
'download_paragraph'));
 
  116                 $page_gui->setPresentationTitle(
'');
 
  117                 $page_gui->setTemplateOutput(
false);
 
  118                 $page_gui->setHeader(
'');
 
  119                 $page_gui->setEnabledRepositoryObjects(
false);
 
  120                 $page_gui->setEnabledFileLists(
true);
 
  121                 $page_gui->setEnabledMaps(
true);
 
  122                 $page_gui->setEnabledPCTabs(
true);
 
  124                 return $this->ctrl->forwardCommand($page_gui);
 
  130                 unset(
$_POST[
'title_type']);
 
  131                 unset(
$_POST[
'title_value']);
 
  133                 unset(
$_POST[
'pay_method']);
 
  134                 unset(
$_POST[
'updateView']);
 
  135                 unset(
$_POST[
'show_filter']);
 
  146                 include_once 
'./Services/Payment/classes/class.ilPayMethods.php';
 
  148                 $ilToolbar->addButton($this->lng->txt(
'paya_sell_object'), $this->ctrl->getLinkTarget($this, 
'showObjectSelector'));
 
  150                 if(!
$_POST[
'show_filter'] && 
$_POST[
'updateView'] == 
'1')
 
  155                 if (
$_POST[
'updateView'] == 1)
 
  165                 $this->tpl->addBlockfile(
'ADM_CONTENT', 
'adm_content', 
'tpl.main_view.html', 
'Services/Payment');
 
  168                 $this->lng->loadLanguageModule(
'search');
 
  171                 $filter_form->setFormAction($this->ctrl->getFormAction($this));
 
  172                 $filter_form->setTitle($this->lng->txt(
'pay_filter'));
 
  173                 $filter_form->setId(
'filter_form');
 
  174                 $filter_form->setTableWidth(
'100 %');
 
  177                 $o_hide_check = 
new ilCheckBoxInputGUI($this->lng->txt(
'show_filter'),
'show_filter');
 
  178                 $o_hide_check->setValue(1);             
 
  179                 $o_hide_check->setChecked(
$_SESSION[
'pay_objects'][
'show_filter'] ? 1 : 0);             
 
  182                 $o_hidden->setValue(1);
 
  183                 $o_hidden->setPostVar(
'updateView');
 
  184                 $o_hide_check->addSubItem($o_hidden);
 
  188                 $radio_option = 
new ilRadioOption($this->lng->txt(
'search_any_word'), 
'or');
 
  189                 $radio_group->addOption($radio_option);
 
  190                 $radio_option = 
new ilRadioOption($this->lng->txt(
'search_all_words'), 
'and');
 
  191                 $radio_group->addOption($radio_option);
 
  193                 $radio_group->setRequired(
false);
 
  195                 $radio_group->setPostVar(
'title_type');
 
  198                 $o_title->setValue(
$_SESSION[
'pay_objects'][
'title_value']);
 
  199                 $o_title->setPostVar(
'title_value');
 
  200                 $o_title->setTitle($this->lng->txt(
'title'));
 
  202                 $o_hide_check->addSubItem($radio_group);
 
  203                 $o_hide_check->addSubItem($o_title);
 
  207                 $o_vendor->setTitle($this->lng->txt(
'paya_vendor'));
 
  208                 $o_vendor->setValue(
$_SESSION[
'pay_objects'][
'vendor']);                                
 
  209                 $o_vendor->setPostVar(
'vendor');
 
  210                 $o_hide_check->addSubItem($o_vendor);
 
  214                 $o_paymethod->setTitle($this->lng->txt(
'payment_system'));
 
  215                 $o_paymethod->setOptions(ilPaymethods::getPayMethodsOptions(
'all'));
 
  216                 $o_paymethod->setValue(
$_SESSION[
'pay_objects'][
'pay_method']);
 
  217                 $o_paymethod->setPostVar(
'pay_method');
 
  218                 $o_hide_check->addSubItem($o_paymethod);                                
 
  220                 $filter_form->addCommandButton(
'showObjects', $this->lng->txt(
'pay_update_view'));
 
  221                 $filter_form->addCommandButton(
'resetObjectFilter', $this->lng->txt(
'pay_reset_filter'));
 
  223                 $filter_form->addItem($o_hide_check);           
 
  230                 $this->tpl->setVariable(
'FORM', $filter_form->getHTML());
 
  232                 $img_change = 
"<img src=\"".ilUtil::getImagePath(
"edit.gif").
"\" alt=\"".
 
  233                         $this->lng->txt(
"edit").
"\" title=\"".$this->lng->txt(
"edit").
 
  234                         "\" border=\"0\" vspace=\"0\"/>";
 
  237                 foreach($objects as 
$data)
 
  243                                 $f_result[$counter][
'title'] = $tmp_obj->getTitle();
 
  247                                 $f_result[$counter][
'title'] = $this->lng->txt(
'object_not_found');
 
  251                         switch($data[
'status'])
 
  253                                 case $this->pobject->STATUS_BUYABLE:
 
  254                                         $f_result[$counter][
'status'] = $this->lng->txt(
'paya_buyable');
 
  257                                 case $this->pobject->STATUS_NOT_BUYABLE:
 
  258                                         $f_result[$counter][
'status'] = $this->lng->txt(
'paya_not_buyable');
 
  261                                 case $this->pobject->STATUS_EXPIRES:
 
  262                                         $f_result[$counter][
'status'] = $this->lng->txt(
'paya_expires');
 
  266                         $f_result[$counter][
'pay_method'] = $str_paymethod;
 
  268                         if($data[
'vat_id'] <= 0)
 
  270                                 $vat_rate = $this->lng->txt(
'payment_vat_has_to_be_defined_by_administration_short');
 
  281                                         $vat_rate = $this->lng->txt(
'payment_vat_has_to_be_defined_by_administration_short');           
 
  284                         $f_result[$counter][
'vat_rate'] = $vat_rate;
 
  287                         $f_result[$counter][
'vendor'] = $tmp_user->getFullname().
' ['.$tmp_user->getLogin().
']';
 
  293                         $this->ctrl->setParameter($this,
'pobject_id',$data[
'pobject_id']);
 
  294                         $link_change = 
"<div class=\"il_ContainerItemCommands\"><a class=\"il_ContainerItemCommand\" href=\"".$this->ctrl->getLinkTarget($this,
"editDetails").
"\">".$this->lng->txt(
"edit").
"</a></div>";
 
  296                         $f_result[$counter][
'options'] = $link_change;
 
  310                 if(!(
int)
$_GET[
'pobject_id'])
 
  318                 $this->ctrl->setParameter($this,
'pobject_id', (
int)$_GET[
'pobject_id']);
 
  320                 $this->tpl->addBlockFile(
'ADM_CONTENT', 
'adm_content', 
'tpl.main_view.html', 
'Services/Payment');       
 
  322                 if(is_object($tmp_obj))
 
  324                         $tmp_object[
'title'] = $tmp_obj->getTitle();
 
  325                         $tmp_object[
'type'] = $tmp_obj->getType();
 
  329                         $tmp_object[
'title'] = $this->lng->txt(
'object_not_found');
 
  330                         $tmp_object[
'type'] = 
false;
 
  335                         include_once 
'./Services/Utilities/classes/class.ilConfirmationGUI.php';
 
  339                         $oConfirmationGUI->setFormAction($this->ctrl->getFormAction($this,
"performDelete"));
 
  340                         $oConfirmationGUI->setHeaderText($this->lng->txt(
"paya_sure_delete_object"));
 
  341                         $oConfirmationGUI->setCancel($this->lng->txt(
"cancel"), 
"editDetails");
 
  342                         $oConfirmationGUI->setConfirm($this->lng->txt(
"confirm"), 
"performDelete");                     
 
  344                         $oConfirmationGUI->addItem(
'',$tmp_object[
'title'],$tmp_object[
'title']);;
 
  345                         $this->tpl->setVariable(
'CONFIRMATION',$oConfirmationGUI->getHTML());
 
  350                 $ilToolbar->addButton($this->lng->txt(
'paya_edit_details'), $this->ctrl->getLinkTarget($this, 
'editDetails'));
 
  351                 $ilToolbar->addButton($this->lng->txt(
'paya_edit_prices'), $this->ctrl->getLinkTarget($this, 
'editPrices'));
 
  352                 $ilToolbar->addButton($this->lng->txt(
'pay_edit_abstract'), $this->ctrl->getLinkTargetByClass(array(
'ilpageobjectgui'), 
'edit'));
 
  354                 include_once 
'Services/Form/classes/class.ilPropertyFormGUI.php';
 
  356                 $oForm->setFormAction($this->ctrl->getFormAction($this, 
'updateDetails'));
 
  357                 $oForm->setTitle($tmp_object[
'title']);
 
  358                 if($tmp_object[
'type'])
 
  364                 $oForm->addItem($oPathGUI);
 
  369                 $oForm->addItem($oPurchasersGUI);
 
  372                 $oVendorsGUI = 
new ilSelectInputGUI($this->lng->txt(
'paya_vendor'), 
'vendor');          
 
  374                 $oVendorsGUI->setValue($this->pobject->getVendorId());
 
  375                 $oForm->addItem($oVendorsGUI);
 
  380                 $oStatusGUI->setValue($this->pobject->getStatus());
 
  381                 $oForm->addItem($oStatusGUI);
 
  384                 $oPayMethodsGUI = 
new ilSelectInputGUI($this->lng->txt(
'paya_pay_method'), 
'pay_method');
 
  385                 $PMoptions = ilPaymethods::getPayMethodsOptions(
'not_specified');
 
  386                 $oPayMethodsGUI->setOptions($PMoptions);
 
  387                 $oPayMethodsGUI->setValue($this->pobject->getPayMethod());
 
  388                 $oForm->addItem($oPayMethodsGUI);               
 
  395                         include_once 
'Services/Payment/classes/class.ilShopTopics.php';
 
  397                         $topic_options = array();
 
  398                         $topic_options[
''] = $this->lng->txt(
'please_choose');
 
  400                         foreach($topics as $oTopic)
 
  402                                 $topic_options[$oTopic->getId()] = $oTopic->getTitle();
 
  405                         $oTopicsGUI->setOptions($topic_options);
 
  406                         $oTopicsGUI->setValue($this->pobject->getTopicId());
 
  407                         $oForm->addItem($oTopicsGUI);
 
  412                 $oShopVatsList->read();                 
 
  413                 if($oShopVatsList->hasItems())
 
  417                         $vats_options = array();                                
 
  418                         foreach($oShopVatsList as $oVAT)
 
  423                         $oVatsGUI->setOptions($vats_options);
 
  424                         $oVatsGUI->setValue($this->pobject->getVatId());
 
  425                         $oForm->addItem($oVatsGUI);
 
  430                         $oVatsGUI->
setValue($this->lng->txt(
'paya_no_vats_assigned'));  
 
  431                         $oForm->addItem($oVatsGUI);     
 
  436                 if(($webpath_file = $oFile->getCurrentImageWebPath()) !== 
false)
 
  438                         $oThumbnail->setImage($webpath_file);
 
  440                 $oForm->addItem($oThumbnail);
 
  443                 $oForm->addCommandButton(
'updateDetails', $this->lng->txt(
'save'));
 
  444                 $oForm->addCommandButton(
'deleteObject', $this->lng->txt(
'delete'));            
 
  446                 $this->tpl->setVariable(
'FORM', $oForm->getHTML());
 
  451                 include_once 
'./Services/Payment/classes/class.ilPaymentBookings.php';
 
  453                 if(!
$_GET[
'pobject_id'])
 
  478                 include_once 
'./Services/Payment/classes/class.ilPaymentPrices.php';
 
  480                 if(!
$_GET[
'pobject_id'])
 
  490                 $this->pobject->delete();
 
  494                 $price_obj->deleteAllPrices();
 
  508                 switch($this->pobject->getPayMethod())
 
  510                         case $this->pobject->PAY_METHOD_NOT_SPECIFIED:
 
  525         public function editPrices($a_show_delete = 
false, $oConfirmationGUI = 
'')
 
  528                 include_once 
'./Services/Payment/classes/class.ilPaymentPrices.php';
 
  529                 include_once 
'./Services/Payment/classes/class.ilPaymentCurrency.php';
 
  530                 include_once 
'./Services/Utilities/classes/class.ilConfirmationGUI.php';
 
  531                 include_once 
'./Services/Payment/classes/class.ilGeneralSettings.php';
 
  534                 if($a_show_delete == 
false) unset(
$_SESSION[
'price_ids']);
 
  538                 if(!
$_GET[
'pobject_id'])
 
  542                         $this->objectsObject();
 
  545                 $this->ctrl->setParameter($this,
'pobject_id',(
int) 
$_GET[
'pobject_id']);
 
  548                 $this->tpl->addBlockfile(
"ADM_CONTENT", 
"adm_content",
'tpl.main_view.html',
'Services/Payment');
 
  551                 $prices = $price_obj->getPrices();
 
  557                         $ilToolbar->addButton($this->lng->txt(
'paya_add_price'), $this->ctrl->getLinkTarget($this, 
'addPrice'));
 
  567                         $oConfirmationGUI->setFormAction($this->ctrl->getFormAction($this,
"performDeletePrice"));
 
  568                         $oConfirmationGUI->setHeaderText($this->lng->txt(
"paya_sure_delete_selected_prices"));
 
  569                         $oConfirmationGUI->setCancel($this->lng->txt(
"cancel"), 
"editPrices");
 
  570                         $oConfirmationGUI->setConfirm($this->lng->txt(
"confirm"), 
"performDeletePrice");                        
 
  574                         foreach($prices as $price)
 
  576                                 $currency = $genSet->get(
'currency_unit');
 
  577                                 if(in_array($price[
'price_id'],
$_SESSION[
'price_ids']))
 
  580                                         if ($price[
'unlimited_duration'] == 
'1') 
 
  582                                                 $tmp_price = $this->lng->txt(
'unlimited_duration');
 
  586                                                 $tmp_price = $price[
'duration'].
' '.$this->lng->txt(
'paya_months');
 
  588                                         $delete_row = 
''.$tmp_price.
'  :  '.
 
  592                                         $oConfirmationGUI->addItem(
'',$delete_row, $delete_row);
 
  598                         $this->tpl->setVariable(
'CONFIRMATION', $oConfirmationGUI->getHTML());          
 
  603                 $ilToolbar->addButton($this->lng->txt(
'paya_edit_details'), $this->ctrl->getLinkTarget($this, 
'editDetails'));
 
  604                 $ilToolbar->addButton($this->lng->txt(
'paya_edit_prices'), $this->ctrl->getLinkTarget($this, 
'editPrices'));
 
  605                 $ilToolbar->addButton($this->lng->txt(
'pay_edit_abstract'), $this->ctrl->getLinkTargetByClass(array(
'ilpageobjectgui'), 
'edit'));
 
  611                 $tpl->setCurrentBlock(
'tbl_form_header');
 
  613                 $tpl->setVariable(
'FORMACTION',$this->ctrl->getFormAction($this));
 
  614                 $tpl->parseCurrentBlock();
 
  617                 foreach($prices as $price)
 
  620                         if($a_show_delete == 
true ) 
 
  622                                 $this->ctrl->setParameter($this, 
'show_delete', 
'true');
 
  624                                 if(in_array($price[
'price_id'],
$_SESSION[
'price_ids']))
 
  626                                 $data[$counter][
'price_id'] = ilUtil::formCheckBox(0,
 
  627                                                 'price_ids[]', (
int)$price[
'price_id']);
 
  629                                         $data[$counter][
'duration'] =$price[
'duration']  ;
 
  630                                         $data[$counter][
'month'] = $this->lng->txt(
'paya_months');
 
  632                                         $data[$counter][
'unlimited_duration'] = ilUtil::formCheckBox($price[
'unlimited_duration'] ? 1 : 0,
 
  633                                                 'duration_ids[]', (
int)$price[
'price_id']);     
 
  636                                         $data[$counter][
'currency_unit'] = $genSet->get(
'currency_unit');
 
  642                                 $data[$counter][
'price_id'] = ilUtil::formCheckBox(in_array($price[
'price_id'],
$_SESSION[
'price_ids']) ? 1 : 0,
 
  643                                         'price_ids[]', $price[
'price_id']);     
 
  645                                 $data[$counter][
'duration'] = 
ilUtil::formInput(
'prices['.$price[
'price_id'].
'][duration]',$price[
'duration']);
 
  646                                 $data[$counter][
'month'] = $this->lng->txt(
'paya_months');
 
  648                                 $data[$counter][
'unlimited_duration'] = ilUtil::formCheckBox($price[
'unlimited_duration'] ? 1 : 0,
 
  649                                         'duration_ids[]', (
int)$price[
'price_id']);     
 
  652                                 $data[$counter][
'currency_unit'] = $genSet->get(
'currency_unit');
 
  685                         $tbl->setTitle($tmp_obj->getTitle());
 
  689                         $tbl->setTitle($this->lng->txt(
'object_not_found'));
 
  692                 $tbl->setId(
'tbl_bookings');
 
  693                 $tbl->setRowTemplate(
"tpl.shop_prices_row.html", 
"Services/Payment");
 
  695                 $tbl->addColumn(
' ', 
'price_id', 
'5%');
 
  696                 $tbl->addColumn($this->lng->txt(
'duration'), 
'duration', 
'10%');
 
  697                 $tbl->addColumn(
'',
'month',
'10%');
 
  698                 $tbl->addColumn($this->lng->txt(
'unlimited_duration'), 
'unlimitied_duration', 
'15%');
 
  699                 $tbl->addColumn($this->lng->txt(
'price_a'), 
'price', 
'10%');
 
  700                 $tbl->addColumn($this->lng->txt(
'currency'), 
'currency_unit', 
'50%');
 
  701                 $tbl->setSelectAllCheckbox(
'price_id');
 
  702                 $tbl->addCommandButton(
'updatePrice',$this->lng->txt(
'paya_update_price'));
 
  703                 $tbl->addCommandButton(
'addPrice',$this->lng->txt(
'paya_add_price'));
 
  705                 $tbl->addMultiCommand(
"deletePrice", $this->lng->txt(
"paya_delete_price"));
 
  708                 $tbl->setData($a_result_set);
 
  710                 $this->tpl->setVariable(
'TABLE', $tbl->getHTML());
 
  719                 if(!
$_GET[
'pobject_id'])
 
  727                 include_once 
'./Services/Payment/classes/class.ilGeneralSettings.php';
 
  732                 $this->ctrl->setParameter($this,
'pobject_id',(
int) 
$_GET[
'pobject_id']);
 
  736                 $ilToolbar->addButton($this->lng->txt(
'paya_edit_details'), $this->ctrl->getLinkTarget($this, 
'editDetails'));
 
  737                 $ilToolbar->addButton($this->lng->txt(
'paya_edit_prices'), $this->ctrl->getLinkTarget($this, 
'editPrices'));
 
  739                 $this->tpl->addBlockfile(
'ADM_CONTENT',
'adm_content',
'tpl.main_view.html',
'Services/Payment');
 
  742                 $form->setFormAction($this->ctrl->getFormAction($this));
 
  743                 $form->setTitle($this->lng->txt(
'paya_add_price_title'));
 
  749                         $oTitle->
setValue($tmp_obj->getTitle());
 
  753                         $oTitle->setValue($this->lng->txt(
'object_not_found'));
 
  755                 $form->addItem($oTitle);
 
  759                 $oDuration->setTitle($this->lng->txt(
'duration'));
 
  760                 $oDuration->setValue(
$_POST[
'duration']);
 
  761                 $oDuration->setInfo($this->lng->txt(
'paya_months'));
 
  762                 $oDuration->setPostVar(
'duration');
 
  763                 $form->addItem($oDuration);
 
  765                 $oUnlimitedDuration = 
new ilCheckboxInputGUI($this->lng->txt(
'unlimited_duration'), 
'unlimited_duration');
 
  768                 $form->addItem($oUnlimitedDuration);
 
  772                 $oPrice->setTitle($this->lng->txt(
'price_a'));
 
  773                 $oPrice->setValue(
$_POST[
'price']);
 
  774                 $oPrice->setPostVar(
'price');
 
  775                 $oPrice->setRequired(
true);
 
  776                 $form->addItem($oPrice);
 
  779                 $this->tpl->setVariable(
'TXT_PRICE_A',$genSet->get(
'currency_unit'));
 
  802                 $form->addCommandButton(
'performAddPrice',$this->lng->txt(
'paya_add_price'));
 
  803                 $form->addCommandButton(
'editPrices', $this->lng->txt(
'cancel'));               
 
  804                 $this->tpl->setVariable(
'FORM',$form->getHTML());               
 
  812                 if(!
$_GET[
'pobject_id'])
 
  820                 include_once 
'./Services/Payment/classes/class.ilPaymentPrices.php';
 
  821                 include_once 
'./Services/Payment/classes/class.ilPaymentCurrency.php';
 
  827                 $prices->setDuration(
$_POST[
'duration']);
 
  828                 $prices->setUnlimitedDuration(
$_POST[
'unlimited_duration']);
 
  829                 if(
$_POST[
'unlimited_duration'] == 
'1')
 
  831                         $prices->setUnlimitedDuration(1);
 
  834                 $prices->setPrice(
$_POST[
'price']);
 
  835                 $prices->setCurrency($currency[1][
'currency_id']);
 
  838                 if(!$prices->validate())
 
  855                 if(!
$_GET[
'pobject_id'])
 
  870                 include_once 
'./Services/Payment/classes/class.ilPaymentPrices.php';
 
  874                 foreach(
$_SESSION[
'price_ids'] as $price_id)
 
  876                         $prices->delete($price_id);
 
  880                 if(!count($prices->getPrices()))
 
  884                         $this->pobject->setStatus($this->pobject->STATUS_NOT_BUYABLE);
 
  885                         $this->pobject->update();
 
  898                 if(!
$_GET[
'pobject_id'])
 
  906                 if(!count(
$_POST[
'price_ids']))
 
  921                 include_once 
'./Services/Payment/classes/class.ilPaymentPrices.php';
 
  923                 if(!
$_GET[
'pobject_id'])
 
  932                 $this->ctrl->setParameter($this,
'pobject_id',(
int) $_GET[
'pobject_id']);
 
  935                 foreach(
$_POST[
'prices'] as $price_id => $price)
 
  937                         $old_price = $po->getPrice($price_id);
 
  939                         $po->setDuration($price[
'duration']);
 
  940                         $po->setUnlimitedDuration($price[
'unlimited_duration']);
 
  941                         $po->setPrice($price[
'price']);                 
 
  942                         $po->setCurrency($old_price[
'currency']);
 
  957                 foreach(
$_POST[
'prices'] as $price_id => $price)
 
  959                         $old_price = $po->getPrice($price_id);
 
  960                         if(isset(
$_POST[
'duration_ids']))
 
  962                                 $search = in_array((
string)$price_id, 
$_POST[
'duration_ids']);
 
  964                                 if(
$_POST[
'duration_ids'] == NULL)
 
  966                                         $po->setUnlimitedDuration(0);           
 
  967                                         $po->setDuration($price[
'duration']);   
 
  970                                 else if( $search = in_array((
string)$price_id, 
$_POST[
'duration_ids']))
 
  972                                         $po->setUnlimitedDuration(1);           
 
  977                                         $po->setUnlimitedDuration(0);   
 
  981                         $po->setDuration($price[
'duration']);
 
  983                         $po->setPrice($price[
'price']);
 
  984                         $po->setCurrency($old_price[
'currency']);
 
  986                         $po->update($price_id);
 
  997                 if(!
$_GET[
'pobject_id'])
 
 1005                 $this->ctrl->setParameter($this, 
'pobject_id', (
int)$_GET[
'pobject_id']);               
 
 1008                 $old_pay_method = $this->pobject->getPayMethod();
 
 1009                 $old_status = $this->pobject->getStatus();
 
 1012                 if($old_status == $this->pobject->STATUS_NOT_BUYABLE and
 
 1013                    (
int) 
$_POST[
'status'] != $old_status)
 
 1016                         switch((
int) 
$_POST[
'pay_method'])
 
 1018                                 case $this->pobject->PAY_METHOD_NOT_SPECIFIED:
 
 1028                         include_once 
'./Services/Payment/classes/class.ilPaymentPrices.php';
 
 1031                         if(!count($prices_obj->getPrices()))
 
 1040                 $this->pobject->setStatus((
int)
$_POST[
'status']);
 
 1041                 $this->pobject->setVendorId((
int)$_POST[
'vendor']);
 
 1042                 $this->pobject->setPayMethod((
int)$_POST[
'pay_method']);
 
 1043                 $this->pobject->setTopicId((
int)$_POST[
'topic_id']);
 
 1044                 $this->pobject->setVatId((
int)$_POST[
'vat_id']);
 
 1046                 if((
int)$_POST[
'thumbnail_delete'])
 
 1051                 else if($_FILES[
'thumbnail'][
'tmp_name'] != 
'')
 
 1053                         $this->lng->loadLanguageModule(
'form');
 
 1054                         include_once 
'Services/Form/classes/class.ilPropertyFormGUI.php';
 
 1056                         if($oThumbnail->checkInput())
 
 1059                                 if(($oFile->storeUploadedFile($_FILES[
'thumbnail'])) !== 
false)
 
 1071                 $this->pobject->update();
 
 1081                 global $tree, $ilToolbar;
 
 1083                 include_once 
'./Services/Payment/classes/class.ilPaymentObjectSelector.php';
 
 1085                 $this->tpl->addBlockFile(
'ADM_CONTENT', 
'adm_content', 
'tpl.paya_object_selector.html',
'Services/Payment');
 
 1086                 $ilToolbar->addButton($this->lng->txt(
'back'), $this->ctrl->getLinkTarget($this, 
'showObjects'));
 
 1091                 $exp = 
new ilPaymentObjectSelector($this->ctrl->getLinkTarget($this,
'showObjectSelector'), strtolower(get_class($this)));
 
 1092                 $exp->
setExpand(
$_GET[
'paya_link_expand'] ? 
$_GET[
'paya_link_expand'] : $tree->readRootId());
 
 1093                 $exp->setExpandTarget($this->ctrl->getLinkTarget($this,
'showObjectSelector'));
 
 1097                 $this->tpl->setVariable(
"EXPLORER",$exp->getOutput());
 
 1106                 if(!(
int)
$_GET[
'sell_id'])
 
 1112                 $ilToolbar->addButton($this->lng->txt(
'back'), $this->ctrl->getLinkTarget($this, 
'showObjectSelector'));
 
 1115                 $this->ctrl->setParameter($this, 
'sell_id', (
int)$_GET[
'sell_id']);
 
 1117                 include_once 
'Services/Form/classes/class.ilPropertyFormGUI.php';
 
 1119                 $oForm->setFormAction($this->ctrl->getFormAction($this, 
'updateDetails'));
 
 1120                 $oForm->setTitle($this->lng->txt(
'details'));
 
 1126                         $tmp_object[
'title'] = $tmp_obj->getTitle();
 
 1127                         $tmp_object[
'description'] = $tmp_obj->getDescription();
 
 1128                         $tmp_object[
'owner'] = $tmp_obj->getOwnerName();
 
 1129                         $tmp_object[
'path'] = $this->
__getHTMLPath((
int)$_GET[
'sell_id']);
 
 1133                         $tmp_object[
'title'] = $this->lng->txt(
'object_not_found');
 
 1134                         $tmp_object[
'description'] = 
'';
 
 1135                         $tmp_object[
'owner'] = 
'';
 
 1136                         $tmp_object[
'path'] = 
'';
 
 1141                 $oTitleGUI->
setValue($tmp_object[
'title']);
 
 1142                 $oForm->addItem($oTitleGUI);
 
 1146                 $oDescriptionGUI->
setValue($tmp_object[
'description']);
 
 1147                 $oForm->addItem($oDescriptionGUI);
 
 1151                 $oOwnerGUI->
setValue($tmp_object[
'owner']);
 
 1152                 $oForm->addItem($oOwnerGUI);
 
 1156                 $oPathGUI->
setValue($tmp_object[
'path']);
 
 1157                 $oForm->addItem($oPathGUI);
 
 1160                 $oVendorsGUI = 
new ilSelectInputGUI($this->lng->txt(
'paya_vendor'), 
'vendor');          
 
 1162                 $oForm->addItem($oVendorsGUI);
 
 1165                 $oForm->addCommandButton(
'addObject', $this->lng->txt(
'next'));
 
 1166                 $oForm->addCommandButton(
'showObjects', $this->lng->txt(
'cancel'));             
 
 1168                 $this->tpl->setVariable(
'ADM_CONTENT', $oForm->getHTML());
 
 1173                 if(!
$_GET[
'sell_id'])
 
 1179                 if(!(
int)
$_POST[
'vendor'])
 
 1195                 include_once 
'Services/Payment/classes/class.ilPaymentObject.php';
 
 1199                 $p_obj->setRefId((
int)
$_GET[
'sell_id']);
 
 1200                 $p_obj->setStatus($p_obj->STATUS_NOT_BUYABLE);
 
 1201                 $p_obj->setPayMethod($p_obj->PAY_METHOD_NOT_SPECIFIED);
 
 1202                 $p_obj->setVendorId((
int)$_POST[
'vendor']);
 
 1203                 $p_obj->setTopicId((
int)$_POST[
'topic_id']);
 
 1204                 $p_obj->setVatId((
int)$_POST[
'vat_id']);
 
 1206                 $new_id = $p_obj->add();
 
 1210                         $_GET[
'pobject_id'] = $new_id;
 
 1222                 include_once 
'Services/Payment/classes/class.ilPaymentVendors.php';
 
 1228                         $vendors[] = $this->user_obj->getId();
 
 1232                         $vendors = array_merge($vendors, $vend);
 
 1237                         $options[
$vendor] = $tmp_obj->getFullname().
' ['.$tmp_obj->getLogin().
']';
 
 1247                 $option[$this->pobject->STATUS_NOT_BUYABLE] = $this->lng->txt(
'paya_not_buyable');
 
 1248                 $option[$this->pobject->STATUS_BUYABLE] = $this->lng->txt(
'paya_buyable');
 
 1249                 $option[$this->pobject->STATUS_EXPIRES] = $this->lng->txt(
'paya_expires');
 
 1257                 $tbl->setTitle($this->lng->txt(
'objects'));
 
 1259                 $tbl->setId(
'tbl_objects');
 
 1260                 $tbl->setRowTemplate(
"tpl.shop_objects_row.html", 
"Services/Payment");
 
 1262                 $tbl->addColumn($this->lng->txt(
'title'), 
'title', 
'10%');
 
 1263                 $tbl->addColumn($this->lng->txt(
'status'), 
'status', 
'10%');
 
 1264                 $tbl->addColumn($this->lng->txt(
'paya_pay_method'),
'pay_method',
'10%');
 
 1265                 $tbl->addColumn($this->lng->txt(
'vat_rate'), 
'vat_rate', 
'15%');
 
 1266                 $tbl->addColumn($this->lng->txt(
'paya_vendor'), 
'vendor', 
'10%');
 
 1267                 $tbl->addColumn($this->lng->txt(
'paya_count_purchaser'), 
'purchasers', 
'10%');
 
 1268                 $tbl->addColumn(
'',
'options',
'10%');
 
 1270                 $tbl->setData($a_result_set);
 
 1272                 $this->tpl->setVariable(
'TABLE', $tbl->getHTML());
 
 1282                 $path = $tree->getPathFull($a_ref_id);
 
 1287                         $html .= $data[
'title'].
' > ';
 
 1289                 return substr($html,0,-2);
 
 1294                 include_once 
'./Services/Payment/classes/class.ilPaymentObject.php';