ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilPaymentTrusteeGUI Class Reference
+ Inheritance diagram for ilPaymentTrusteeGUI:
+ Collaboration diagram for ilPaymentTrusteeGUI:

Public Member Functions

 ilPaymentTrusteeGUI ($user_obj)
 executeCommand ()
 cancelDelete ()
 showTrustees ($a_show_delete=false)
 deleteTrustee ()
 performDeleteTrustee ()
 update ()
 searchUser ()
 newSearch ()
 performSearch ()
 addTrustee ()
 addUser ()
 __search ($a_search_string)
 __showSearchUserTable ($a_result_set)
 __showTrusteesTable ($a_result_set)
- Public Member Functions inherited from ilShopBaseGUI
 __construct ()

Data Fields

 $trustee_obj = null
 $user_obj
 $ctrl

Protected Member Functions

 prepareOutput ()
- Protected Member Functions inherited from ilShopBaseGUI
 addPager ($result, $a_session_key)
 buildSubTabs ()
 setSection ($a_section)
 getSection ()
 setSubSection ($a_sub_section)
 getSubSection ()
 showButton ($a_cmd, $a_text, $a_target= '')
 initTableGUI ()
 setTableGUIBasicData ($tbl, $result_set, $a_default_order_column= '')

Additional Inherited Members

- Protected Attributes inherited from ilShopBaseGUI
 $ctrl = null
 $ilias = null
 $lng = null
 $tpl = null
 $oGeneralSettings = null
 $section = 0
 $sub_section = 0

Detailed Description

Definition at line 33 of file class.ilPaymentTrusteeGUI.php.

Member Function Documentation

ilPaymentTrusteeGUI::__search (   $a_search_string)

Definition at line 386 of file class.ilPaymentTrusteeGUI.php.

References ilUtil\sendInfo(), ilSearch\setPerformUpdate(), and ilUtil\stripSlashes().

Referenced by performSearch().

{
include_once("./classes/class.ilSearch.php");
$this->lng->loadLanguageModule("content");
$search =& new ilSearch($this->user_obj->getId());
$search->setPerformUpdate(false);
$search->setSearchString(ilUtil::stripSlashes($a_search_string));
$search->setCombination("and");
$search->setSearchFor(array(0 => 'usr'));
$search->setSearchType('new');
if($search->validate($message))
{
$search->performSearch();
}
else
{
ilUtil::sendInfo($message,true);
$this->ctrl->redirect($this,"searchUser");
}
return $search->getResultByType('usr');
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilPaymentTrusteeGUI::__showSearchUserTable (   $a_result_set)

Definition at line 410 of file class.ilPaymentTrusteeGUI.php.

References $_GET, ilShopBaseGUI\$tpl, ilUtil\getImagePath(), ilShopBaseGUI\initTableGUI(), and ilShopBaseGUI\setTableGUIBasicData().

Referenced by performSearch().

{
$tbl =& $this->initTableGUI();
$tpl =& $tbl->getTemplateObject();
// SET FORMACTION
$tpl->setCurrentBlock("tbl_form_header");
$tpl->setVariable("FORMACTION",$this->ctrl->getFormAction($this));
$tpl->parseCurrentBlock();
$tpl->setCurrentBlock("tbl_action_btn");
$tpl->setVariable("BTN_NAME","addTrustee");
$tpl->setVariable("BTN_VALUE",$this->lng->txt("add"));
$tpl->parseCurrentBlock();
$tpl->setCurrentBlock("tbl_action_btn");
$tpl->setVariable("BTN_NAME","showTrustees");
$tpl->setVariable("BTN_VALUE",$this->lng->txt("cancel"));
$tpl->parseCurrentBlock();
$tpl->setCurrentBlock("tbl_action_row");
$tpl->setVariable("COLUMN_COUNTS",5);
$tpl->setVariable("IMG_ARROW",ilUtil::getImagePath("arrow_downright.gif"));
$tpl->parseCurrentBlock();
$tbl->setTitle($this->lng->txt("paya_trustee_table"),"icon_usr.gif",$this->lng->txt("crs_header_edit_members"));
$tbl->setHeaderNames(array("",
$this->lng->txt("login"),
$this->lng->txt("firstname"),
$this->lng->txt("lastname")));
$tbl->setHeaderVars(array("",
"login",
"firstname",
"lastname"),
array("cmd" => 'performSearch',
"cmdClass" => "ilpaymenttrusteegui",
"cmdNode" => $_GET["cmdNode"],
'baseClass' => 'ilShopController'));
$tbl->setColumnWidth(array("3%","32%","32%","32%"));
$this->setTableGUIBasicData($tbl,$a_result_set);
$tbl->render();
$this->tpl->setVariable("SEARCH_RESULT_TABLE",$tbl->tpl->get());
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilPaymentTrusteeGUI::__showTrusteesTable (   $a_result_set)

Definition at line 460 of file class.ilPaymentTrusteeGUI.php.

References $_GET, $_SESSION, ilShopBaseGUI\$tpl, ilUtil\getImagePath(), ilShopBaseGUI\initTableGUI(), and ilShopBaseGUI\setTableGUIBasicData().

Referenced by showTrustees().

{
$tbl =& $this->initTableGUI();
$tpl =& $tbl->getTemplateObject();
// SET FORMAACTION
$tpl->setCurrentBlock("tbl_form_header");
$tpl->setVariable("FORMACTION",$this->ctrl->getFormAction($this));
$tpl->parseCurrentBlock();
$tpl->setCurrentBlock("tbl_action_row");
/* $tpl->setCurrentBlock("input_text");
$tpl->setVariable("PB_TXT_NAME",'trustee_login');
$tpl->parseCurrentBlock();
$tpl->setCurrentBlock("plain_button");
$tpl->setVariable("PBTN_NAME","addUser");
$tpl->setVariable("PBTN_VALUE",$this->lng->txt("crs_add_member"));
$tpl->parseCurrentBlock();*/
$tpl->setCurrentBlock("input_text");
$tpl->setVariable("PB_TXT_NAME",'search_str');
$tpl->setVariable("PB_TXT_VALUE",$_SESSION["paya_search_str"]);
$tpl->parseCurrentBlock();
$tpl->setCurrentBlock("plain_button");
$tpl->setVariable("PBTN_NAME","newSearch");
$tpl->setVariable("PBTN_VALUE",$this->lng->txt("crs_add_member"));
$tpl->parseCurrentBlock();
$tpl->setCurrentBlock("plain_button");
$tpl->setVariable("PBTN_NAME","update");
$tpl->setVariable("PBTN_VALUE",$this->lng->txt("apply"));
$tpl->parseCurrentBlock();
$tpl->setCurrentBlock("plain_buttons");
$tpl->parseCurrentBlock();
$tpl->setVariable("COLUMN_COUNTS",8);
$tpl->setVariable("IMG_ARROW", ilUtil::getImagePath("arrow_downright.gif"));
$tpl->setCurrentBlock("tbl_action_button");
$tpl->setVariable("BTN_NAME","deleteTrustee");
$tpl->setVariable("BTN_VALUE",$this->lng->txt("delete"));
$tpl->parseCurrentBlock();
$tpl->setCurrentBlock("tbl_action_row");
$tpl->setVariable("TPLPATH",$this->tpl->tplPath);
$tpl->parseCurrentBlock();
$tbl->setTitle($this->lng->txt("paya_trustee_table"),"icon_usr.gif",$this->lng->txt("paya_trustee_table"));
$tbl->setHeaderNames(array('',
$this->lng->txt("login"),
$this->lng->txt("firstname"),
$this->lng->txt("lastname"),
$this->lng->txt("paya_perm_stat"),
$this->lng->txt("paya_perm_obj"),
$this->lng->txt("paya_perm_coupons"),
''));
$tbl->setHeaderVars(array("",
"login",
"firstname",
"lastname",
"perm_stat",
"perm_obj",
"perm_coupons",
"options"),
array("cmd" => "showTrustees",
"cmdClass" => "ilpaymenttrusteegui",
"cmdNode" => $_GET["cmdNode"],
'baseClass' => 'ilShopController'));
$tbl->setColumnWidth(array("4%","15%","15%","15%","15%","15%","15%","15%"));
$this->setTableGUIBasicData($tbl,$a_result_set);
$tbl->render();
$this->tpl->setVariable("TRUSTEE_TABLE",$tbl->tpl->get());
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilPaymentTrusteeGUI::addTrustee ( )

Definition at line 288 of file class.ilPaymentTrusteeGUI.php.

References $_POST, performSearch(), ilUtil\sendInfo(), and showTrustees().

{
if(!is_array($_POST["user"]))
{
ilUtil::sendInfo($this->lng->txt("crs_no_users_selected"));
$this->performSearch();
# $this->showTrustees();
return false;
}
if(in_array($this->user_obj->getId(),$_POST['user']))
{
ilUtil::sendInfo($this->lng->txt('paya_not_assign_yourself'));
# $this->performSearch();
$this->showTrustees();
return false;
}
// add them
$counter = 0;
foreach($_POST['user'] as $user_id)
{
if($this->trustee_obj->isTrustee($user_id))
{
continue;
}
$this->trustee_obj->setTrusteeId($user_id);
$this->trustee_obj->toggleStatisticPermission(false);
$this->trustee_obj->toggleObjectPermission(true);
$this->trustee_obj->toggleCouponsPermission(true);
$this->trustee_obj->add();
++$counter;
}
if($counter)
{
ilUtil::sendInfo($this->lng->txt('paya_added_trustee'));
$this->showTrustees();
return true;
}
else
{
ilUtil::sendInfo($this->lng->txt('paya_user_already_assigned'));
$this->performSearch();
return false;
}
}

+ Here is the call graph for this function:

ilPaymentTrusteeGUI::addUser ( )

Definition at line 340 of file class.ilPaymentTrusteeGUI.php.

References $_POST, ilObjUser\getUserIdByLogin(), ilUtil\sendInfo(), and showTrustees().

{
if(!$_POST['trustee_login'])
{
ilUtil::sendInfo($this->lng->txt('paya_enter_login'));
$this->showTrustees();
return false;
}
if(!$user_id = ilObjUser::getUserIdByLogin($_POST['trustee_login']))
{
ilUtil::sendInfo($this->lng->txt('paya_no_valid_login'));
$this->showTrustees();
return false;
}
if($this->trustee_obj->isTrustee($user_id))
{
ilUtil::sendInfo($this->lng->txt('paya_user_already_assigned'));
$this->showTrustees();
return false;
}
if($user_id == $this->user_obj->getId())
{
ilUtil::sendInfo($this->lng->txt('paya_not_assign_yourself'));
$this->showTrustees();
return false;
}
// checks passed => add trustee
$this->trustee_obj->setTrusteeId($user_id);
$this->trustee_obj->toggleObjectPermission(false);
$this->trustee_obj->toggleStatisticPermission(true);
$this->trustee_obj->toggleCouponsPermission(true);
$this->trustee_obj->add();
ilUtil::sendInfo($this->lng->txt('paya_added_trustee'));
$this->showTrustees();
return true;
}

+ Here is the call graph for this function:

ilPaymentTrusteeGUI::cancelDelete ( )

Definition at line 80 of file class.ilPaymentTrusteeGUI.php.

References $_SESSION, and showTrustees().

{
unset($_SESSION['paya_delete_trustee']);
$this->showTrustees();
return true;
}

+ Here is the call graph for this function:

ilPaymentTrusteeGUI::deleteTrustee ( )

Definition at line 170 of file class.ilPaymentTrusteeGUI.php.

References $_POST, $_SESSION, ilUtil\sendInfo(), and showTrustees().

{
if(!is_array($_POST['trustee']))
{
ilUtil::sendInfo($this->lng->txt('crs_no_users_selected'));
$this->showTrustees();
return true;
}
$_SESSION['paya_delete_trustee'] = $_POST['trustee'];
$this->showTrustees(true);
return true;
}

+ Here is the call graph for this function:

ilPaymentTrusteeGUI::executeCommand ( )

Definition at line 62 of file class.ilPaymentTrusteeGUI.php.

References $cmd, and prepareOutput().

{
global $tree;
$cmd = $this->ctrl->getCmd();
switch ($this->ctrl->getNextClass($this))
{
default:
if(!$cmd = $this->ctrl->getCmd())
{
$cmd = 'showTrustees';
}
$this->prepareOutput();
$this->$cmd();
break;
}
}

+ Here is the call graph for this function:

ilPaymentTrusteeGUI::ilPaymentTrusteeGUI (   $user_obj)

Definition at line 39 of file class.ilPaymentTrusteeGUI.php.

References $user_obj, and ilShopBaseGUI\__construct().

{
$this->user_obj = $user_obj;
$this->trustee_obj = new ilPaymentTrustees($this->user_obj);
$this->lng->loadLanguageModule('crs');
$this->ctrl->saveParameter($this, 'baseClass');
}

+ Here is the call graph for this function:

ilPaymentTrusteeGUI::newSearch ( )

Definition at line 237 of file class.ilPaymentTrusteeGUI.php.

References $_POST, $_SESSION, and performSearch().

{
$_SESSION["paya_search_str"] = $_POST["search_str"];
$this->performSearch();
}

+ Here is the call graph for this function:

ilPaymentTrusteeGUI::performDeleteTrustee ( )

Definition at line 185 of file class.ilPaymentTrusteeGUI.php.

References $_SESSION, ilUtil\sendInfo(), and showTrustees().

{
if(is_array($_SESSION['paya_delete_trustee']))
{
foreach($_SESSION['paya_delete_trustee'] as $id)
{
$this->trustee_obj->setTrusteeId($id);
$this->trustee_obj->delete();
}
}
unset($_SESSION['paya_delete_trustee']);
ilUtil::sendInfo($this->lng->txt('paya_delete_trustee_msg'));
$this->showTrustees();
return true;
}

+ Here is the call graph for this function:

ilPaymentTrusteeGUI::performSearch ( )

Definition at line 243 of file class.ilPaymentTrusteeGUI.php.

References $_POST, $_SESSION, $result, $user, __search(), __showSearchUserTable(), ilUtil\formCheckbox(), ilObjectFactory\getInstanceByObjId(), ilUtil\sendInfo(), ilShopBaseGUI\showButton(), showTrustees(), and ilUtil\stripSlashes().

Referenced by addTrustee(), and newSearch().

{
// SAVE it to allow sort in tables
$_SESSION["pays_search_str_trustee"] = $_POST["search_str"] = $_POST["search_str"] ? $_POST["search_str"] : $_SESSION["pays_search_str_trustee"];
if(!$_POST["search_str"])
{
ilUtil::sendInfo($this->lng->txt("crs_search_enter_search_string"));
# $this->searchUser();
$this->showTrustees();
return false;
}
if(!count($result = $this->__search(ilUtil::stripSlashes($_POST["search_str"]))))
{
ilUtil::sendInfo($this->lng->txt("crs_no_results_found"));
# $this->searchUser();
$this->showTrustees();
return false;
}
$this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.paya_usr_selection.html",'payment');
$this->showButton("searchUser",$this->lng->txt("back"));
$counter = 0;
$f_result = array();
foreach($result as $user)
{
if(!$tmp_obj = ilObjectFactory::getInstanceByObjId($user["id"],false))
{
continue;
}
$f_result[$counter][] = ilUtil::formCheckbox(0,"user[]",$user["id"]);
$f_result[$counter][] = $tmp_obj->getLogin();
$f_result[$counter][] = $tmp_obj->getFirstname();
$f_result[$counter][] = $tmp_obj->getLastname();
unset($tmp_obj);
++$counter;
}
$this->__showSearchUserTable($f_result);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilPaymentTrusteeGUI::prepareOutput ( )
protected

Reimplemented from ilShopBaseGUI.

Definition at line 50 of file class.ilPaymentTrusteeGUI.php.

References ilShopBaseGUI\setSection().

Referenced by executeCommand().

{
global $ilTabs;
$this->setSection(6);
$ilTabs->setTabActive('paya_header');
$ilTabs->setSubTabActive('paya_trustees');
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilPaymentTrusteeGUI::searchUser ( )

Definition at line 218 of file class.ilPaymentTrusteeGUI.php.

References $_SESSION, and ilShopBaseGUI\showButton().

{
$this->tpl->addBlockFile("ADM_CONTENT","adm_content","tpl.paya_user_search.html",'payment');
$this->showButton('showTrustees',$this->lng->txt('back'));
$this->lng->loadLanguageModule('search');
$this->tpl->setVariable("F_ACTION",$this->ctrl->getFormAction($this));
$this->tpl->setVariable("SEARCH_ASSIGN_USR",$this->lng->txt("crs_search_members"));
$this->tpl->setVariable("SEARCH_SEARCH_TERM",$this->lng->txt("search_search_term"));
$this->tpl->setVariable("SEARCH_VALUE",$_SESSION["pays_search_str_trustee"] ? $_SESSION["pays_search_str_trustee"] : "");
$this->tpl->setVariable("BTN2_VALUE",$this->lng->txt("cancel"));
$this->tpl->setVariable("BTN1_VALUE",$this->lng->txt("search"));
$this->tpl->setVariable("SEARCH","performSearch");
$this->tpl->setVariable("CANCEL","showTrustees");
return true;
}

+ Here is the call graph for this function:

ilPaymentTrusteeGUI::showTrustees (   $a_show_delete = false)

Definition at line 89 of file class.ilPaymentTrusteeGUI.php.

References $_SESSION, __showTrusteesTable(), ilUtil\formCheckbox(), formSelect(), ilObjectFactory\getInstanceByObjId(), ilUtil\sendInfo(), and ilShopBaseGUI\showButton().

Referenced by addTrustee(), addUser(), cancelDelete(), deleteTrustee(), performDeleteTrustee(), performSearch(), and update().

{
$_SESSION['paya_delete_trustee'] = $_SESSION['paya_delete_trustee'] ? $_SESSION['paya_delete_trustee'] : array();
$actions = array(0 => $this->lng->txt("paya_disabled"),
1 => $this->lng->txt("paya_enabled"));
$this->showButton('searchUser',$this->lng->txt('search_user'));
$this->tpl->addBlockfile('ADM_CONTENT','adm_content','tpl.paya_trustees.html','payment');
if($a_show_delete)
{
ilUtil::sendInfo($this->lng->txt('paya_sure_delete_selected_trustees'));
$this->tpl->setCurrentBlock("confirm_delete");
$this->tpl->setVariable("CONFIRM_FORMACTION",$this->ctrl->getFormAction($this));
$this->tpl->setVariable("TXT_CANCEL",$this->lng->txt('cancel'));
$this->tpl->setVariable("TXT_CONFIRM",$this->lng->txt('delete'));
$this->tpl->parseCurrentBlock();
}
if(!count($this->trustee_obj->getTrustees()))
{
ilUtil::sendInfo($this->lng->txt('paya_no_trustees'));
return true;
}
$counter = 0;
$f_result = array();
$img_mail = "<img src=\"".ilUtil::getImagePath("icon_pencil_b.gif")."\" alt=\"".
$this->lng->txt("crs_mem_send_mail").
"\" title=\"".$this->lng->txt("crs_mem_send_mail")."\" border=\"0\" vspace=\"0\"/>";
foreach($this->trustee_obj->getTrustees() as $trustee)
{
// GET USER OBJ
if($tmp_obj = ilObjectFactory::getInstanceByObjId($trustee['trustee_id'],false))
{
$f_result[$counter][] = ilUtil::formCheckbox(in_array($trustee['trustee_id'],$_SESSION['paya_delete_trustee']) ? 1 : 0,
"trustee[]",
$trustee['trustee_id']);
$f_result[$counter][] = $tmp_obj->getLogin();
$f_result[$counter][] = $tmp_obj->getFirstname();
$f_result[$counter][] = $tmp_obj->getLastname();
$f_result[$counter][] = ilUtil::formSelect((int) $trustee['perm_stat'],
'perm_stat['.$trustee['trustee_id'].']',
$actions,
false,
true);
$f_result[$counter][] = ilUtil::formSelect((int) $trustee['perm_obj'],
'perm_obj['.$trustee['trustee_id'].']',
$actions,
false,
true);
$f_result[$counter][] = ilUtil::formSelect((int) $trustee['perm_coupons'],
'perm_coupons['.$trustee['trustee_id'].']',
$actions,
false,
true);
# $link_mail = "<a target=\"_blank\" href=\"./ilias.php?baseClass=ilMailGUI&type=new&rcp_to=".
# $tmp_obj->getLogin()."\"".$img_mail."</a>";
$link_mail = "<div class=\"il_ContainerItemCommands\"><a class=\"il_ContainerItemCommand\" href=\"./ilias.php?baseClass=ilMailGUI&type=new&rcp_to=".
$tmp_obj->getLogin()."\">".$this->lng->txt("mail")."</a></div>";
$f_result[$counter][] = $link_mail;
unset($tmp_obj);
++$counter;
}
}
return $this->__showTrusteesTable($f_result);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilPaymentTrusteeGUI::update ( )

Definition at line 202 of file class.ilPaymentTrusteeGUI.php.

References $_POST, ilUtil\sendInfo(), and showTrustees().

{
foreach($this->trustee_obj->getTrustees() as $trustee)
{
$this->trustee_obj->setTrusteeId($trustee['trustee_id']);
$this->trustee_obj->toggleStatisticPermission($_POST['perm_stat']["$trustee[trustee_id]"]);
$this->trustee_obj->toggleObjectPermission($_POST['perm_obj']["$trustee[trustee_id]"]);
$this->trustee_obj->toggleCouponsPermission($_POST['perm_coupons']["$trustee[trustee_id]"]);
$this->trustee_obj->modify();
}
ilUtil::sendInfo($this->lng->txt('paya_updated_trustees'));
$this->showTrustees();
return true;
}

+ Here is the call graph for this function:

Field Documentation

ilPaymentTrusteeGUI::$ctrl

Definition at line 37 of file class.ilPaymentTrusteeGUI.php.

ilPaymentTrusteeGUI::$trustee_obj = null

Definition at line 35 of file class.ilPaymentTrusteeGUI.php.

ilPaymentTrusteeGUI::$user_obj

Definition at line 36 of file class.ilPaymentTrusteeGUI.php.

Referenced by ilPaymentTrusteeGUI().


The documentation for this class was generated from the following file: