First commit
This commit is contained in:
commit
c6e2478c40
13918 changed files with 2303184 additions and 0 deletions
|
@ -0,0 +1,46 @@
|
|||
{*
|
||||
+--------------------------------------------------------------------+
|
||||
| CiviCRM version 4.7 |
|
||||
+--------------------------------------------------------------------+
|
||||
| Copyright CiviCRM LLC (c) 2004-2017 |
|
||||
+--------------------------------------------------------------------+
|
||||
| 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 |
|
||||
+--------------------------------------------------------------------+
|
||||
*}
|
||||
<div class="messages status no-popup">
|
||||
<div class="icon inform-icon"></div>
|
||||
{if $success}
|
||||
{ts 1=$display_name 2=$email}<strong>%1 - your email address '%2' has been successfully verified.</strong>{/ts}
|
||||
{else}
|
||||
{ts}Oops. We encountered a problem in processing your email verification. Please contact the site administrator.{/ts}
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
{if $success}
|
||||
<div id="thankyou_text" class="crm-section thankyou_text-section">
|
||||
{if $thankyou_text}
|
||||
{$thankyou_text}
|
||||
{else}
|
||||
<p><div class="bold">{ts}Thank you for signing the petition.{/ts}</div></p>
|
||||
{/if}
|
||||
</div>
|
||||
{if $is_share}
|
||||
{include file="CRM/Campaign/Page/Petition/SocialNetwork.tpl"}
|
||||
{/if}
|
||||
{/if}
|
|
@ -0,0 +1,112 @@
|
|||
{literal}
|
||||
<script>
|
||||
if (FB != undefined) { // reprocess the XFBML tags if called in ajax (otherwise, that's done by the init)
|
||||
FB.XFBML.parse(document.getElementById('socialnetwork'));
|
||||
|
||||
}
|
||||
</script>
|
||||
{/literal}
|
||||
|
||||
{*
|
||||
You might have a specific page that displays more information that the form.
|
||||
|
||||
This is an example (taken from http://www.etownhall.eu) that assumes that there is a Drupal node
|
||||
that contains a cck field 'petitionid'.
|
||||
This node is going to be used for the social networks promotion instead of the form.
|
||||
|
||||
This is an example of how to fetch content from a Drupal node (that contains a cck field 'petitionid')
|
||||
You will want to customise it based on your configuration.
|
||||
|
||||
How to install ?
|
||||
Create a custom template folder and copy this file into CRM/Campaign/Page/Petition/SocialNetwork.tpl
|
||||
This assumes you are on Drupal, have installed the fb module (drupal.org/project/fb),
|
||||
and in general, is very unlikely to work directly. Please consider this as an example,
|
||||
and modify to fit your specific configuration.
|
||||
*}
|
||||
|
||||
|
||||
{php}
|
||||
/**
|
||||
* Function to get Petition Drupal Node Path/Alias
|
||||
*
|
||||
* @param int $surveyId
|
||||
* @static
|
||||
*/
|
||||
function &getPetitionDrupalNodeData( $surveyId ) {
|
||||
/*
|
||||
Other approach: using the view
|
||||
$view=views_get_view("node_petition"); //replace with the name of your view
|
||||
$view->set_arguments(array($surveyId));
|
||||
$view->build('default'); //use "default" if you want to retrieve the default display of your view, if not, the name of the specific display
|
||||
$view->execute();
|
||||
foreach($view->result as $result) { //$result
|
||||
// Do something with $result here. Each result is an object, so for example you can access the nid using $result->nid
|
||||
}
|
||||
*/
|
||||
$config = CRM_Core_Config::singleton( );
|
||||
$surveyId = (int)$surveyId;// sql injection protection
|
||||
// if Drupal node uses cck integer field petitionid
|
||||
// there will be a 'content_field_petitionid' table in the Drupal database
|
||||
// that stores field_petitionid_value against nid (node id)
|
||||
|
||||
$result = db_query("SELECT * FROM content_type_petition WHERE field_petitionid_value = " . $surveyId);
|
||||
|
||||
global $base_url;
|
||||
$petition = array();
|
||||
$data = db_fetch_array ($result);
|
||||
|
||||
if (!$data) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$petition_node = node_load ($data['nid']);
|
||||
$petition_node->url = $base_url . "/" . drupal_get_path_alias("node/".$data['nid']);
|
||||
$petition_node->title = node_page_title(node_load($data['nid']));
|
||||
|
||||
return array_merge ((array)$petition_node,(array)$data);
|
||||
}
|
||||
|
||||
global $base_url;
|
||||
$this->assign('base_url', $base_url);
|
||||
$email = $this->get_template_vars('email');
|
||||
$noscript = $this->get_template_vars('noscript');
|
||||
$petition_id = $this->get_template_vars('petition_id');
|
||||
$node = getPetitionDrupalNodeData($petition_id);
|
||||
$this->assign_by_ref('node', $node);
|
||||
|
||||
{/php}
|
||||
|
||||
{if $node.nid}
|
||||
{* print additional thank you email text from Drupal petition node if there is a cck text field 'email' *}
|
||||
{if $email}
|
||||
<br />{$node.field_email.0.value}
|
||||
{/if}
|
||||
|
||||
<!-- Social Networking -->
|
||||
<h2>Help spread the word about "{$node.title}"</h2>
|
||||
Please help us and let your friends, colleagues and followers know about our campaign.
|
||||
<h3>Do you use Facebook or Twitter ?</h3>
|
||||
|
||||
<div class="socialnetwork">
|
||||
{if $noscript}
|
||||
<p>Share it on Facebook or tweet it on Twitter.</p>
|
||||
<a href="http://www.facebook.com/sharer.php?u={$node.url}&t={$node.title}">
|
||||
<img src="{$base_url}/sites/all/modules/civicrm/i/fbshare.png" width="70px" height="28px" title="Facebook Share Button">
|
||||
</a>
|
||||
|
||||
|
||||
|
||||
|
||||
<a href="http://twitter.com/share?url={$node.url}&text=Sign this, I did: {$node.title}">
|
||||
<img src="{$base_url}/sites/all/modules/civicrm/i/tweet.png" width="55px" height="20px" title="Tweet Button"">
|
||||
</a>
|
||||
{else}
|
||||
<p>Like it on Facebook or tweet it on Twitter.</p>
|
||||
<fb:like href="{$node.url}"></fb:like>
|
||||
<script src="http://platform.twitter.com/widgets.js" type="text/javascript"></script>
|
||||
<a href="http://twitter.com/share?url={$node.url}&text=Sign this, I did: {$node.title}" class="twitter-share-button" title="tweet about this petition">Tweet</a>
|
||||
{/if}
|
||||
</div>
|
||||
<h3>Do you have a website for your organisation or yourself?</h3>
|
||||
You can write a story about it - don't forget to add the link to <a href="{$node.url}">{$node.url}.</a>
|
||||
{/if}
|
|
@ -0,0 +1,7 @@
|
|||
{*
|
||||
Default Thank-you page for verified signers.
|
||||
You might have a specific page that displays more information that the form.
|
||||
Check SocialNetwork.drupal as an example
|
||||
*}
|
||||
{capture assign=petitionURL}{crmURL p='civicrm/petition/sign' q="sid=`$petition_id`" a=1 fe=1 h=1}{/capture}
|
||||
{include file="CRM/common/SocialNetwork.tpl" url=$petitionURL title=$petitionTitle pageURL=$petitionURL}
|
|
@ -0,0 +1,60 @@
|
|||
{*
|
||||
+--------------------------------------------------------------------+
|
||||
| CiviCRM version 4.7 |
|
||||
+--------------------------------------------------------------------+
|
||||
| Copyright CiviCRM LLC (c) 2004-2017 |
|
||||
+--------------------------------------------------------------------+
|
||||
| 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 |
|
||||
+--------------------------------------------------------------------+
|
||||
*}
|
||||
|
||||
{if $status_id eq 2} {* Signer needs to confirm signature. *}
|
||||
<h2>{ts}STEP 2: Please Check Your Email{/ts}</h2>
|
||||
<p>{ts}To complete and confirm your signature, please follow the activation instructions sent to the email address you provided.{/ts}</p>
|
||||
<p>
|
||||
|
||||
<strong>{ts}IMPORTANT{/ts}</strong>: {ts}Before we can add your signature, you must validate your email address by clicking on the activation link in the confirmation e-mail. Sometimes our confirmation emails get flagged as spam and are moved to your bulk folder.{/ts}
|
||||
<br/>
|
||||
{ts}If you haven't received an email within a few minutes, please check your spam folder.{/ts}
|
||||
</p>
|
||||
{/if}
|
||||
|
||||
{if $status_id eq 4}
|
||||
<p>{ts}You have already signed this petition but we<strong>need to confirm your email address</strong>.{/ts}</p>
|
||||
<b>{ts}IMPORTANT{/ts}</b>
|
||||
: {ts}Before we can add your signature, you must validate your email address by clicking on the activation link in the confirmation e-mail. Sometimes our confirmation emails get flagged as spam and are moved to your spam folder.{/ts}
|
||||
<br/>
|
||||
{ts}If you haven't received an email from us, check your spam folder, it might have been wrongly classified.{/ts}
|
||||
<br/>
|
||||
{/if}
|
||||
{if $status_id eq 5}
|
||||
<p>{ts}You have already signed this petition.{/ts}</p>
|
||||
{/if}
|
||||
|
||||
{if $status_id neq 2}{* if asked to confirm the email, focus on that and don't put additional messages *}
|
||||
{if $thankyou_text}
|
||||
<div id="thankyou_text" class="crm-section thankyou_text-section">
|
||||
{$thankyou_text}
|
||||
</div>
|
||||
{/if}
|
||||
{if $is_share}
|
||||
{include file="CRM/Campaign/Page/Petition/SocialNetwork.tpl" petition_id=$survey_id petitionTitle=$petitionTitle}
|
||||
{/if}
|
||||
{/if}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue