Commit 72b970f1 authored by Jonny Bradley's avatar Jonny Bradley

[MRG] Automatic merge, branches/15.x 58454 to 58478

Conflict fixed in comment in tiki-send_newsletters.php
parent 286c88c8
......@@ -2241,6 +2241,8 @@ lib/core/Reports/Send/EmailBuilder/TrackerItemComment.php -text
lib/core/Reports/Send/EmailBuilder/TrackerItemModified.php -text
lib/core/Reports/Send/EmailBuilder/WikiFileAttached.php -text
lib/core/Reports/Send/EmailBuilder/WikiPageChanged.php -text
lib/core/Reports/Send/EmailBuilder/WikiPageCreated.php -text
lib/core/Reports/Send/EmailBuilder/WikiPageDeleted.php -text
lib/core/Reports/Send/EmailBuilder/index.php -text
lib/core/Reports/Send/index.php -text
lib/core/Reports/Users.php -text
......
<?php
// (c) Copyright 2002-2016 by authors of the Tiki Wiki CMS Groupware Project
//
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
// $Id$
/**
* Class for wiki_page_created events
*/
class Reports_Send_EmailBuilder_WikiPageCreated extends Reports_Send_EmailBuilder_Abstract
{
public function getTitle()
{
return tr('Wiki pages created:');
}
public function getOutput(array $change)
{
$base_url = $change['data']['base_url'];
$output = tr(
"%0 created the wikipage %1",
"<u>{$change['data']['editUser']}</u>",
"<a href=\"{$base_url}tiki-index.php?page={$change['data']['pageName']}\">{$change['data']['pageName']}</a>"
);
return $output;
}
}
<?php
// (c) Copyright 2002-2016 by authors of the Tiki Wiki CMS Groupware Project
//
// All Rights Reserved. See copyright.txt for details and a complete list of authors.
// Licensed under the GNU LESSER GENERAL PUBLIC LICENSE. See license.txt for details.
// $Id$
/**
* Class for wiki_page_deleted events
*/
class Reports_Send_EmailBuilder_WikiPageDeleted extends Reports_Send_EmailBuilder_Abstract
{
public function getTitle()
{
return tr('Wiki pages deleted:');
}
public function getOutput(array $change)
{
$base_url = $change['data']['base_url'];
$output = tr(
"%0 deleted the wikipage %1",
"<u>{$change['data']['editUser']}</u>",
"{$change['data']['pageName']}"
);
return $output;
}
}
......@@ -1496,7 +1496,7 @@ class UsersLib extends TikiLib
$ret = true;
$ret &= $this->ldap_sync_user($user, $pass);
$ret &= $this->ldap_sync_groups($user, $pass);
$ret &= $this->_ldap_sync_groups($user, $pass);
// Invalidate cache
$cachelib = TikiLib::lib('cache');
......
......@@ -862,7 +862,12 @@ function wikiplugin_tracker($data, $params)
} else {
$unfiltered = array('data' => array());
foreach ($outf as $fieldId) {
$unfiltered['data'][] = $definition->getField($fieldId);
$fieldTemp = $definition->getField($fieldId);
if ($fieldTemp) {
$unfiltered['data'][] = $fieldTemp;
} else {
TikiLib::lib('errorreport')->report(tr('Tracker: Field #%0 not found in fields parameter or template', $fieldId));
}
}
}
......@@ -1173,10 +1178,22 @@ function wikiplugin_tracker($data, $params)
if (!empty($emailOptions[2])) { //tpl
$emailOptions[2] = preg_split('/ *, */', $emailOptions[2]);
foreach ($emailOptions[2] as $ieo=>$eo) {
if (!preg_match('/\.tpl$/', $eo)) {
$emailOptions[2][$ieo] = $eo.'.tpl';
if (strpos($eo, 'wiki:') !== 0) {
if (!preg_match('/\.tpl$/', $eo)) {
$emailOptions[2][$ieo] = $eo . '.tpl';
}
$tplSubject[$ieo] = str_replace('.tpl', '_subject.tpl', $emailOptions[2][$ieo]);
} else {
if (! $tikilib->page_exists(substr($eo, 5))) {
TikiLib::lib('errorreport')->report(tr('Missing wiki email template page "%0"', htmlspecialchars($wiki)));
$emailOptions[2][$ieo] = 'tracker_changed_notification.tpl';
} else {
$subject_name = str_replace('tpl', 'subject tpl', $emailOptions[2][$ieo]);
if ($tikilib->page_exists(substr($subject_name, 5))) {
$tplSubject[$ieo] = $subject_name;
}
}
}
$tplSubject[$ieo] = str_replace('.tpl', '_subject.tpl', $emailOptions[2][$ieo]);
}
} else {
$emailOptions[2] = array('tracker_changed_notification.tpl');
......@@ -1188,15 +1205,23 @@ function wikiplugin_tracker($data, $params)
$smarty->assign('mail_date', $tikilib->now);
$smarty->assign('mail_itemId', $rid);
foreach ($emailOptions[1] as $ieo=>$ueo) {
@$mail_data = $smarty->fetch('mail/'.$tplSubject[$itpl]);
if (empty($mail_data))
$mail_data = tra('Tracker was modified at '). $_SERVER["SERVER_NAME"];
$mailDir = strpos($tplSubject[$itpl], 'wiki:') !== 0 ? 'mail/' : '';
@$mail_data = $smarty->fetch($mailDir .$tplSubject[$itpl]);
if (empty($mail_data)) {
$mail_data = tra('Tracker was modified at '). $_SERVER['SERVER_NAME'];
} else {
$mail_data = trim(str_replace('&nbsp;', ' ', strip_tags($mail_data))); // tidy
}
$mail->setSubject($mail_data);
$mail_data = $smarty->fetch('mail/'.$emailOptions[2][$itpl]);
$mailDir = strpos($emailOptions[2][$itpl], 'wiki:') !== 0 ? 'mail/' : ''; // wiki pages dont start with wiki:
$mail_data = $smarty->fetch($mailDir .$emailOptions[2][$itpl]);
if ($emailformat == 'html') {
$mail->setHtml($mail_data);
$mail->setHtml($mail_data, strip_tags($mail_data));
} else {
$mail->setText($mail_data);
if (strpos($emailOptions[2][$itpl], 'wiki:') === 0) {
$mail_data = str_replace('&nbsp;', ' ', strip_tags($mail_data));
}
$mail->setText($mail_data);
}
try {
$mail->send($ueo);
......
......@@ -141,7 +141,9 @@ class WikiRenderer
}
}
if ($tikilib->user_has_perm_on_object($this->user, $navigation_info['home']['pageName'], 'wiki page', 'tiki_p_edit', 'tiki_p_edit_structures'))
$this->smartyassign('struct_editable', 'y');
$this->smartyassign('struct_editable', 'a'); # a stands for both perms: tiki_p_edit and tiki_p_edit_structures
else if ($tikilib->user_has_perm_on_object($this->user, $navigation_info['home']['pageName'], 'wiki page', 'tiki_p_edit_structures'))
$this->smartyassign('struct_editable', 'y'); # y stands for only tiki_p_edit_structures perm (but not tiki_p_edit)
else
$this->smartyassign('struct_editable', 'n');
// To show position
......
......@@ -41,7 +41,7 @@
</a>
{/section}
</div>
{if $struct_editable eq 'y'}
{if $struct_editable eq 'a'}
<div class="pull-right">
<form action="tiki-editpage.php" method="post" role="form" class="form-inline">
<div class="form-group">
......@@ -65,6 +65,10 @@
</div>
</form>
</div>
{else}
{if $struct_editable eq 'y'}
<span class="pull-right">{self_link _script="tiki-edit_structure.php" page_ref_id=$home_info.page_ref_id _class="tips" _title="{tr}Manage Stucture{/tr}:{$home_info.pageName} ($cur_pos)"}{icon name="structure"}{/self_link}</span>
{/if}
{/if}
</div>
</div>
......@@ -422,7 +422,7 @@ if ( isset($_REQUEST["send"]) && ! empty($_REQUEST["sendingUniqId"]) || $resend
if (isset($_REQUEST['resume'])) {
// for this throttle resume case the editionId, sendfrom and replyto addresses (if used) are added to the tiki-send_newsletter.php URL in the .tpl
$edition_info = $nllib->get_edition($_REQUEST['resume']);
// if they are set the replyto and sendfrom parameter contents are added to edition_info
// if they are set the replyto and sendfrom parameter contents are added to edition_info
if (!empty($_REQUEST['replyto']) && $_REQUEST['replyto'] != "undefined") {
$edition_info['replyto'] = $_REQUEST['replyto'];
}
......
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