~eventum-developers/eventum/trunk

« back to all changes in this revision

Viewing changes to htdocs/manage/account_managers.php

  • Committer: Bryan Alsdorf
  • Date: 2013-08-23 03:50:34 UTC
  • mto: (4033.1.168 eventum-skysql)
  • mto: This revision was merged to the branch mainline in revision 4660.
  • Revision ID: bryan@montyprogram.com-20130823035034-7f5r3pt1xg0xnnhk
Initial commit of CRM migration

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
    Misc::setMessage("Sorry, you are not allowed to access this page.", Misc::MSG_ERROR);
40
40
    $tpl->displayTemplate();exit;
41
41
}
 
42
 
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),
47
48
    ));
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),
53
54
    ));
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());
59
61
}
60
62
 
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'];
65
67
    }
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);
68
71
}
69
72
 
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')));
73
76
}