Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
grant_program
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Extensions
grant_program
Commits
bb568145
Commit
bb568145
authored
11 years ago
by
Mayur Jadhav
Browse files
Options
Downloads
Patches
Plain Diff
Worked on RG-163
parent
8038bf27
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CRM/Grant/Info.php
+82
-82
82 additions, 82 deletions
CRM/Grant/Info.php
CRM/Grant/PaymentTask.php
+106
-106
106 additions, 106 deletions
CRM/Grant/PaymentTask.php
with
188 additions
and
188 deletions
CRM/Grant/Info.php
+
82
−
82
View file @
bb568145
...
...
@@ -2,7 +2,7 @@
/*
+--------------------------------------------------------------------+
| CiviCRM version 4.
1
|
| CiviCRM version 4.
3
|
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2011 |
+--------------------------------------------------------------------+
...
...
@@ -25,9 +25,6 @@
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
*/
require_once
'CRM/Core/Component/Info.php'
;
/**
* This class introduces component to the system and provides all the
* information about it. It needs to extend CRM_Core_Component_Info
...
...
@@ -38,88 +35,91 @@ require_once 'CRM/Core/Component/Info.php';
* $Id$
*
*/
class
CRM_Grant_Info
extends
CRM_Core_Component_Info
{
// docs inherited from interface
protected
$keyword
=
'grant'
;
// docs inherited from interface
public
function
getInfo
()
{
return
array
(
'name'
=>
'CiviGrant'
,
'translatedName'
=>
ts
(
'CiviGrant'
),
'title'
=>
'CiviCRM Grant Management Engine'
,
'path'
=>
'CRM_Grant_'
,
'search'
=>
1
,
'showActivitiesInCore'
=>
1
);
}
class
CRM_Grant_Info
extends
CRM_Core_Component_Info
{
// docs inherited from interface
protected
$keyword
=
'grant'
;
// docs inherited from interface
public
function
getInfo
()
{
return
array
(
'name'
=>
'CiviGrant'
,
'translatedName'
=>
ts
(
'CiviGrant'
),
'title'
=>
'CiviCRM Grant Management Engine'
,
'path'
=>
'CRM_Grant_'
,
'search'
=>
1
,
'showActivitiesInCore'
=>
1
);
}
// docs inherited from interface
public
function
getPermissions
()
{
return
array
(
'access CiviGrant'
,
'edit grants'
,
'edit grant program'
,
'delete in CiviGrant'
,
'administer CiviGrant'
);
}
// docs inherited from interface
public
function
getUserDashboardElement
()
{
// no dashboard element for this component
return
null
;
}
// docs inherited from interface
public
function
getPermissions
()
{
return
array
(
'access CiviGrant'
,
'edit grants'
,
'edit grant program'
,
'delete in CiviGrant'
,
'administer CiviGrant'
);
}
// docs inherited from interface
public
function
getUserDashboardElement
()
{
// no dashboard element for this component
return
null
;
}
// docs inherited from interface
public
function
getUserDashboardObject
()
{
// no dashboard element for this component
return
null
;
}
// docs inherited from interface
public
function
getUserDashboardObject
()
{
// no dashboard element for this component
return
null
;
}
// docs inherited from interface
public
function
registerTab
()
{
return
array
(
'title'
=>
ts
(
'Grants'
),
'url'
=>
'grant'
,
'weight'
=>
50
);
}
// docs inherited from interface
public
function
registerAdvancedSearchPane
()
{
return
array
(
'title'
=>
ts
(
'Grants'
),
'weight'
=>
50
);
}
// docs inherited from interface
public
function
getActivityTypes
()
{
return
null
;
}
// docs inherited from interface
public
function
registerTab
()
{
return
array
(
'title'
=>
ts
(
'Grants'
),
'url'
=>
'grant'
,
'weight'
=>
50
);
}
// docs inherited from interface
public
function
registerAdvancedSearchPane
()
{
return
array
(
'title'
=>
ts
(
'Grants'
),
'weight'
=>
50
);
}
// docs inherited from interface
public
function
getActivityTypes
()
{
return
null
;
// add shortcut to Create New
public
function
creatNewShortcut
(
&
$shortCuts
)
{
if
(
CRM_Core_Permission
::
check
(
'access CiviGrant'
)
&&
CRM_Core_Permission
::
check
(
'edit grants'
))
{
$shortCuts
=
array_merge
(
$shortCuts
,
array
(
array
(
'path'
=>
'civicrm/grant/add'
,
'query'
=>
"reset=1&action=add&context=standalone"
,
'ref'
=>
'new-grant'
,
'title'
=>
ts
(
'Grant'
))
)
);
}
// add shortcut to Create New
public
function
creatNewShortcut
(
&
$shortCuts
)
{
if
(
CRM_Core_Permission
::
check
(
'access CiviGrant'
)
&&
CRM_Core_Permission
::
check
(
'edit grants'
)
)
{
$shortCuts
=
array_merge
(
$shortCuts
,
array
(
array
(
'path'
=>
'civicrm/grant/add'
,
'query'
=>
"reset=1&action=add&context=standalone"
,
'ref'
=>
'new-grant'
,
'title'
=>
ts
(
'Grant'
)
)
));
}
if
(
CRM_Core_Permission
::
check
(
'access CiviGrant'
)
&&
CRM_Core_Permission
::
check
(
'edit grant program'
)
)
{
$shortCuts
=
array_merge
(
$shortCuts
,
array
(
array
(
'path'
=>
'civicrm/grant_program'
,
'query'
=>
"reset=1&action=browse&id=1"
,
'ref'
=>
'new-grant program'
,
'title'
=>
ts
(
'Grant Program'
)
)
));
}
if
(
CRM_Core_Permission
::
check
(
'access CiviGrant'
)
&&
CRM_Core_Permission
::
check
(
'edit grant program'
))
{
$shortCuts
=
array_merge
(
$shortCuts
,
array
(
array
(
'path'
=>
'civicrm/grant_program'
,
'query'
=>
"reset=1&action=browse&id=1"
,
'ref'
=>
'new-grant program'
,
'title'
=>
ts
(
'Grant Program'
))
)
);
}
}
}
This diff is collapsed.
Click to expand it.
CRM/Grant/PaymentTask.php
+
106
−
106
View file @
bb568145
...
...
@@ -2,7 +2,7 @@
/*
+--------------------------------------------------------------------+
| CiviCRM version 4.
1
|
| CiviCRM version 4.
3
|
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2011 |
+--------------------------------------------------------------------+
...
...
@@ -39,116 +39,116 @@
* used by the search forms
*
*/
class
CRM_Grant_PaymentTask
{
const
CANCEL_PAYMENTS
=
1
,
REPRINT_PAYMENTS
=
2
;
/**
* the task array
*
* @var array
* @static
*/
static
$_tasks
=
null
;
/**
* the optional task array
*
* @var array
* @static
*/
static
$_optionalTasks
=
null
;
/**
* These tasks are the core set of tasks that the user can perform
* on a contact / group of contacts
*
* @return array the set of tasks for a group of contacts
* @static
* @access public
*/
static
function
&
tasks
(
)
{
if
(
!
(
self
::
$_tasks
)
)
{
self
::
$_tasks
=
array
(
1
=>
array
(
'title'
=>
ts
(
'Cancel Payments'
),
'class'
=>
'CRM_Grant_Form_Task_Cancel'
,
'result'
=>
false
),
2
=>
array
(
'title'
=>
ts
(
'Reprint Payments'
),
'class'
=>
'CRM_Grant_Form_Task_Reprint'
,
'result'
=>
false
),
);
}
if
(
!
CRM_Core_Permission
::
check
(
'cancel payments in CiviGrant'
)
)
{
unset
(
self
::
$_tasks
[
1
]
);
}
if
(
!
CRM_Core_Permission
::
check
(
'edit payments in CiviGrant'
)
&&
!
CRM_Core_Permission
::
check
(
'create payments in CiviGrant'
))
{
unset
(
self
::
$_tasks
[
2
]
);
}
require_once
'CRM/Utils/Hook.php'
;
CRM_Utils_Hook
::
searchTasks
(
'grant'
,
self
::
$_tasks
);
asort
(
self
::
$_tasks
);
return
self
::
$_tasks
;
class
CRM_Grant_PaymentTask
{
const
CANCEL_PAYMENTS
=
1
,
REPRINT_PAYMENTS
=
2
;
/**
* the task array
*
* @var array
* @static
*/
static
$_tasks
=
NULL
;
/**
* the optional task array
*
* @var array
* @static
*/
static
$_optionalTasks
=
NULL
;
/**
* These tasks are the core set of tasks that the user can perform
* on a contact / group of contacts
*
* @return array the set of tasks for a group of contacts
* @static
* @access public
*/
static
function
&
tasks
()
{
if
(
!
(
self
::
$_tasks
))
{
self
::
$_tasks
=
array
(
1
=>
array
(
'title'
=>
ts
(
'Cancel Payments'
),
'class'
=>
'CRM_Grant_Form_Task_Cancel'
,
'result'
=>
FALSE
),
2
=>
array
(
'title'
=>
ts
(
'Reprint Payments'
),
'class'
=>
'CRM_Grant_Form_Task_Reprint'
,
'result'
=>
false
),
);
}
/**
* These tasks are the core set of task titles
*
* @return array the set of task titles
* @static
* @access public
*/
static
function
&
taskTitles
(
)
{
self
::
tasks
(
);
$titles
=
array
(
);
foreach
(
self
::
$_tasks
as
$id
=>
$value
)
{
$titles
[
$id
]
=
$value
[
'title'
];
}
return
$titles
;
if
(
!
CRM_Core_Permission
::
check
(
'cancel payments in CiviGrant'
))
{
unset
(
self
::
$_tasks
[
1
]);
}
/**
* show tasks selectively based on the permission level
* of the user
*
* @param int $permission
*
* @return array set of tasks that are valid for the user
* @access public
*/
static
function
&
permissionedTaskTitles
(
$permission
)
{
$tasks
=
array
(
);
if
(
(
$permission
==
CRM_Core_Permission
::
EDIT
)
||
CRM_Core_Permission
::
check
(
'edit payments in CiviGrant'
)
)
{
$tasks
=
self
::
taskTitles
(
);
}
else
{
$tasks
=
array
(
3
=>
self
::
$_tasks
[
3
][
'title'
]
);
//CRM-4418,
if
(
CRM_Core_Permission
::
check
(
'cancel payments in CiviGrant'
)
)
{
$tasks
[
1
]
=
self
::
$_tasks
[
1
][
'title'
];
}
}
return
$tasks
;
if
(
!
CRM_Core_Permission
::
check
(
'edit payments in CiviGrant'
)
&&
!
CRM_Core_Permission
::
check
(
'create payments in CiviGrant'
))
{
unset
(
self
::
$_tasks
[
2
]);
}
/**
* These tasks are the core set of tasks that the user can perform
*
* @param int $value
*
* @return array the set of tasks for a group of contacts
* @static
* @access public
*/
static
function
getTask
(
$value
)
{
require_once
'CRM/Utils/Hook.php'
;
CRM_Utils_Hook
::
searchTasks
(
'grant'
,
self
::
$_tasks
);
asort
(
self
::
$_tasks
);
return
self
::
$_tasks
;
}
/**
* These tasks are the core set of task titles
*
* @return array the set of task titles
* @static
* @access public
*/
static
function
&
taskTitles
()
self
::
tasks
(
);
$titles
=
array
(
);
foreach
(
self
::
$_tasks
as
$id
=>
$value
)
{
$titles
[
$id
]
=
$value
[
'title'
];
}
return
$titles
;
}
/**
* show tasks selectively based on the permission level
* of the user
*
* @param int $permission
*
* @return array set of tasks that are valid for the user
* @access public
*/
static
function
&
permissionedTaskTitles
(
$permission
)
{
$tasks
=
array
(
);
if
((
$permission
==
CRM_Core_Permission
::
EDIT
)
||
CRM_Core_Permission
::
check
(
'edit payments in CiviGrant'
))
{
$tasks
=
self
::
taskTitles
();
}
else
{
$tasks
=
array
(
3
=>
self
::
$_tasks
[
3
][
'title'
]);
//CRM-4418,
if
(
CRM_Core_Permission
::
check
(
'cancel payments in CiviGrant'
))
{
$tasks
[
1
]
=
self
::
$_tasks
[
1
][
'title'
];
}
}
return
$tasks
;
}
/**
* These tasks are the core set of tasks that the user can perform
*
* @param int $value
*
* @return array the set of tasks for a group of contacts
* @static
* @access public
*/
static
function
getTask
(
$value
)
{
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment