Exemplo n.º 1
0
 /**
  * Delete table template confirmation
  */
 function deleteTemplateConfirmationObject()
 {
     global $ilCtrl, $tpl, $lng;
     if (!is_array($_POST["tid"]) || count($_POST["tid"]) == 0) {
         ilUtil::sendInfo($lng->txt("no_checkbox"), true);
         $ilCtrl->redirect($this, "listTemplates");
     } else {
         include_once "./Services/Utilities/classes/class.ilConfirmationGUI.php";
         $cgui = new ilConfirmationGUI();
         $cgui->setFormAction($ilCtrl->getFormAction($this));
         $cgui->setHeaderText($lng->txt("sty_confirm_template_deletion"));
         $cgui->setCancel($lng->txt("cancel"), "cancelTemplateDeletion");
         $cgui->setConfirm($lng->txt("sty_del_template"), "deleteTemplate");
         foreach ($_POST["tid"] as $tid) {
             $classes = $this->object->getTemplateClasses($tid);
             $cl_str = "";
             $listed = array();
             foreach ($classes as $cl) {
                 if ($cl != "" && !$listed[$cl]) {
                     $cl_str .= '<div>- ' . $cl . "</div>";
                     $listed[$cl] = true;
                 }
             }
             if ($cl_str != "") {
                 $cl_str = '<div style="padding-left:30px;" class="small">' . "<div><i>" . $lng->txt("sty_style_class") . "</i></div>" . $cl_str . "</div>";
             }
             $cgui->addItem("tid[]", $tid, $this->object->lookupTemplateName($tid) . $cl_str);
         }
         $cgui->addButton($lng->txt("sty_del_template_keep_classes"), "deleteTemplateKeepClasses");
         $tpl->setContent($cgui->getHTML());
     }
 }
 /**
  * ask delete
  *
  * @access protected
  * @return
  */
 protected function askDelete()
 {
     global $tpl;
     include_once './Services/Utilities/classes/class.ilConfirmationGUI.php';
     $this->ctrl->saveParameter($this, array('seed', 'app_id', 'dt', 'idate'));
     $confirm = new ilConfirmationGUI();
     $confirm->setFormAction($this->ctrl->getFormAction($this));
     $confirm->setHeaderText($this->lng->txt('cal_delete_app_sure'));
     $confirm->setCancel($this->lng->txt('cancel'), 'cancel');
     $confirm->addItem('appointments[]', $this->app->getEntryId(), $this->app->getTitle());
     include_once './Services/Calendar/classes/class.ilCalendarRecurrences.php';
     if (sizeof(ilCalendarRecurrences::_getRecurrences($_GET['app_id'])) && !$this->app->isMilestone()) {
         $confirm->addButton($this->lng->txt('cal_delete_single'), 'deleteexclude');
         $confirm->setConfirm($this->lng->txt('cal_delete_recurrences'), 'delete');
     } else {
         $confirm->setConfirm($this->lng->txt('delete'), 'delete');
     }
     $tpl->setContent($confirm->getHTML());
 }
 /**
  * update GroupObject
  * @param bool update group type
  * @access public
  */
 public function updateObject()
 {
     global $ilErr;
     $this->checkPermission('write');
     $this->initForm();
     $this->form->checkInput();
     $old_type = $this->object->getGroupType();
     $this->load();
     $ilErr->setMessage('');
     if (!$this->object->validate()) {
         $err = $this->lng->txt('err_check_input');
         ilUtil::sendFailure($err);
         $err = $ilErr->getMessage();
         ilUtil::sendInfo($err);
         $this->editObject();
         return true;
     }
     $modified = false;
     if ($this->object->isGroupTypeModified($old_type) and !$update_group_type) {
         $modified = true;
         $this->object->setGroupType($old_type);
     }
     $this->object->update();
     include_once './Services/Object/classes/class.ilObjectServiceSettingsGUI.php';
     ilObjectServiceSettingsGUI::updateServiceSettingsForm($this->object->getId(), $this->form, array(ilObjectServiceSettingsGUI::CALENDAR_VISIBILITY, ilObjectServiceSettingsGUI::NEWS_VISIBILITY));
     // Save sorting
     include_once './Services/Container/classes/class.ilContainerSortingSettings.php';
     $sort = new ilContainerSortingSettings($this->object->getId());
     $sort->setSortMode((int) $_POST['sor']);
     $sort->update();
     // BEGIN ChangeEvents: Record update Object.
     require_once 'Services/Tracking/classes/class.ilChangeEvent.php';
     global $ilUser;
     ilChangeEvent::_recordWriteEvent($this->object->getId(), $ilUser->getId(), 'update');
     ilChangeEvent::_catchupWriteEvents($this->object->getId(), $ilUser->getId());
     // END PATCH ChangeEvents: Record update Object.
     // Update ecs export settings
     include_once 'Modules/Group/classes/class.ilECSGroupSettings.php';
     $ecs = new ilECSGroupSettings($this->object);
     $ecs->handleSettingsUpdate();
     if ($modified) {
         include_once './Services/Utilities/classes/class.ilConfirmationGUI.php';
         ilUtil::sendQuestion($this->lng->txt('grp_warn_grp_type_changed'));
         $confirm = new ilConfirmationGUI();
         $confirm->setFormAction($this->ctrl->getFormAction($this));
         $confirm->addItem('grp_type', $this->object->getGroupType(), $this->lng->txt('grp_info_new_grp_type') . ': ' . ($this->object->getGroupType() == GRP_TYPE_CLOSED ? $this->lng->txt('il_grp_status_open') : $this->lng->txt('il_grp_status_closed')));
         $confirm->addButton($this->lng->txt('grp_change_type'), 'updateGroupType');
         $confirm->setCancel($this->lng->txt('cancel'), 'edit');
         $this->tpl->setContent($confirm->getHTML());
         return true;
     } else {
         ilUtil::sendSuccess($this->lng->txt("msg_obj_modified"), true);
         $this->ctrl->redirect($this, 'edit');
         return true;
     }
 }
 public function editStatistic($a_show_confirm_delete = false)
 {
     global $ilToolbar;
     if (!isset($_GET['booking_id'])) {
         ilUtil::sendInfo($this->lng->txt('paya_no_booking_id_given'));
         $this->showStatistics();
         return true;
     }
     include_once './Services/Utilities/classes/class.ilConfirmationGUI.php';
     $ilToolbar->addButton($this->lng->txt('back'), $this->ctrl->getLinkTarget($this, 'showStatistics'));
     $this->tpl->addBlockfile('ADM_CONTENT', 'adm_content', 'tpl.main_view.html', 'Services/Payment');
     $this->ctrl->setParameter($this, 'booking_id', (int) $_GET['booking_id']);
     $this->__initBookingObject();
     $bookings = $this->booking_obj->getBookings();
     $booking = $bookings[(int) $_GET['booking_id']];
     // confirm delete
     if ($a_show_confirm_delete) {
         $pobject_data = ilPaymentObject::_getObjectData($booking['pobject_id']);
         $tmp_obj = ilObject::_lookupTitle(ilObject::_lookupObjId($pobject_data['ref_id']));
         $type = ilObject::_lookupType(ilObject::_lookupObjId($pobject_data['ref_id']));
         $oConfirmationGUI = new ilConfirmationGUI();
         // set confirm/cancel commands
         $oConfirmationGUI->setFormAction($this->ctrl->getFormAction($this, "performDelete"));
         $oConfirmationGUI->setHeaderText($this->lng->txt("paya_sure_delete_stat"));
         $oConfirmationGUI->setCancel($this->lng->txt("cancel"), "editStatistic");
         if ($type == 'crs') {
             $oConfirmationGUI->addButton($this->lng->txt("confirm"), "performDeleteDeassignCrs");
         } else {
             $oConfirmationGUI->setConfirm($this->lng->txt("confirm"), "performDelete");
         }
         $oConfirmationGUI->addItem('booking_id', $_GET['booking_id'], $tmp_obj);
         $this->tpl->setVariable('CONFIRMATION', $oConfirmationGUI->getHTML());
         return true;
     }
     // get customer_obj
     $tmp_user = ilObjectFactory::getInstanceByObjId($booking['customer_id'], false);
     $oForm = new ilPropertyFormGUI();
     $oForm->setFormAction($this->ctrl->getFormAction($this));
     $oForm->setId('stat_form');
     $oForm->setTableWidth('50 %');
     if (is_object($tmp_user)) {
         $frm_user = $tmp_user->getFullname() . ' [' . $tmp_user->getLogin() . ']';
     } else {
         $frm_user = $this->lng->txt('user_deleted');
     }
     $oForm->setTitle($frm_user);
     $pObj = new ilPaymentObject($this->user_obj, $booking['pobject_id']);
     $tmp_obj = ilObject::_lookupTitle(ilObject::_lookupObjId($pObj->getRefId()));
     // object_title
     $oTitleGUI = new ilNonEditableValueGUI($this->lng->txt('title'));
     $oTitleGUI->setValue($tmp_obj != '' ? $tmp_obj : $this->lng->txt('object_deleted'));
     $oForm->addItem($oTitleGUI);
     // transaction
     $oTransactionGUI = new ilNonEditableValueGUI($this->lng->txt('paya_transaction'));
     $oTransactionGUI->setValue($booking['transaction']);
     $oForm->addItem($oTransactionGUI);
     //vendor
     $oVendorGUI = new ilNonEditableValueGUI($this->lng->txt('paya_vendor'));
     $tmp_vendor = ilObjectFactory::getInstanceByObjId($booking['b_vendor_id'], false);
     if (is_object($tmp_vendor)) {
         $frm_vendor = $tmp_vendor->getFullname() . ' [' . $tmp_vendor->getLogin() . ']';
     } else {
         $frm_vendor = $this->lng->txt('user_deleted');
     }
     $oVendorGUI->setValue($frm_vendor);
     $oForm->addItem($oVendorGUI);
     // paymethod
     $oPaymethodGUI = new ilNonEditableValueGUI($this->lng->txt('paya_pay_method'));
     $oPaymethodGUI->setValue(ilPayMethods::getStringByPaymethod($booking['b_pay_method']));
     $oForm->addItem($oPaymethodGUI);
     // order_date
     $oOrderdateGUI = new ilNonEditableValueGUI($this->lng->txt('paya_order_date'));
     $oOrderdateGUI->setValue(ilDatePresentation::formatDate(new ilDateTime($booking["order_date"], IL_CAL_UNIX)));
     $oForm->addItem($oOrderdateGUI);
     // duration
     $oDurationGUI = new ilNonEditableValueGUI($this->lng->txt('duration'));
     if ($booking['duration'] == 0 && $booking['access_enddate'] == NULL) {
         $frm_duration = $this->lng->txt("unlimited_duration");
     } else {
         if ($booking['duration'] > 0) {
             $frm_duration = $booking['duration'] . ' ' . $this->lng->txt('paya_months');
         }
         $frm_duration .= ilDatePresentation::formatDate(new ilDate($booking['access_startdate'], IL_CAL_DATETIME)) . ' - ' . ilDatePresentation::formatDate(new ilDate($booking['access_enddate'], IL_CAL_DATETIME));
     }
     $oDurationGUI->setValue($frm_duration);
     $oForm->addItem($oDurationGUI);
     // price
     $oPriceGUI = new ilNonEditableValueGUI($this->lng->txt('price_a'));
     $oPriceGUI->setValue($booking['price'] . ' ' . $booking['currency_unit']);
     $oForm->addItem($oPriceGUI);
     // payed
     $oPayedGUI = new ilSelectInputGUI();
     $payed_option = array(0 => $this->lng->txt('no'), 1 => $this->lng->txt('yes'));
     $oPayedGUI->setTitle($this->lng->txt('paya_payed'));
     $oPayedGUI->setOptions($payed_option);
     $oPayedGUI->setValue($booking['payed']);
     $oPayedGUI->setPostVar('payed');
     $oForm->addItem($oPayedGUI);
     // access
     $oAccessGUI = new ilSelectInputGUI();
     $access_option = array(0 => $this->lng->txt('no'), 1 => $this->lng->txt('yes'));
     $oAccessGUI->setTitle($this->lng->txt('paya_access'));
     $oAccessGUI->setOptions($access_option);
     $oAccessGUI->setValue($booking['access_granted']);
     $oAccessGUI->setPostVar('access');
     $oForm->addItem($oAccessGUI);
     $oForm->addCommandButton('updateStatistic', $this->lng->txt('save'));
     $oForm->addCommandButton('deleteStatistic', $this->lng->txt('delete'));
     $this->tpl->setVariable('FORM', $oForm->getHTML());
     /*	//Same output as in ilobjpaymentsettingsgui->statistics  
       	// show CUSTOMER_DATA if isset -> setting: save_user_address
       	if(ilPayMethods::isCustomerAddressEnabled($booking['b_pay_method']))
     		{
     			$oForm2 = new ilPropertyFormGUI();
     			$oForm2->setId('cust_form');
     			$oForm2->setTableWidth('50 %');		
     			$oForm2->setTitle($frm_user);		
     			
     			// email
     			$oEmailGUI = new ilNonEditableValueGUI($this->lng->txt('email'));
     			$email = (!isset($tmp_user)) ? $this->lng->txt('user_deleted') : $tmp_user->getEmail();
     			$oEmailGUI->setValue($email);
     			$oForm2->addItem($oEmailGUI);	
     
     			// street
     			$oStreetGUI = new ilNonEditableValueGUI($this->lng->txt('street'));
     			$oStreetGUI->setValue($booking['street']);
     			$oForm2->addItem($oStreetGUI);
     				
     			// pobox
     			$oPoBoxGUI = new ilNonEditableValueGUI($this->lng->txt('pay_bmf_po_box'));
     			$oPoBoxGUI->setValue($booking['po_box']);
     			$oForm2->addItem($oPoBoxGUI);	
     				
     			// zipcode
     			$oPoBoxGUI = new ilNonEditableValueGUI($this->lng->txt('zipcode'));
     			$oPoBoxGUI->setValue($booking['zipcode']);
     			$oForm2->addItem($oPoBoxGUI);
     					
     			// city
     			$oCityGUI = new ilNonEditableValueGUI($this->lng->txt('city'));
     			$oCityGUI->setValue($booking['city']);
     			$oForm2->addItem($oCityGUI);	
     			
     			// country
     			$oCountryGUI = new ilNonEditableValueGUI($this->lng->txt('country'));
     			$oCountryGUI->setValue($booking['country']);
     			$oForm2->addItem($oCountryGUI);	
     		}
     		
     		$this->tpl->setVariable('FORM_2',$oForm2->getHTML());
     */
     return true;
 }
 /**
  * Shows confirmation view for deleting multiple smilies
  * Prepares confirmation view for deleting multiple smilies and displays it.
  */
 public function deleteMultipleObject()
 {
     /**
      * @var $rbacsystem ilRbacSystem
      * @var $lng ilLanguage
      * @var $ilCtrl ilCtrl
      * @var $tpl ilTemplate
      */
     global $rbacsystem, $lng, $ilCtrl, $tpl;
     $this->gui->switchToVisibleMode();
     if (!$rbacsystem->checkAccess('write', $this->gui->ref_id)) {
         $this->ilias->raiseError($this->lng->txt('msg_no_perm_write'), $this->ilias->error_obj->MESSAGE);
     }
     $items = (array) $_REQUEST['smiley_id'];
     if (count($items) == 0) {
         ilUtil::sendInfo($lng->txt('select_one'), true);
         $ilCtrl->redirect($this->gui, 'smiley');
     }
     include_once 'Modules/Chatroom/classes/class.ilChatroomSmilies.php';
     $smilies = ilChatroomSmilies::_getSmiliesById($items);
     if (count($smilies) == 0) {
         ilUtil::sendInfo($lng->txt('select_one'), true);
         $ilCtrl->redirect($this->gui, 'smiley');
     }
     require_once 'Services/Utilities/classes/class.ilConfirmationGUI.php';
     $confirmation = new ilConfirmationGUI();
     $confirmation->setFormAction($ilCtrl->getFormAction($this->gui, 'smiley'));
     $confirmation->setHeaderText($lng->txt('chatroom_confirm_delete_smiley'));
     $confirmation->addButton($lng->txt('confirm'), 'smiley-confirmedDeleteMultipleObject');
     $confirmation->addButton($lng->txt('cancel'), 'smiley');
     foreach ($smilies as $s) {
         $confirmation->addItem('sel_ids[]', $s['smiley_id'], ilUtil::img($s['smiley_fullpath'], $s['smiley_keywords']) . ' ' . $s['smiley_keywords']);
     }
     $tpl->setContent($confirmation->getHTML());
 }