First commit

This commit is contained in:
Theodotos Andreou 2018-01-14 13:10:16 +00:00
commit c6e2478c40
13918 changed files with 2303184 additions and 0 deletions

View file

@ -0,0 +1,39 @@
{*
+--------------------------------------------------------------------+
| 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 |
+--------------------------------------------------------------------+
*}
{* CiviCampaign DashBoard (launch page) *}
{if !empty($subPageType)}
{* load campaign/survey/petition tab *}
{include file="CRM/Campaign/Form/Search/$subPageType.tpl"}
{else}
{include file="CRM/common/TabHeader.tpl"}
<div class="clear"></div>
{/if}

View file

@ -0,0 +1,76 @@
{*
+--------------------------------------------------------------------+
| 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 |
+--------------------------------------------------------------------+
*}
{* this template is used for displaying survey information *}
{if $surveys}
<div class="action-link">
<a href="{$addSurveyUrl}" class="button">
<span><i class="crm-i fa-plus-circle"></i> {ts}Add Survey{/ts}</span>
</a>
</div>
{include file="CRM/common/enableDisableApi.tpl"}
{include file="CRM/common/jsortable.tpl"}
<div id="surveyList">
<table id="options" class="display">
<thead>
<tr>
<th>{ts}Survey{/ts}</th>
<th>{ts}Campaign{/ts}</th>
<th>{ts}Survey Type{/ts}</th>
<th>{ts}Release Frequency{/ts}</th>
<th>{ts}Max Number Of Contacts{/ts}</th>
<th>{ts}Default Number Of Contacts{/ts}</th>
<th>{ts}Default?{/ts}</th>
<th>{ts}Active?{/ts}</th>
<th id="nosort"></th>
</tr>
</thead>
{foreach from=$surveys item=survey}
<tr id="survey-{$survey.id}" class="crm-entity {if $survey.is_active neq 1} disabled{/if}">
<td>{$survey.title}</td>
<td>{$survey.campaign_id}</td>
<td>{$survey.activity_type_id}</td>
<td>{$survey.release_frequency}</td>
<td>{$survey.max_number_of_contacts}</td>
<td>{$survey.default_number_of_contacts}</td>
<td>{if $survey.is_default}<img src="{$config->resourceBase}i/check.gif" alt="{ts}Default{/ts}" /> {/if}</td>
<td id="row_{$survey.id}_status">{if $survey.is_active}{ts}Yes{/ts}{else}{ts}No{/ts}{/if}</td>
<td class="crm-report-optionList-action">{$survey.action}</td>
</tr>
{/foreach}
</table>
</div>
{else}
<div class="status">
<div class="icon inform-icon"></div>&nbsp;{ts}None found.{/ts}
</div>
{/if}
<div class="action-link">
<a href="{$addSurveyUrl}" class="button">
<span><i class="crm-i fa-plus-circle"></i> {ts}Add Survey{/ts}</span>
</a>
</div>

View file

@ -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>&nbsp;
{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}

View file

@ -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}&amp;t={$node.title}">
<img src="{$base_url}/sites/all/modules/civicrm/i/fbshare.png" width="70px" height="28px" title="Facebook Share Button">
</a>
&nbsp;
&nbsp;
&nbsp;
&nbsp;
<a href="http://twitter.com/share?url={$node.url}&amp;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}

View file

@ -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}

View file

@ -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}

View file

@ -0,0 +1,55 @@
<div class="crm-content-block crm-block">
{if ($action eq 1) or ($action eq 2) or ($action eq 8) }
{include file="CRM/Campaign/Form/SurveyType.tpl" }
{else}
{if $rows}
<div class="action-link">
{crmButton p=$addSurveyType.0 q=$addSurveyType.1 icon="crm-i fa-plus-circle"}{ts 1=$GName}Add %1{/ts}{/crmButton}
</div>
<div id={$gName}>
{strip}
{* handle enable/disable actions*}
{include file="CRM/common/enableDisableApi.tpl"}
<table class="row-highlight">
<thead>
<tr>
<th>
{ts}Label{/ts}
</th>
<th>
{ts}Value{/ts}
</th>
<th>{ts}Description{/ts}</th>
<th>{ts}Order{/ts}</th>
<th>{ts}Reserved{/ts}</th>
<th>{ts}Enabled?{/ts}</th>
<th></th>
</tr>
</thead>
{foreach from=$rows item=row}
<tr id="option_value-{$row.id}" class="crm-entity crm-admin-options_{$row.id} {if NOT $row.is_active} disabled{/if}">
<td class="crm-admin-options-label crm-editable" data-field="label">{$row.label}</td>
<td class="crm-admin-options-value">{$row.value}</td>
<td class="crm-admin-options-description">{$row.description}</td>
<td class="nowrap crm-admin-options-order">{$row.weight}</td>
<td class="crm-admin-options-is_reserved">{if $row.is_reserved eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}</td>
<td class="crm-admin-options-is_active" id="row_{$row.id}_status">{if $row.is_active eq 1} {ts}Yes{/ts} {else} {ts}No{/ts} {/if}</td>
<td>{$row.action|replace:'xx':$row.id}</td>
</tr>
{/foreach}
</table>
{/strip}
<div class="action-link">
{crmButton p=$addSurveyType.0 q=$addSurveyType.1 icon="crm-i fa-plus-circle"}{ts 1=$GName}Add %1{/ts}{/crmButton}
</div>
</div>
{else}
<div class="messages status no-popup">
<div class="icon inform-icon"> &nbsp;
{ts p=$addSurveyType.0 q=$addSurveyType.1}There are no survey types entered. You can <a href='%1'>add one</a>.{/ts}</div>
</div>
{/if}
{/if}
</div>

View file

@ -0,0 +1,55 @@
{*
+--------------------------------------------------------------------+
| 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 |
+--------------------------------------------------------------------+
*}
{* Voting Tab Interface - Easy way to get the voter Interview. *}
{if $subPageType eq 'interview'}
{* build the voter interview grid here *}
{include file='CRM/Campaign/Form/Task/Interview.tpl'}
{elseif $subPageType eq 'reserve'}
{* build the ajax search and voters reserve interface here *}
{include file='CRM/Campaign/Form/Gotv.tpl'}
{elseif $tabHeader}
{include file="CRM/common/TabHeader.tpl"}
<script type="text/javascript">
{* very crude refresh of tabs - fixme: use datatable native refresh method *}
{literal}
CRM.$(function($) {
$('#mainTabContainer').on('tabsbeforeactivate', function(e, ui) {
// fixme - can't search more than once! Uncomment this code, switching tabs gives qfkey error.
//if (ui.newTab.is('#tab_reserve')) {
//$('.searchVoter.button').click();
ui.oldPanel.data('civiCrmSnippet') && ui.oldPanel.crmSnippet('destroy');
//}
});
});
{/literal}
</script>
{else}
<div class="messages status no-popup">
<div class="icon inform-icon"></div>
{ts}You are not authorized to access this page.{/ts}
</div>
{/if}