Commit 8204efb1 authored by jaapjansma's avatar jaapjansma

added documentation

parent ab8c0153
......@@ -14,7 +14,7 @@ class CRM_Sharepoint_Form_Settings extends CRM_Admin_Form {
$this->add(
'text', // field type
'url', // field name
E::ts('Url'), // field label
ts('Url', array('domain' => 'sharepoint')), // field label
array(
'class' => 'huge40',
),
......@@ -24,7 +24,7 @@ class CRM_Sharepoint_Form_Settings extends CRM_Admin_Form {
$this->add(
'text', // field type
'site', // field name
E::ts('Site'), // field label
ts('Site', array('domain' => 'sharepoint')), // field label
array(
'class' => 'huge40',
),
......@@ -34,7 +34,7 @@ class CRM_Sharepoint_Form_Settings extends CRM_Admin_Form {
$this->add(
'text', // field type
'username', // field name
E::ts('Username'), // field label
ts('Username', array('domain' => 'sharepoint')), // field label
array(
'class' => 'huge40',
),
......@@ -44,7 +44,7 @@ class CRM_Sharepoint_Form_Settings extends CRM_Admin_Form {
$this->add(
'password', // field type
'password', // field name
E::ts('Passowrd'), // field label
ts('Password', array('domain' => 'sharepoint')), // field label
array(
'class' => 'huge40',
),
......@@ -54,7 +54,7 @@ class CRM_Sharepoint_Form_Settings extends CRM_Admin_Form {
$this->add(
'text', // field type
'library', // field name
E::ts('Library name'), // field label
ts('Library name', array('domain' => 'sharepoint')), // field label
array(
'class' => 'huge40',
),
......@@ -64,7 +64,7 @@ class CRM_Sharepoint_Form_Settings extends CRM_Admin_Form {
$this->add(
'text', // field type
'contact_id_field_name', // field name
E::ts('Contact ID field name'), // field label
ts('Contact ID field name', array('domain' => 'sharepoint')), // field label
array(
'class' => 'huge40',
),
......@@ -74,7 +74,7 @@ class CRM_Sharepoint_Form_Settings extends CRM_Admin_Form {
$this->add(
'text', // field type
'case_id_field_name', // field name
E::ts('Case ID field name'), // field label
ts('Case ID field name', array('domain' => 'sharepoint')), // field label
array(
'class' => 'huge40',
),
......@@ -84,7 +84,7 @@ class CRM_Sharepoint_Form_Settings extends CRM_Admin_Form {
$this->add(
'text', // field type
'civicrm_link_field_name', // field name
E::ts('Link To CiviCRM field name'), // field label
ts('Link To CiviCRM field name', array('domain' => 'sharepoint')), // field label
array(
'class' => 'huge40',
),
......@@ -94,7 +94,7 @@ class CRM_Sharepoint_Form_Settings extends CRM_Admin_Form {
$this->add(
'text', // field type
'title_field', // field name
E::ts('Title field name'), // field label
ts('Title field name', array('domain' => 'sharepoint')), // field label
array(
'class' => 'huge40',
),
......@@ -104,7 +104,7 @@ class CRM_Sharepoint_Form_Settings extends CRM_Admin_Form {
$this->add(
'text', // field type
'contact_documentset_contenttype_id', // field name
E::ts('Content Type ID for the contact documentset'), // field label
ts('Content Type ID for the contact documentset', array('domain' => 'sharepoint')), // field label
array(
'class' => 'huge40',
),
......@@ -114,7 +114,7 @@ class CRM_Sharepoint_Form_Settings extends CRM_Admin_Form {
$this->add(
'text', // field type
'case_documentset_contenttype_id', // field name
E::ts('Content Type ID for the case documentset'), // field label
ts('Content Type ID for the case documentset', array('domain' => 'sharepoint')), // field label
array(
'class' => 'huge40',
),
......@@ -138,7 +138,7 @@ class CRM_Sharepoint_Form_Settings extends CRM_Admin_Form {
}
}
CRM_Core_Session::setStatus(E::ts('Saved sharepoint settings'), '', 'success');
CRM_Core_Session::setStatus(ts('Saved sharepoint settings', array('domain' => 'sharepoint')), '', 'success');
parent::postProcess();
}
......
......@@ -19,32 +19,8 @@ The extension is licensed under [AGPL-3.0](LICENSE.txt).
## Configuration of Sharepoint
Before you can use this extension you have to configure sharepoint.
Before you can use this extension you have to configure [sharepoint](docs/Configure_Sharepoint.md).
## Custom fields
Create the following fields:
* contact_id a numeric field
* case_id a numeric field
* link_to_civicrm a Hyperlink field
## Document sets
Make sure you have enabled document sets in sharepoint. If you dont know how to do this google it and feel free to update this manual.
After you have enabled the document sets you have to create the content types for the document set for _contacts_ and _casess_.
You can do that by navigating to site settings --> Site Content Types and add a new one, select _Document Set Content Type_ at the parent type.
After you have created the content type go to edit the content type and add the created fields to the content type. At the settings of the content type you can
configure which fields should be shown at the start page of the content type. Possibly you want here the field _link_to_civicrm_
![sharepoint 1](/images/sharepoint_content_type1.png)
![sharepoint 2](/images/sharepoint_content_type2.png)
### Note the content type id
Whilst editing a content type, you can see in the url the ID of the content type, which looks like _&ctype=0x0120D5...._ Note this ID because you need this in your CiviCRM settings later on.
# CiviCRM configuration
......
# Configuration of sharepoint.
## In a nutshell
In a nuttshell Sharepoint should have a documentset content type with the following fields:
- Contact_ID a numeric field
- Case_ID, a numeric field
- Link_to_civicrm a hyperlink field
It does not really matter how you call those fields as you enter those names in CiviCRM as well.
## Step by step
Below a step by step guide on how to configure Sharepoint.
### Verify you document set feature is enabled.
Go to site setting and features and make sure that the DocumentSet Feature is activated.
![Screenshot2](images/sharepoint2.gif)
### Create the custom fields in Sharepoint.
Go to Site Settings and then to Site Columns. Click Create and add a numeric field and call this ContactId in the new new group CiviCRM. Save the field.
Click create and add a numeric field and call this CaseId in the group CiviCRM. Save the field.
Click create and add a hyperlink or picture field and call this CiviCRMLink in the group CiviCRM. Save the field.
![Screenshot](images/sharepoint1.gif)
### Create a document set content type for contact documents.
Go to Site Settings and then to Site Content Types. Click on create and add a new content type with the name ContactDocumentSet, and
set _Select parent content type from_ to _Document Set Content Types_, and set _Parent content type_ to _Document Set_ and set _Group, Existing Group_ to _Document Set Content Types_. Press Ok.
Click in the next screen on Add from existing site columns and select the fields from the CiviCRM group, which we have created in the previous step.
![screenshot3](images/sharepoint3.gif)
Go to Document Set Settings and add the Contact ID and Link To CiviCRM columns to the Welcome page. If you want you could share the data of the columns Case ID, Contact ID and CiviCRM Link with all documents in the set.
![screenshot4](images/sharepoint4.gif)
### Create a document set content type for case documents.
Repeat above settings for the case document set.
Go to Site Settings and then to Site Content Types. Click on create and add a new content type with the name CaseDocumentSet, and
set _Select parent content type from_ to _Document Set Content Types_, and set _Parent content type_ to _Document Set_ and set _Group, Existing Group_ to _Document Set Content Types_. Press Ok.
Click in the next screen on Add from existing site columns and select the fields from the CiviCRM group, which we have created in the previous step.
Go to Document Set Settings and add the Contact ID and Link To CiviCRM columns to the Welcome page. If you want you could share the data of the columns Case ID, Contact ID and CiviCRM Link with all documents in the set.
![screenshot5](images/sharepoint5.gif)
### Assign the document sets to the library.
- Go to library setting and navigate to Advance setting and make sure that **Allow Managed Content Type** is set to true.
- Go to list settings and click on _Add from existing site content types_. Then select ContactDocumentSet and CaseDocumentSet
![screenshot6](/images/sharepoint6.gif)
### Note the content type ids
Now we want to know the content type ids of the content types we just created. We need those to enter in CiviCRM after wards.
So from the library settings click on the ContactDocumentSet. Then go to the addressbar of your browser. And look for the part _ctype=0x0120D..._ the part of _ctype=_ is the content type id.
Do this for the ContactDocumentSet as for the CaseDocumentSet.
![screenshot7](images/sharepoint7.gif)
That is it now it is time to configure CiviCRM.
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
# Copyright CiviCRM LLC (c) 2004-2015
# This file is distributed under the same license as the CiviCRM package.
# If you contribute heavily to a translation and deem your work copyrightable,
# make sure you license it to CiviCRM LLC under Academic Free License 3.0.
msgid ""
msgstr ""
"Project-Id-Version: sharepoint\n"
"POT-Creation-Date: 2018-08-10 14:04+0000\n"
"Language-Team: CiviCRM Translators <civicrm-translators@lists.civicrm.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"PO-Revision-Date: \n"
"X-Generator: Poedit 2.1.1\n"
"Last-Translator: \n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"Language: nl\n"
#: CRM/Sharepoint/Form/Settings.php
msgid "Url"
msgstr "Url"
#: CRM/Sharepoint/Form/Settings.php
msgid "Site"
msgstr "Site"
#: CRM/Sharepoint/Form/Settings.php
msgid "Username"
msgstr "Gebruikersnaam"
#: CRM/Sharepoint/Form/Settings.php
msgid "Passowrd"
msgstr "Wachtwoord"
#: CRM/Sharepoint/Form/Settings.php
msgid "Library name"
msgstr "Bibliotheeknaam"
#: CRM/Sharepoint/Form/Settings.php
msgid "Contact ID field name"
msgstr "Contact ID veldnaam"
#: CRM/Sharepoint/Form/Settings.php
msgid "Case ID field name"
msgstr "Case ID veldnaam"
#: CRM/Sharepoint/Form/Settings.php
msgid "Link To CiviCRM field name"
msgstr "CiviCRM Link veldnaam"
#: CRM/Sharepoint/Form/Settings.php
msgid "Title field name"
msgstr "Titel veldnaam"
#: CRM/Sharepoint/Form/Settings.php
msgid "Content Type ID for the contact documentset"
msgstr "Content Type ID voor de contact documentenset"
#: CRM/Sharepoint/Form/Settings.php
msgid "Content Type ID for the case documentset"
msgstr "Content Type ID voor de case documentenset"
#: CRM/Sharepoint/Form/Settings.php
msgid "Saved sharepoint settings"
msgstr "Sharepoint instellingen opgeslagen"
#: sharepoint.php
msgid "Sharepoint settings"
msgstr "Sharepoint instellingen"
#: sharepoint.php
msgid "View Case documents in sharepoint"
msgstr "Bekijk dossierdocumenten in sharepoint"
#: sharepoint.php
msgid "View Contact documents in sharepoint"
msgstr "Bekijk contact documenten in sharepoint"
#: sharepoint.php
msgid "View in CiviCRM"
msgstr "Bekijk in CiviCRM"
#: templates/CRM/Contact/Page/View/Summary/sharepoint.tpl
msgid "View in Sharepoint"
msgstr "Bekijk documenten in sharepoint"
#: templates/CRM/Contact/Page/View/Summary/sharepoint.tpl
msgid "Sharepoint"
msgstr "Sharepoint"
#: templates/CRM/Sharepoint/Form/Settings.tpl
msgid "The URL to your sharepoint. E.g. https://mysharepoint.sharepoint.com"
msgstr ""
"De url naar je sharepoint installatie. Bijv. https://mysharepoint.sharepoint."
"com"
#: templates/CRM/Sharepoint/Form/Settings.tpl
msgid ""
"The sharepoint site. Leave empty if you wish to use your main sharepoint "
"site. E.g. /sites/mysubsite<br />\n"
" Example if the url to your site is https://example.sharepoint.com/"
"sites/yoursubsite then https://exmaple.sharepoint.com is the url and sites/"
"yoursubsite is the site."
msgstr ""
"De sharepoint site. Laat leeg als je de hoofdsite wilt gebruiken. Bijv. /"
"sites/mysubsite voor een subsite<br />\n"
"Bijv. de url naar je site is https://voorbeeld.sharepoint.com/sites/"
"mijnsubsite dan is https://voorbeeld.sharepoint.com de url en sites/"
"mijnsubite de site."
#: templates/CRM/Sharepoint/Form/Settings.tpl
msgid "The name of the library into which the document sets are stored."
msgstr "De naam van de bibliotheek in welke documentensets opgeslagen worden."
#: templates/CRM/Sharepoint/Form/Settings.tpl
msgid ""
"Each document set is linked to a contact. The contact ID is stored in this "
"field. You should create your field within sharepoint and link it to your "
"contact documentset and case document set."
msgstr ""
"Elk documentenset is gelinkt aan een contact. De Contact ID wordt opgelsagen "
"in dit veld. Je dient wel eerst dit veld in je sharepoint omgeving aan te "
"maken en te koppelen aan de contacten en dossier documentsets."
#: templates/CRM/Sharepoint/Form/Settings.tpl
msgid ""
"Each case document set is linked to a case. The case ID is stored in this "
"field. You should create your field within sharepoint and link it to your "
"case document set."
msgstr ""
"Elk dossier documentset is gelinkt aan een dossier in CiviCRM. De Case ID "
"wordt opgeslagen in dit veld. Je dient wel eerst dit veld in sharepoint aan "
"te maken en te koppelen aan het dossier documentenset."
#: templates/CRM/Sharepoint/Form/Settings.tpl
msgid ""
"The name of the field which holds a link back to civicrm. You should create "
"this field within sharepoint and link it to your contact document set and "
"your case document set"
msgstr ""
"De naam van het veld waarin een link naar CiviCRM wordt opgeslagen. Je dient "
"wel eerst dit veld aan te maken in sharepoint en te koppelen aan de contact "
"en dossier documentensets."
#: templates/CRM/Sharepoint/Form/Settings.tpl
msgid ""
"The name of the title field of a folder (document set) in sharepoint. E.g. "
"Title or Naam"
msgstr ""
"De naam van het titelveld van een map (documentenset) in sharepoint. Bijv. "
"Title of Naam"
#: templates/CRM/Sharepoint/Form/Settings.tpl
msgid ""
"The content type Id of the contact documentset. The contaent type Id starts "
"with '0x0120D5.....'.\n"
" <br />You can create different document sets for cases and for "
"contacts. If you want to use the same enter the same content type Id in both "
"fields."
msgstr ""
"De content type id van het contact documentenset. De content type id start "
"altijd met 0x0120D5....\n"
"<br />Je kan een verschillende documentenset voor dossier en voor contacten "
"aanmaken. Als je dezelfde wil gebruiken vul dan hetzelfde content type id in "
"bij zower contact content type id als bij dossier content type id."
#: templates/CRM/Sharepoint/Form/Settings.tpl
msgid ""
"The content type Id of the case documentset. The contaent type Id starts "
"with '0x0120D5.....'."
msgstr ""
"De content type id van het dossier documentenset. De content type id start "
"altijd met 0x0120D5....\n"
"<br />Je kan een verschillende documentenset voor dossier en voor contacten "
"aanmaken. Als je dezelfde wil gebruiken vul dan hetzelfde content type id in "
"bij zower contact content type id als bij dossier content type id."
# Copyright CiviCRM LLC (c) 2004-2015
# This file is distributed under the same license as the CiviCRM package.
# If you contribute heavily to a translation and deem your work copyrightable,
# make sure you license it to CiviCRM LLC under Academic Free License 3.0.
msgid ""
msgstr ""
"Project-Id-Version: sharepoint\n"
"POT-Creation-Date: 2018-08-10 14:04+0000\n"
"Language-Team: CiviCRM Translators <civicrm-translators@lists.civicrm.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: CRM/Sharepoint/Form/Settings.php
msgid "Url"
msgstr ""
#: CRM/Sharepoint/Form/Settings.php
msgid "Site"
msgstr ""
#: CRM/Sharepoint/Form/Settings.php
msgid "Username"
msgstr ""
#: CRM/Sharepoint/Form/Settings.php
msgid "Passowrd"
msgstr ""
#: CRM/Sharepoint/Form/Settings.php
msgid "Library name"
msgstr ""
#: CRM/Sharepoint/Form/Settings.php
msgid "Contact ID field name"
msgstr ""
#: CRM/Sharepoint/Form/Settings.php
msgid "Case ID field name"
msgstr ""
#: CRM/Sharepoint/Form/Settings.php
msgid "Link To CiviCRM field name"
msgstr ""
#: CRM/Sharepoint/Form/Settings.php
msgid "Title field name"
msgstr ""
#: CRM/Sharepoint/Form/Settings.php
msgid "Content Type ID for the contact documentset"
msgstr ""
#: CRM/Sharepoint/Form/Settings.php
msgid "Content Type ID for the case documentset"
msgstr ""
#: CRM/Sharepoint/Form/Settings.php
msgid "Saved sharepoint settings"
msgstr ""
#: sharepoint.php
msgid "Sharepoint settings"
msgstr ""
#: sharepoint.php
msgid "View Case documents in sharepoint"
msgstr ""
#: sharepoint.php
msgid "View Contact documents in sharepoint"
msgstr ""
#: sharepoint.php
msgid "View in CiviCRM"
msgstr ""
#: templates/CRM/Contact/Page/View/Summary/sharepoint.tpl
msgid "View in Sharepoint"
msgstr ""
#: templates/CRM/Contact/Page/View/Summary/sharepoint.tpl
msgid "Sharepoint"
msgstr ""
#: templates/CRM/Sharepoint/Form/Settings.tpl
msgid "The URL to your sharepoint. E.g. https://mysharepoint.sharepoint.com"
msgstr ""
#: templates/CRM/Sharepoint/Form/Settings.tpl
msgid ""
"The sharepoint site. Leave empty if you wish to use your main sharepoint "
"site. E.g. /sites/mysubsite<br />\n"
" Example if the url to your site is https://example.sharepoint.com/"
"sites/yoursubsite then https://exmaple.sharepoint.com is the url and sites/"
"yoursubsite is the site."
msgstr ""
#: templates/CRM/Sharepoint/Form/Settings.tpl
msgid "The name of the library into which the document sets are stored."
msgstr ""
#: templates/CRM/Sharepoint/Form/Settings.tpl
msgid ""
"Each document set is linked to a contact. The contact ID is stored in this "
"field. You should create your field within sharepoint and link it to your "
"contact documentset and case document set."
msgstr ""
#: templates/CRM/Sharepoint/Form/Settings.tpl
msgid ""
"Each case document set is linked to a case. The case ID is stored in this "
"field. You should create your field within sharepoint and link it to your "
"case document set."
msgstr ""
#: templates/CRM/Sharepoint/Form/Settings.tpl
msgid ""
"The name of the field which holds a link back to civicrm. You should create "
"this field within sharepoint and link it to your contact document set and "
"your case document set"
msgstr ""
#: templates/CRM/Sharepoint/Form/Settings.tpl
msgid ""
"The name of the title field of a folder (document set) in sharepoint. E.g. "
"Title or Naam"
msgstr ""
#: templates/CRM/Sharepoint/Form/Settings.tpl
msgid ""
"The content type Id of the contact documentset. The contaent type Id starts "
"with '0x0120D5.....'.\n"
" <br />You can create different document sets for cases and for "
"contacts. If you want to use the same enter the same content type Id in both "
"fields."
msgstr ""
#: templates/CRM/Sharepoint/Form/Settings.tpl
msgid ""
"The content type Id of the case documentset. The contaent type Id starts "
"with '0x0120D5.....'."
msgstr ""
......@@ -14,7 +14,7 @@ use Office365\PHP\Client\SharePoint\ClientContext;
*/
function sharepoint_civicrm_navigationMenu(&$menu) {
_sharepoint_civix_insert_navigation_menu($menu, 'Administer/System Settings', array(
'label' => E::ts('Sharepoint settings'),
'label' => ts('Sharepoint settings', array('domain' => 'sharepoint')),
'name' => 'sharepoint_settings',
'url' => 'civicrm/admin/sharepoint?reset=1',
'permission' => 'administer CiviCRM',
......@@ -80,12 +80,12 @@ function sharepoint_civicrm_caseSummary($caseId) {
$content = '<p class="sharepoint-links" style="overflow: hidden;">';
$settings = _sharepoint_settings();
if ($caseDocumentSet) {
$content .= '<a href="'.$settings['url'].$caseDocumentSet->Folder->ServerRelativeUrl.'" target="_blank" class="button no-popup">'.ts('View Case documents in sharepoint').'</a>';
$content .= '<a href="'.$settings['url'].$caseDocumentSet->Folder->ServerRelativeUrl.'" target="_blank" class="button no-popup">'.ts('View Case documents in sharepoint', array('domain' => 'sharepoint')).'</a>';
}
$contactDocumentSet = _sharepoint_ensure_contact_documentset($contact_id);
if ($contactDocumentSet) {
$content .= '<a href="'.$settings['url'].$contactDocumentSet->Folder->ServerRelativeUrl.'" target="_blank" class="button no-popup">'.ts('View Contact documents in sharepoint').'</a>';
$content .= '<a href="'.$settings['url'].$contactDocumentSet->Folder->ServerRelativeUrl.'" target="_blank" class="button no-popup">'.ts('View Contact documents in sharepoint', array('domain' => 'sharepoint')).'</a>';
}
$content .= '</p>';
......@@ -201,7 +201,7 @@ function _sharepoint_update_case_documentset(\Office365\PHP\Client\Runtime\Clien
'id' => $case_id,
'action' => 'view'
], TRUE, NULL, FALSE);
$linkToCiviCRM->Description = ts('View in CiviCRM');
$linkToCiviCRM->Description = ts('View in CiviCRM', array('domain' => 'sharepoint'));
$documentSet->setProperty($settings['civicrm_link_field_name'], $linkToCiviCRM);
$qry = new \Office365\PHP\Client\Runtime\UpdateEntityQuery($documentSet);
......@@ -283,7 +283,7 @@ function _sharepoint_update_contact_documentset(\Office365\PHP\Client\Runtime\Cl
'reset' => 1,
'cid' => $contact_id
], TRUE, NULL, FALSE);
$linkToCiviCRM->Description = ts('View in CiviCRM');
$linkToCiviCRM->Description = ts('View in CiviCRM', array('domain' => 'sharepoint'));
$documentSet->setProperty($settings['civicrm_link_field_name'], $linkToCiviCRM);
$qry = new \Office365\PHP\Client\Runtime\UpdateEntityQuery($documentSet);
......
{crmScope extensionKey='sharepoint'}
{capture assign="sharepoint_button"}{strip}
<li class="crm-sharepoint-action crm-contact-sharepoint">
<a href="{$link_to_sharepoint}" class="sharepoint button" target="cd dock_blank" title="{ts}View in Sharepoint{/ts}">
......@@ -13,4 +14,5 @@
cj('li.crm-summary-block').after('{/literal}{$sharepoint_button}{literal}');
});
{/literal}
</script>
\ No newline at end of file
</script>
{/crmScope}
\ No newline at end of file
{* HEADER *}
{crmScope extensionKey='sharepoint'}
<div class="crm-block crm-form-block crm-sharepoint-form-block">
<div class="crm-submit-buttons">
{include file="CRM/common/formButtons.tpl" location="top"}
......@@ -99,3 +100,4 @@
</div>
</div>
{/crmScope}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment