39
39
Misc::setMessage("Sorry, you are not allowed to access this page.", Misc::MSG_ERROR);
40
40
$tpl->displayTemplate();exit;
42
43
if (@$_POST["cat"] == "new") {
43
$res = Customer::insertAccountManager();
44
$res = CRM::insertAccountManager();
44
45
Misc::mapMessages($res, array(
45
46
1 => array(ev_gettext('Thank you, the account manager was added successfully.'), Misc::MSG_INFO),
46
47
-1 => array(ev_gettext('An error occurred while trying to add the the account manager.'), Misc::MSG_ERROR),
48
49
} elseif (@$_POST["cat"] == "update") {
49
$res = Customer::updateAccountManager();
50
$res = CRM::updateAccountManager();
50
51
Misc::mapMessages($res, array(
51
52
1 => array(ev_gettext('Thank you, the account manager was updated successfully.'), Misc::MSG_INFO),
52
53
-1 => array(ev_gettext('An error occurred while trying to update the the account manager.'), Misc::MSG_ERROR),
54
55
} elseif (@$_POST["cat"] == "delete") {
55
Customer::removeAccountManager();
56
CRM::removeAccountManager();
56
57
} elseif (!empty($_GET['prj_id'])) {
57
58
$tpl->assign("info", array('cam_prj_id' => $_GET['prj_id']));
58
$tpl->assign('customers', Customer::getAssocList($_GET['prj_id']));
59
$crm = CRM::getInstance($_GET['prj_id']);
60
$tpl->assign('customers', $crm->getCustomerAssocList());
61
63
if (@$_GET["cat"] == "edit") {
62
$info = Customer::getAccountManagerDetails($_GET["id"]);
64
$info = CRM::getAccountManagerDetails($_GET["id"]);
63
65
if (!empty($_GET['prj_id'])) {
64
66
$info['cam_prj_id'] = $_GET['prj_id'];
66
$tpl->assign('customers', Customer::getAssocList($info['cam_prj_id']));
68
$tpl->assign('customers', CRM::getInstance($info['cam_prj_id'])->getCustomerAssocList());
69
$tpl->assign("user_options", User::getActiveAssocList($info['cam_prj_id'], User::getRoleID('Customer')));
67
70
$tpl->assign("info", $info);
70
$tpl->assign("list", Customer::getAccountManagerList());
73
$tpl->assign("list", CRM::getAccountManagerList());
71
74
if (!empty($_REQUEST['prj_id'])) {
72
75
$tpl->assign("user_options", User::getActiveAssocList($_REQUEST['prj_id'], User::getRoleID('Customer')));