Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
CiviCRM Website
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
69
Issues
69
List
Boards
Labels
Service Desk
Milestones
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Marketing
CiviCRM Website
Commits
ee398d14
Commit
ee398d14
authored
Sep 21, 2017
by
bgm
Committed by
Aegir user
Sep 21, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upgrade org.civicrm.volunteer to 2.2.2-beta.
parent
a63d2f95
Changes
20
Show whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
199 additions
and
365 deletions
+199
-365
civiext/org.civicrm.volunteer/CRM/Volunteer/Angular.php
civiext/org.civicrm.volunteer/CRM/Volunteer/Angular.php
+40
-0
civiext/org.civicrm.volunteer/CRM/Volunteer/Angular/Tab/Event.php
...org.civicrm.volunteer/CRM/Volunteer/Angular/Tab/Event.php
+60
-0
civiext/org.civicrm.volunteer/CRM/Volunteer/Form/Manage.php
civiext/org.civicrm.volunteer/CRM/Volunteer/Form/Manage.php
+0
-114
civiext/org.civicrm.volunteer/CRM/Volunteer/Form/Volunteer.php
...xt/org.civicrm.volunteer/CRM/Volunteer/Form/Volunteer.php
+2
-141
civiext/org.civicrm.volunteer/CRM/Volunteer/Page/Angular.php
civiext/org.civicrm.volunteer/CRM/Volunteer/Page/Angular.php
+3
-11
civiext/org.civicrm.volunteer/CRM/Volunteer/Page/Backbone.php
...ext/org.civicrm.volunteer/CRM/Volunteer/Page/Backbone.php
+0
-4
civiext/org.civicrm.volunteer/ang/volunteer/Project.html
civiext/org.civicrm.volunteer/ang/volunteer/Project.html
+3
-3
civiext/org.civicrm.volunteer/ang/volunteer/Project.js
civiext/org.civicrm.volunteer/ang/volunteer/Project.js
+1
-0
civiext/org.civicrm.volunteer/css/volunteer_events.css
civiext/org.civicrm.volunteer/css/volunteer_events.css
+4
-1
civiext/org.civicrm.volunteer/info.xml
civiext/org.civicrm.volunteer/info.xml
+2
-2
civiext/org.civicrm.volunteer/js/CRM_Volunteer_Form_Volunteer.js
.../org.civicrm.volunteer/js/CRM_Volunteer_Form_Volunteer.js
+20
-32
civiext/org.civicrm.volunteer/templates/CRM/Volunteer/Form/Manage.tpl
...civicrm.volunteer/templates/CRM/Volunteer/Form/Manage.tpl
+0
-42
civiext/org.civicrm.volunteer/templates/CRM/Volunteer/Form/Volunteer.tpl
...icrm.volunteer/templates/CRM/Volunteer/Form/Volunteer.tpl
+0
-1
civiext/org.civicrm.volunteer/templates/CRM/Volunteer/Page/Angular.tpl
...ivicrm.volunteer/templates/CRM/Volunteer/Page/Angular.tpl
+0
-2
civiext/org.civicrm.volunteer/templates/CRM/Volunteer/Page/Backbone.tpl
...vicrm.volunteer/templates/CRM/Volunteer/Page/Backbone.tpl
+42
-0
civiext/org.civicrm.volunteer/templates/CRM/Volunteer/Page/Backbone/Assign.tpl
...olunteer/templates/CRM/Volunteer/Page/Backbone/Assign.tpl
+0
-0
civiext/org.civicrm.volunteer/templates/CRM/Volunteer/Page/Backbone/Define.hlp
...olunteer/templates/CRM/Volunteer/Page/Backbone/Define.hlp
+0
-0
civiext/org.civicrm.volunteer/templates/CRM/Volunteer/Page/Backbone/Define.tpl
...olunteer/templates/CRM/Volunteer/Page/Backbone/Define.tpl
+2
-2
civiext/org.civicrm.volunteer/templates/CRM/Volunteer/Page/Backbone/Search.tpl
...olunteer/templates/CRM/Volunteer/Page/Backbone/Search.tpl
+0
-0
civiext/org.civicrm.volunteer/volunteer.php
civiext/org.civicrm.volunteer/volunteer.php
+20
-10
No files found.
civiext/org.civicrm.volunteer/CRM/Volunteer/Angular.php
0 → 100644
View file @
ee398d14
<?php
class
CRM_Volunteer_Angular
{
private
static
$loaded
=
FALSE
;
/**
* @return boolean
*/
public
static
function
isLoaded
()
{
return
self
::
$loaded
;
}
/**
* Loads dependencies for CiviVolunteer Angular app.
*
* @param string $defaultRoute
* If the base page is loaded with no route, show this one.
*/
public
static
function
load
(
$defaultRoute
)
{
if
(
self
::
isLoaded
())
{
return
;
}
CRM_Core_Resources
::
singleton
()
->
addScriptFile
(
'civicrm'
,
'packages/jquery/plugins/jquery.notify.min.js'
,
10
,
'html-header'
);
$loader
=
new
\
Civi\Angular\AngularLoader
();
$loader
->
setModules
(
array
(
'volunteer'
));
$loader
->
setPageName
(
'civicrm/vol'
);
$loader
->
load
();
\
Civi
::
resources
()
->
addSetting
(
array
(
'crmApp'
=>
array
(
'defaultRoute'
=>
$defaultRoute
,
),
));
self
::
$loaded
=
TRUE
;
}
}
civiext/org.civicrm.volunteer/CRM/Volunteer/Angular/Tab/Event.php
0 → 100644
View file @
ee398d14
<?php
class
CRM_Volunteer_Angular_Tab_Event
extends
CRM_Core_Page
{
/**
* Initializes a placeholder volunteer project.
*
* Used in cases where no project yet exists for the event, to prepopulate the
* "create" form.
*
* @return \CRM_Volunteer_BAO_Project
*/
protected
static
function
initializeProject
(
$eventId
)
{
$project
=
new
CRM_Volunteer_BAO_Project
();
$project
->
id
=
0
;
$project
->
entity_id
=
$eventId
;
$project
->
entity_table
=
CRM_Event_DAO_Event
::
$_tableName
;
return
$project
;
}
/**
* Sets the stage for the CiviVolunteer Angular app to be loaded in a tab.
*
* Called from hook_civicrm_tabset().
*
* @param int|string $eventId
*/
public
static
function
prepareTab
(
$eventId
)
{
CRM_Core_Region
::
instance
(
'page-footer'
)
->
add
(
array
(
'template'
=>
'CRM/Volunteer/Page/Angular.tpl'
,
));
$project
=
current
(
CRM_Volunteer_BAO_Project
::
retrieve
(
array
(
'entity_id'
=>
$eventId
,
'entity_table'
=>
CRM_Event_DAO_Event
::
$_tableName
,
)));
if
(
!
$project
)
{
$project
=
self
::
initializeProject
(
$eventId
);
}
CRM_Volunteer_Angular
::
load
(
'/volunteer/manage/'
.
$project
->
id
);
$event
=
$project
->
getEntityAttributes
();
$entityTitle
=
$event
[
'title'
];
CRM_Core_Resources
::
singleton
()
->
addStyleFile
(
'org.civicrm.volunteer'
,
'css/volunteer_app.css'
)
->
addStyleFile
(
'org.civicrm.volunteer'
,
'css/volunteer_events.css'
)
->
addVars
(
'org.civicrm.volunteer'
,
array
(
'hash'
=>
'#/volunteer/manage/'
.
$project
->
id
,
'projectId'
=>
$project
->
id
,
'entityTable'
=>
$project
->
entity_table
,
'entityId'
=>
$project
->
entity_id
,
'entityTitle'
=>
$entityTitle
,
'context'
=>
'eventTab'
,
));
}
}
civiext/org.civicrm.volunteer/CRM/Volunteer/Form/Manage.php
deleted
100644 → 0
View file @
a63d2f95
<?php
/*
+--------------------------------------------------------------------+
| CiviCRM version 4.4 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2013 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
| CiviCRM is free software; you can copy, modify, and distribute it |
| under the terms of the GNU Affero General Public License |
| Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
| |
| CiviCRM is distributed in the hope that it will be useful, but |
| WITHOUT ANY WARRANTY; without even the implied warranty of |
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| See the GNU Affero General Public License for more details. |
| |
| You should have received a copy of the GNU Affero General Public |
| License and the CiviCRM Licensing Exception along |
| with this program; if not, contact CiviCRM LLC |
| at info[AT]civicrm[DOT]org. If you have questions about the |
| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
*/
class
CRM_Volunteer_Form_Manage
{
/**
* Load needed JS, CSS and settings for the backend Volunteer Management UI
*/
public
static
function
addResources
(
$entity_id
,
$entity_table
)
{
static
$loaded
=
FALSE
;
$ccr
=
CRM_Core_Resources
::
singleton
();
if
(
$loaded
||
$ccr
->
isAjaxMode
())
{
return
;
}
$loaded
=
TRUE
;
$config
=
CRM_Core_Config
::
singleton
();
// Vendor libraries
$ccr
->
addScriptFile
(
'civicrm'
,
'packages/backbone/json2.js'
,
100
,
'html-header'
,
FALSE
);
$ccr
->
addScriptFile
(
'civicrm'
,
'packages/backbone/backbone-min.js'
,
120
,
'html-header'
,
FALSE
);
$ccr
->
addScriptFile
(
'civicrm'
,
'packages/backbone/backbone.marionette.min.js'
,
125
,
'html-header'
,
FALSE
);
// Our stylesheet
$ccr
->
addStyleFile
(
'org.civicrm.volunteer'
,
'css/volunteer_app.css'
);
// Add all scripts for our js app
$weight
=
0
;
$baseDir
=
CRM_Extension_System
::
singleton
()
->
getMapper
()
->
keyToBasePath
(
'org.civicrm.volunteer'
)
.
'/'
;
// This glob pattern will recurse the js directory up to 4 levels deep
foreach
(
glob
(
$baseDir
.
'js/backbone/{*,*/*,*/*/*,*/*/*/*}.js'
,
GLOB_BRACE
)
as
$file
)
{
$fileName
=
substr
(
$file
,
strlen
(
$baseDir
));
$ccr
->
addScriptFile
(
'org.civicrm.volunteer'
,
$fileName
,
$weight
++
);
}
// Add our template
CRM_Core_Smarty
::
singleton
()
->
assign
(
'isModulePermissionSupported'
,
CRM_Core_Config
::
singleton
()
->
userPermissionClass
->
isModulePermissionSupported
());
CRM_Core_Region
::
instance
(
'page-header'
)
->
add
(
array
(
'template'
=>
'CRM/Volunteer/Form/Manage.tpl'
,
));
// Fetch event so we can set the default start time for needs
// FIXME: Not the greatest for supporting non-events
$entity
=
civicrm_api3
(
str_replace
(
'civicrm_'
,
''
,
$entity_table
),
'getsingle'
,
array
(
'id'
=>
$entity_id
));
// Static variables
$ccr
->
addSetting
(
array
(
'pseudoConstant'
=>
array
(
'volunteer_need_visibility'
=>
array_flip
(
CRM_Volunteer_BAO_Need
::
buildOptions
(
'visibility_id'
,
'validate'
)),
'volunteer_role'
=>
CRM_Volunteer_BAO_Need
::
buildOptions
(
'role_id'
,
'get'
),
'volunteer_status'
=>
CRM_Activity_BAO_Activity
::
buildOptions
(
'status_id'
,
'validate'
),
),
'volunteer'
=>
array
(
'default_date'
=>
CRM_Utils_Array
::
value
(
'start_date'
,
$entity
),
),
'config'
=>
array
(
'timeInputFormat'
=>
$config
->
timeInputFormat
,
),
'constants'
=>
array
(
'CRM_Core_Action'
=>
array
(
'NONE'
=>
0
,
'ADD'
=>
1
,
'UPDATE'
=>
2
,
'VIEW'
=>
4
,
'DELETE'
=>
8
,
'BROWSE'
=>
16
,
'ENABLE'
=>
32
,
'DISABLE'
=>
64
,
'EXPORT'
=>
128
,
'BASIC'
=>
256
,
'ADVANCED'
=>
512
,
'PREVIEW'
=>
1024
,
'FOLLOWUP'
=>
2048
,
'MAP'
=>
4096
,
'PROFILE'
=>
8192
,
'COPY'
=>
16384
,
'RENEW'
=>
32768
,
'DETACH'
=>
65536
,
'REVERT'
=>
131072
,
'CLOSE'
=>
262144
,
'REOPEN'
=>
524288
,
'MAX_ACTION'
=>
1048575
,
),
),
));
// Check for problems
_volunteer_checkResourceUrl
();
}
}
civiext/org.civicrm.volunteer/CRM/Volunteer/Form/Volunteer.php
View file @
ee398d14
...
@@ -34,150 +34,11 @@
...
@@ -34,150 +34,11 @@
*
*
*/
*/
/**
* This class generates form components for processing Event
*
*/
class
CRM_Volunteer_Form_Volunteer
extends
CRM_Event_Form_ManageEvent
{
class
CRM_Volunteer_Form_Volunteer
extends
CRM_Event_Form_ManageEvent
{
/**
* The ID of the entity (in case, the event) associated with the volunteer project.
*
* @var int
* @see getEntityId()
*/
private
$entityId
=
NULL
;
/**
* A flag used to indicate whether or not Angular should be loaded.
*
* @var boolean
* @see isLoadingTabContent()
*/
private
$loadAngular
=
FALSE
;
/**
* The project the form is acting on
*
* @var mixed CRM_Volunteer_BAO_Project if a project has been set, else boolean FALSE
*/
private
$_project
;
/**
* Returns the ID of the entity (in this case, the event) associated with the volunteer project.
*
* @return int
*/
protected
function
getEntityId
()
{
if
(
$this
->
entityId
===
NULL
)
{
$this
->
entityId
=
$this
->
_id
?
$this
->
_id
:
CRM_Utils_Request
::
retrieve
(
'id'
,
'Positive'
,
$this
,
TRUE
);
}
return
$this
->
entityId
;
}
/***
* Get the civiVolunteer Project for this Event.
* CAUTION: Returns only the first if there are multiple.
*
* @returns $project CRM_Volunteer_BAO_Project
*/
protected
function
getProject
()
{
if
(
$this
->
_project
===
NULL
)
{
$this
->
_project
=
current
(
CRM_Volunteer_BAO_Project
::
retrieve
(
array
(
'entity_id'
=>
$this
->
getEntityId
(),
'entity_table'
=>
CRM_Event_DAO_Event
::
$_tableName
,
)));
}
return
$this
->
_project
;
}
/**
* Initializes a placeholder volunteer project.
*
* Used in cases where no project yet exists for the event, to prepopulate the
* "create" form.
*
* @return \CRM_Volunteer_BAO_Project
*/
protected
function
initializeProject
()
{
$project
=
new
CRM_Volunteer_BAO_Project
();
$project
->
id
=
0
;
$project
->
entity_id
=
$this
->
getEntityId
();
$project
->
entity_table
=
CRM_Event_DAO_Event
::
$_tableName
;
return
$project
;
}
/**
* Set variables up before form is built.
*
* @return void
*/
public
function
preProcess
()
{
public
function
preProcess
()
{
if
(
$this
->
isLoadingTabContent
())
{
$this
->
loadAngular
=
TRUE
;
$project
=
$this
->
getProject
();
if
(
!
$project
)
{
$project
=
$this
->
initializeProject
();
}
$entity
=
$project
->
getEntityAttributes
();
$entityTitle
=
$entity
[
'title'
];
CRM_Core_Resources
::
singleton
()
->
addVars
(
'org.civicrm.volunteer'
,
array
(
"hash"
=>
"#/volunteer/manage/"
.
$project
->
id
,
"projectId"
=>
$project
->
id
,
"entityTable"
=>
$project
->
entity_table
,
"entityId"
=>
$project
->
entity_id
,
"entityTitle"
=>
$entityTitle
,
"context"
=>
'eventTab'
,
));
}
else
{
parent
::
preProcess
();
}
}
/**
* Distinguishes between different invocations of the form class.
*
* It is possible for this form class to be loaded twice in what the user
* perceives as a single page load. If the Event tabset is not already loaded
* (i.e., the user clicks Configure > Volunteers from the Manage Events
* screen), then the class is called twice: the first time to defer to its
* parent for the construction of the event tabset; the second time via AJAX
* to load content into the frame for the Volunteer tab.
*
* @return boolean
*/
private
function
isLoadingTabContent
()
{
return
CRM_Utils_Request
::
retrieve
(
'snippet'
,
'String'
)
===
"json"
;
}
/**
* Build the form object
*
* @return None
* @access public
*/
public
function
buildQuickForm
()
{
if
(
$this
->
loadAngular
)
{
$ang
=
new
CRM_Volunteer_Page_Angular
(
null
,
null
,
CRM_Core_Resources
::
singleton
());
$ang
->
registerResources
(
'ajax-snippet'
,
false
);
CRM_Core_Resources
::
singleton
()
->
addScriptFile
(
'org.civicrm.volunteer'
,
'js/CRM_Volunteer_Form_Volunteer.js'
,
-
1000
,
'ajax-snippet'
);
CRM_Core_Resources
::
singleton
()
->
addScriptFile
(
'org.civicrm.volunteer'
,
'js/CRM_Volunteer_Form_Volunteer.js'
,
-
1000
,
'ajax-snippet'
);
parent
::
preProcess
();
CRM_Core_Resources
::
singleton
()
->
addStyleFile
(
'org.civicrm.volunteer'
,
'css/volunteer_events.css'
);
// Low weight, go before all the other Angular scripts. The trick is only needed in snippet mode.
CRM_Core_Resources
::
singleton
()
->
addScript
(
"CRM.origJQuery = window.jQuery; window.jQuery = CRM.$;"
,
-
1001
,
'ajax-snippet'
);
//High weight, go after all the other Angular scripts. The trick is only needed in snippet mode.
CRM_Core_Resources
::
singleton
()
->
addScript
(
"window.jQuery = CRM.origJQuery; delete CRM.origJQuery"
,
1000
,
'ajax-snippet'
);
}
else
{
parent
::
buildQuickForm
();
}
}
}
}
}
civiext/org.civicrm.volunteer/CRM/Volunteer/Page/Angular.php
View file @
ee398d14
...
@@ -3,18 +3,10 @@
...
@@ -3,18 +3,10 @@
class
CRM_Volunteer_Page_Angular
extends
\
CRM_Core_Page
{
class
CRM_Volunteer_Page_Angular
extends
\
CRM_Core_Page
{
public
function
run
()
{
public
function
run
()
{
CRM_Core_Resources
::
singleton
()
->
addScriptFile
(
'civicrm'
,
'packages/jquery/plugins/jquery.notify.min.js'
,
10
,
'html-header'
);
CRM_Core_Region
::
instance
(
'page-footer'
)
->
add
(
array
(
'template'
=>
'CRM/common/notifications.tpl'
,
$loader
=
new
\
Civi\Angular\AngularLoader
();
$loader
->
setModules
(
array
(
'volunteer'
));
$loader
->
setPageName
(
'civicrm/vol'
);
$loader
->
load
();
\
Civi
::
resources
()
->
addSetting
(
array
(
'crmApp'
=>
array
(
'defaultRoute'
=>
'/volunteer/manage'
,
),
));
));
CRM_Volunteer_Angular
::
load
(
'/volunteer/manage'
);
parent
::
run
();
parent
::
run
();
}
}
...
...
civiext/org.civicrm.volunteer/CRM/Volunteer/Page/Backbone.php
View file @
ee398d14
...
@@ -5,10 +5,6 @@ class CRM_Volunteer_Page_Backbone extends CRM_Core_Page {
...
@@ -5,10 +5,6 @@ class CRM_Volunteer_Page_Backbone extends CRM_Core_Page {
// Add our template
// Add our template
CRM_Core_Smarty
::
singleton
()
->
assign
(
'isModulePermissionSupported'
,
CRM_Core_Smarty
::
singleton
()
->
assign
(
'isModulePermissionSupported'
,
CRM_Core_Config
::
singleton
()
->
userPermissionClass
->
isModulePermissionSupported
());
CRM_Core_Config
::
singleton
()
->
userPermissionClass
->
isModulePermissionSupported
());
CRM_Core_Region
::
instance
(
'page-header'
)
->
add
(
array
(
// TODO: consider renaming this TPL
'template'
=>
'CRM/Volunteer/Form/Manage.tpl'
,
));
parent
::
run
();
parent
::
run
();
}
}
...
...
civiext/org.civicrm.volunteer/ang/volunteer/Project.html
View file @
ee398d14
...
@@ -34,7 +34,7 @@
...
@@ -34,7 +34,7 @@
<div
class=
"crm-vol-campaign"
crm-ui-field=
'{name: "projectForm.campaign_id", title: ts("Campaign")}'
>
<div
class=
"crm-vol-campaign"
crm-ui-field=
'{name: "projectForm.campaign_id", title: ts("Campaign")}'
>
<select
class=
"big crm-form-select crm-vol-campaign"
crm-ui-select=
"{placeholder: '', allowClear:true}"
<select
class=
"big crm-form-select crm-vol-campaign"
crm-ui-select=
"{placeholder: '', allowClear:true}"
ng-options=
"key as value.title for (key , value) in campaigns"
ng-model=
"project.campaign_id"
>
ng-options=
"key as value.title for (key , value) in campaigns
track by key
"
ng-model=
"project.campaign_id"
>
<option
/>
<option
/>
</select>
</select>
</div>
</div>
...
@@ -42,7 +42,7 @@
...
@@ -42,7 +42,7 @@
<div
class=
"crm-vol-location"
crm-ui-field=
'{name: "projectForm.locBlock", title: ts("Location")}'
>
<div
class=
"crm-vol-location"
crm-ui-field=
'{name: "projectForm.locBlock", title: ts("Location")}'
>
<select
class=
"big crm-form-select crm-vol-location-block-id"
<select
class=
"big crm-form-select crm-vol-location-block-id"
crm-ui-select=
"{placeholder: '', allowClear:true}"
crm-ui-select=
"{placeholder: '', allowClear:true}"
ng-options=
"key as value for (key , value) in locationBlocks"
ng-model=
"project.loc_block_id"
>
ng-options=
"key as value for (key , value) in locationBlocks
track by key
"
ng-model=
"project.loc_block_id"
>
<option
/>
<option
/>
</select>
</select>
<div
id=
"crm-vol-location-block"
class=
"crm-vol-extra-top"
crm-ui-accordion=
"{title: ts('Edit Location'), collapsed: project.loc_block_id !==0}"
ng-hide=
"!project.loc_block_id"
>
<div
id=
"crm-vol-location-block"
class=
"crm-vol-extra-top"
crm-ui-accordion=
"{title: ts('Edit Location'), collapsed: project.loc_block_id !==0}"
ng-hide=
"!project.loc_block_id"
>
...
@@ -73,7 +73,7 @@
...
@@ -73,7 +73,7 @@
crm-ui-select=
"{allowClear: false}"
crm-ui-select=
"{allowClear: false}"
ng-change=
"locBlockDirty()"
ng-change=
"locBlockDirty()"
ng-model=
"locBlock.address.country_id"
ng-model=
"locBlock.address.country_id"
ng-options=
"k as v.name for (k, v) in countries"
>
ng-options=
"k as v.name for (k, v) in countries
track by k
"
>
</select>
</select>
</div>
</div>
</fieldset>
</fieldset>
...
...
civiext/org.civicrm.volunteer/ang/volunteer/Project.js
View file @
ee398d14
...
@@ -131,6 +131,7 @@
...
@@ -131,6 +131,7 @@
switch
(
$scope
.
formContext
)
{
switch
(
$scope
.
formContext
)
{
case
'
eventTab
'
:
case
'
eventTab
'
:
volBackbone
.
load
();
var
cancelCallback
=
function
(
projectId
)
{
var
cancelCallback
=
function
(
projectId
)
{
CRM
.
$
(
"
body
"
).
trigger
(
"
volunteerProjectCancel
"
);
CRM
.
$
(
"
body
"
).
trigger
(
"
volunteerProjectCancel
"
);
};
};
...
...
civiext/org.civicrm.volunteer/css/volunteer_events.css
View file @
ee398d14
/* Rendered on load of the tabset and should remain hidden initially. */
#crm_volunteer_angular_frame
{
display
:
none
;
}
.crm-volunteer-event-action-items-all
{
.crm-volunteer-event-action-items-all
{
margin
:
10px
5px
;
margin
:
10px
5px
;
}
}
...
...
civiext/org.civicrm.volunteer/info.xml
View file @
ee398d14
...
@@ -8,8 +8,8 @@
...
@@ -8,8 +8,8 @@
<author>
Ginkgo Street Labs
</author>
<author>
Ginkgo Street Labs
</author>
<email>
inquire@ginkgostreet.com
</email>
<email>
inquire@ginkgostreet.com
</email>
</maintainer>
</maintainer>
<releaseDate>
2017-0
7-3
0
</releaseDate>
<releaseDate>
2017-0
9-1
0
</releaseDate>
<version>
4.7.21-2.2.2-beta
1
</version>
<version>
4.7.21-2.2.2-beta
2
</version>
<compatibility>
<compatibility>
<ver>
4.7
</ver>
<ver>
4.7
</ver>
</compatibility>
</compatibility>
...
...
civiext/org.civicrm.volunteer/js/CRM_Volunteer_Form_Volunteer.js
View file @
ee398d14
CRM
.
$
(
function
(
$
)
{
CRM
.
$
(
function
(
$
)
{
//Defer loading of Angular
//Because we are loading Angular through an ajax interface
//we need to defer loading until everything is ready.
//The batarang module employs this method to defer loading
//see: https://docs.angularjs.org/guide/bootstrap
//maybeBootstrap modified from that found at: https://github.com/angular/batarang
var
DEFER_LABEL
=
'
NG_DEFER_BOOTSTRAP!
'
;
window
.
name
=
DEFER_LABEL
+
window
.
name
;
function
maybeBootstrap
()
{
if
(
typeof
angular
===
'
undefined
'
||
!
angular
.
resumeBootstrap
)
{
return
setTimeout
(
maybeBootstrap
,
1
);
}
window
.
name
=
window
.
name
.
substring
(
DEFER_LABEL
.
length
);
angular
.
resumeBootstrap
();
}
maybeBootstrap
();
// Moving a CKEditor instance breaks it because of its use of iframes
// (https://stackoverflow.com/a/28650844); so we must destroy and re-create it
var
description
=
$
(
'
#crm-vol-form-textarea-wrapper textarea
'
);
CRM
.
wysiwyg
.
destroy
(
description
);
if
(
CRM
.
vars
[
'
org.civicrm.volunteer
'
].
hash
)
{
var
angFrame
=
$
(
'
#crm_volunteer_angular_frame
'
);
location
.
hash
=
CRM
.
vars
[
'
org.civicrm.volunteer
'
].
hash
;
$
(
'
.crm-volunteer-event-action-items-all
'
).
after
(
angFrame
);
}
CRM
.
wysiwyg
.
create
(
description
);
angFrame
.
show
();
//Handle Project Save
//
Handle Project Save
$
(
"
body
"
).
on
(
"
volunteerProjectSaveComplete
"
,
function
(
event
,
projectId
)
{
$
(
"
body
"
).
on
(
"
volunteerProjectSaveComplete
"
,
function
(
event
,
projectId
)
{
...
@@ -36,22 +24,22 @@ CRM.$(function($) {
...
@@ -36,22 +24,22 @@ CRM.$(function($) {
CRM
.
vars
[
'
org.civicrm.volunteer
'
].
projectId
=
projectId
;
CRM
.
vars
[
'
org.civicrm.volunteer
'
].
projectId
=
projectId
;
CRM
.
vars
[
'
org.civicrm.volunteer
'
].
hash
=
CRM
.
vars
[
'
org.civicrm.volunteer
'
].
hash
.
replace
(
/
[
0-9
]
*$/
,
projectId
);
CRM
.
vars
[
'
org.civicrm.volunteer
'
].
hash
=
CRM
.
vars
[
'
org.civicrm.volunteer
'
].
hash
.
replace
(
/
[
0-9
]
*$/
,
projectId
);
//Hide the editor frame
//
Hide the editor frame
$
(
"
#crm_volunteer_angular_frame
"
)
.
slideUp
();
angFrame
.
slideUp
();
//show the "edit" button
//show the "edit" button
$
(
"
#crm-volunteer-event-edit
"
).
fadeIn
();
$
(
"
#crm-volunteer-event-edit
"
).
fadeIn
();
});
});
//Handle Project Edit Cancel
//
Handle Project Edit Cancel
$
(
"
body
"
).
on
(
"
volunteerProjectCancel
"
,
function
()
{
$
(
"
body
"
).
on
(
"
volunteerProjectCancel
"
,
function
()
{
//Hide the editor frame
//Hide the editor frame
$
(
"
#crm_volunteer_angular_frame
"
)
.
slideUp
();
angFrame
.
slideUp
();
//show the "edit" button
//show the "edit" button
$
(
"
#crm-volunteer-event-edit
"
).
fadeIn
();
$
(
"
#crm-volunteer-event-edit
"
).
fadeIn
();
});
});
//Wire up the edit settings button
//
Wire up the edit settings button
$
(
"
#crm-volunteer-event-edit
"
).
click
(
function
(
event
)
{
$
(
"
#crm-volunteer-event-edit
"
).
click
(
function
(
event
)
{
//hide the "edit" button
//hide the "edit" button
$
(
"
#crm-volunteer-event-edit
"
).
fadeOut
();
$
(
"
#crm-volunteer-event-edit
"
).
fadeOut
();
...
@@ -61,25 +49,25 @@ CRM.$(function($) {
...
@@ -61,25 +49,25 @@ CRM.$(function($) {
CRM
.
$
(
"
body
"
).
trigger
(
"
volunteerProjectRefresh
"
);
CRM
.
$
(
"
body
"
).
trigger
(
"
volunteerProjectRefresh
"
);
//Show the editor frame
//Show the editor frame
$
(
"
#crm_volunteer_angular_frame
"
)
.
slideDown
();
angFrame
.
slideDown
();
});
});
//Wire up the define button
//
Wire up the define button
$
(
"
#crm-volunteer-event-define
"
).
click
(
function
(
event
)
{
$
(
"
#crm-volunteer-event-define
"
).
click
(
function
(
event
)
{
if
(
CRM
.
vars
[
'
org.civicrm.volunteer
'
].
projectId
!=
0
)
{
if
(
CRM
.
vars
[
'
org.civicrm.volunteer
'
].
projectId
!=
0
)
{
CRM
.
volunteerPopup
(
ts
(
'
Define Volunteer Opportunities
'
),
'
Define
'
,
CRM
.
vars
[
'
org.civicrm.volunteer
'
].
projectId
);
CRM
.
volunteerPopup
(
ts
(
'
Define Volunteer Opportunities
'
),
'
Define
'
,
CRM
.
vars
[
'
org.civicrm.volunteer
'
].
projectId
);
}
}
});
});