Example #1
0
                    }
                }
            }
            echo implode(', ', $rooms);
            echo '</td>' . chr(10);
            echo '  <td class="border">' . $entry['contact_person_name'] . '</td>' . chr(10);
            echo '  <td class="border">' . $entry['contact_person_phone'] . '</td>' . chr(10);
            echo '  <td class="border">' . $entry['contact_person_email'] . '</td>' . chr(10);
            echo ' </tr>' . chr(10);
        }
    }
    echo '</table>' . chr(10);
}
$filters = array();
$filters = addFilter($filters, 'customer_id', $customer['customer_id']);
$filters = addFilter($filters, 'deleted', true);
$SQL = genSQLFromFilters($filters, '*') . ' order by time_start';
$Q_next_entries = mysql_query($SQL);
if (mysql_num_rows($Q_next_entries)) {
    echo '<h2>Slettede bookinger knyttet til ' . $customer['customer_name'] . '</h2>' . chr(10);
    filterLink($filters);
    echo '<br><br>' . chr(10) . chr(10);
    echo '<table style="border-collapse: collapse;">' . chr(10);
    echo ' <tr>' . chr(10);
    echo '  <td class="border"><b>' . __('Starts') . '</b></td>' . chr(10);
    echo '  <td class="border"><b>' . __('Name') . '</b></td>' . chr(10);
    echo '  <td class="border"><b>' . __('Where') . '</b></td>' . chr(10);
    echo '  <td class="border"><b>' . __('Contact person') . '</b></td>' . chr(10);
    echo '  <td class="border"><b>' . __('Phone') . '</b></td>' . chr(10);
    echo '  <td class="border"><b>' . __('E-mail') . '</b></td>' . chr(10);
    echo ' </tr>' . chr(10);
                     }
                 }
             }
             echo implode(', ', $rooms);
             echo '</td>' . chr(10);
             echo '  <td class="border">' . $entry['contact_person_name'] . '</td>' . chr(10);
             echo '  <td class="border">' . $entry['contact_person_phone'] . '</td>' . chr(10);
             echo '  <td class="border">' . $entry['contact_person_email'] . '</td>' . chr(10);
             echo ' </tr>' . chr(10);
         }
     }
     echo '</table>' . chr(10);
 }
 echo '</td>' . '<td>';
 $filters = array();
 $filters = addFilter($filters, 'customer_id', $customer2['customer_id']);
 $SQL = genSQLFromFilters($filters, 'entry_id') . ' order by time_start';
 $Q_next_entries = mysql_query($SQL);
 if (!mysql_num_rows($Q_next_entries)) {
     echo '<i>Ingen</i>' . chr(10);
 } else {
     echo '<span style="color:green">Flyttes til kunde 1:</span><br>';
     echo '<table style="border-collapse: collapse;">' . chr(10);
     echo ' <tr>' . chr(10);
     echo '  <td class="border"><b>' . _('Starts') . '</b></td>' . chr(10);
     echo '  <td class="border"><b>' . _('Name') . '</b></td>' . chr(10);
     echo '  <td class="border"><b>' . _('Where') . '</b></td>' . chr(10);
     echo '  <td class="border"><b>' . _('Contact person') . '</b></td>' . chr(10);
     echo '  <td class="border"><b>' . _('Phone') . '</b></td>' . chr(10);
     echo '  <td class="border"><b>' . _('E-mail') . '</b></td>' . chr(10);
     echo ' </tr>' . chr(10);
Example #3
0
    echo '<a href="admin_user_password.php?id=' . $user['user_id'] . '">' . iconHTML('lock_edit') . ' Endre passord</a><br /><br />' . chr(10) . chr(10);
}
echo '<b>' . __('UserID') . ':</b> ' . $user['user_id'] . '<br>' . chr(10);
echo '<b>' . __('Username') . ':</b> ' . $user['user_name'] . '<br>' . chr(10);
echo '<b>' . __('Short username') . ':</b> ' . $user['user_name_short'] . '<br>' . chr(10);
echo '<b>' . __('E-mail') . ':</b> ' . $user['user_email'] . '<br>' . chr(10);
echo '<b>' . __('Phone') . ':</b> ' . $user['user_phone'] . '<br>' . chr(10);
echo '<b>Stilling:</b> ' . $user['user_position'] . '<br>' . chr(10);
echo '<!-- ';
echo '<br><b>Adresse for internettkalender i Outlook:</b><br><input type="text" size="70" value="' . $systemurl . '/entry_ical.php?user_id=' . $user['user_id'] . '"><br>' . 'Se <a href="' . wikiLink('Bookingsystemet/Bookinger_i_Outlook') . '">guide p&aring; wiki</a> for informasjon om hvordan du legger inn kalenderen' . chr(10);
echo '-->';
echo '<h2>' . __('Upcoming entries for ') . ' ' . $user['user_name'] . '</h2>' . chr(10);
filterMakeAlternatives();
$filters = array();
$filters = addFilter($filters, 'user_assigned', $user['user_id']);
$filters = addFilter($filters, 'time_start', 'current', '>');
filterLink($filters);
echo '<br><br>' . chr(10) . chr(10);
$SQL = genSQLFromFilters($filters, 'entry_id') . ' order by time_start';
$Q_next_entries = mysql_query($SQL);
/*
$Q_next_entries = mysql_query("select entry_id from `entry` where 
	user_assigned like '%;".$user['user_id'].";%' and
	time_start > '".time()."'
	order by time_start
	limit 50;");*/
if (!mysql_num_rows($Q_next_entries)) {
    echo '<i>' . __('No upcoming entries found') . '</i>' . chr(10);
} else {
    echo '<table style="border-collapse: collapse;">' . chr(10);
    echo ' <tr>' . chr(10);
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
*/
require "glob_inc.inc.php";
filterMakeAlternatives();
print_header($day, $month, $year, $area);
$Q = mysql_query("SELECT customer_id FROM `customer` WHERE `slettet` = '0' ORDER BY customer_name");
echo '<h1>' . __('Customers') . '</h1>' . chr(10);
echo '- ' . iconHTML('group_add') . ' <a href="customer_edit.php?returnToCustomerView=1">' . __('Create new customer') . '</a><br><br>' . chr(10);
echo '<table>' . chr(10);
//echo '	<tr>'.chr(10);
//echo '		<td><b>'._('Customer').'</b></td>'.chr(10);
//echo '		<td>&nbsp;</td>'.chr(10);
//echo '	</tr>'.chr(10).chr(10);
while ($R = mysql_fetch_assoc($Q)) {
    $customer = getCustomer($R['customer_id']);
    if (count($customer)) {
        $filter = addFilter(array(), 'customer_id', $customer['customer_id']);
        $filters_serialized = filterSerialized($filter);
        echo '	<tr>' . chr(10);
        echo '		<td><b>' . $customer['customer_id'] . ' </b></td>' . chr(10);
        echo '		<td><b>' . '<a href="customer.php?customer_id=' . $customer['customer_id'] . '">' . iconHTML('group') . ' ' . $customer['customer_name'] . '</a></b></td>' . chr(10);
        echo '		<td><font size="1">' . '<a href="customer_edit.php?customer_id=' . $customer['customer_id'] . '&amp;returnToCustomerList=1">' . iconHTML('group_edit') . ' ' . __('Edit') . '</a>' . ' -:- <a href="entry_list.php?filters=' . $filters_serialized . '">' . iconHTML('page_white') . ' ' . __('View entries') . '</a>' . '</font></td>' . chr(10);
        echo '	</tr>' . chr(10) . chr(10);
    }
}
echo '</table>' . chr(10);
<?php

/*
Plugin Name: Display Demo Notice
Plugin URI:
Description: When in demo mode display "Demo Mode" notice and countdown timer in the footer of all the admin pages
Author:
Version: 1.0
Author URI:
*/
addFilter('execute_seconds', 'plugin_footerDemoModeNotice');
//
function plugin_footerDemoModeNotice($html)
{
    global $TABLE_PREFIX;
    // only show in demo mode
    if (!inDemoMode()) {
        return $html;
    }
    // get minutes remaining
    $secondsRemaining = $_SESSION['demoCreatedTimeAsFloat'] + MAX_DEMO_TIME - time();
    $minutesRemaining = intval($secondsRemaining / 60);
    //
    $html .= "<br/><br/><div style='font-size: 12px; color: #C00'><b>Demo Mode: Some features are disabled. Demo will reset in {$minutesRemaining} minutes.</b></div>";
    return $html;
}
Example #6
0
function clearFilters()
{
    for ($i = 1; $i <= 80; $i++) {
        addFilter($i, '', 0, '', '');
    }
}
<?php

// define globals
global $APP;
//, $SETTINGS, $CURRENT_USER, $TABLE_PREFIX;
$APP['selectedMenu'] = 'admin';
// show admin menu as selected
// check access level - admin only!
if (!$GLOBALS['CURRENT_USER']['isAdmin']) {
    alert(t("You don't have permissions to access this menu."));
    showInterface('');
}
// mailer plugin hooks
addAction('record_preedit', '_ogm_cmsList_customWysiwyg', null, 2);
addFilter('listHeader_displayLabel', '_ogm_cmsList_messageColumn', null, 3);
addFilter('listRow_displayValue', '_ogm_cmsList_messageColumn', null, 4);
addAction('section_preDispatch', '_ogm_showModeNotice', null, 2);
// Prefix Menu with "Admin"
//$GLOBALS['schema']['menuName'] = "Admin &gt; ". $GLOBALS['schema']['menuName'];
// Let regular actionHandler run
$REDIRECT_FOR_CUSTOM_MENUS_DONT_EXIT = true;
return;
//
function _ogm_cmsList_customWysiwyg($tableName, $recordNum)
{
    if ($tableName != '_outgoing_mail') {
        return;
    }
    // skip all tables not related to our plugin
    // force wysiwyg to save full links
    $GLOBALS['SETTINGS']['wysiwyg']['includeDomainInLinks'] = 1;
     }
     echo '<a href="' . $_SERVER['PHP_SELF'] . '?area_id=' . $R['area_id'] . '">' . $R['area_name'] . '</a>';
     if ($area_spesific && $area_invoice['area_id'] == $R['area_id']) {
         echo '</b>';
     }
     if ($counter_area != $num_area) {
         echo ' -:- ';
     }
 }
 echo '<br /><br /></span>';
 $filters = array();
 $filters = addFilter($filters, 'invoice', '1');
 $filters = addFilter($filters, 'invoice_status', '1');
 $filters = addFilter($filters, 'time_end', 'current', '<');
 if ($area_spesific) {
     $filters = addFilter($filters, 'area_id', $area_invoice['area_id']);
 }
 $SQL = genSQLFromFilters($filters, 'entry_id');
 filterLink($filters, 'invoice_tobemade');
 echo '<br>' . chr(10);
 echo '</span>';
 filterPrint($filters);
 echo '<br>' . chr(10);
 echo '<br>' . chr(10) . chr(10);
 $tamed_booking = true;
 foreach ($filters as $filter) {
     if ($filter[0] == 'tamed_booking') {
         $tamed_booking = $filter[1];
     }
 }
 entrylist_invoice_tobemade($SQL, $tamed_booking, $area_spesific);
Example #9
0
    $filters = addFilter($filters, 'invoice', '1');
    $filters = addFilter($filters, 'invoice_status', '1');
    $filters = addFilter($filters, 'time_start', 'current', '<');
    $filters = addFilter($filters, 'area_id', $R['area_id']);
    $SQL = genSQLFromFilters($filters, 'entry_id');
    $area_num_invoice_tobemade = mysql_num_rows(mysql_query($SQL));
    $filters = array();
    $filters = addFilter($filters, 'invoice', '1');
    $filters = addFilter($filters, 'invoice_status', '2');
    $filters = addFilter($filters, 'area_id', $R['area_id']);
    $SQL = genSQLFromFilters($filters, 'entry_id');
    $area_num_invoice_tobemade_ready = mysql_num_rows(mysql_query($SQL));
    $filters = array();
    $filters = addFilter($filters, 'invoice', '1');
    $filters = addFilter($filters, 'invoice_status', '3');
    $filters = addFilter($filters, 'area_id', $R['area_id']);
    $SQL = genSQLFromFilters($filters, 'entry_id');
    $area_num_invoice_exported = mysql_num_rows(mysql_query($SQL));
    unset($SQL, $filters);
    echo '	<tr>' . chr(10);
    echo '		<td><b>' . $R['area_name'] . '</b></td>' . chr(10);
    echo '		<td class="rightalign"><a href="invoice_soon.php?area_id=' . $R['area_id'] . '">' . $area_num_invoice_soon . '</a></td>' . chr(10);
    echo '		<td class="rightalign"><a href="invoice_tobemade.php?area_id=' . $R['area_id'] . '">' . $area_num_invoice_tobemade . '</a></td>' . chr(10);
    echo '		<td class="rightalign"><a href="invoice_tobemade_ready.php?area_id=' . $R['area_id'] . '">' . $area_num_invoice_tobemade_ready . '</a></td>' . chr(10);
    echo '		<td class="rightalign"><a href="invoice_exported.php?area_id=' . $R['area_id'] . '">' . $area_num_invoice_exported . '</a></td>' . chr(10);
    echo '	</tr>' . chr(10) . chr(10);
}
echo '	<tr>' . chr(10);
echo '		<td><b>SUM</b></td>' . chr(10);
echo '		<td class="rightalign"><b><a href="invoice_soon.php?area_id=' . $R['area_id'] . '">' . $num_invoice_soon . '</a></b></td>' . chr(10);
echo '		<td class="rightalign"><b><a href="invoice_tobemade.php?area_id=' . $R['area_id'] . '">' . $num_invoice_tobemade . '</a></b></td>' . chr(10);
<?php

/*
Plugin Name: Remove Accents From Viewer Links
Plugin URI:
Description: Remove accents from characters in viewer links instead of replacing them with a dash.  So é or è becomes e instead of -
Author:
Version: 1.0
Author URI:
*/
addFilter('viewer_link_field_content', 'plugin_rewriteViewerLinks', null, 2);
//
function plugin_rewriteViewerLinks($defaultOutput, $fieldValue)
{
    // reference: http://php.net/manual/en/function.str-replace.php#85431
    $charsToEntities = array('A' => '/&Agrave;|&Aacute;|&Acirc;|&Atilde;|&Auml;|&Aring;/', 'a' => '/&agrave;|&aacute;|&acirc;|&atilde;|&auml;|&aring;/', 'C' => '/&Ccedil;/', 'c' => '/&ccedil;/', 'E' => '/&Egrave;|&Eacute;|&Ecirc;|&Euml;|&AElig;/', 'e' => '/&egrave;|&eacute;|&ecirc;|&euml;|&aelig;/', 'I' => '/&Igrave;|&Iacute;|&Icirc;|&Iuml;/', 'i' => '/&igrave;|&iacute;|&icirc;|&iuml;/', 'N' => '/&Ntilde;/', 'n' => '/&ntilde;/', 'O' => '/&Ograve;|&Oacute;|&Ocirc;|&Otilde;|&Ouml;|&Oslash;/', 'o' => '/&ograve;|&oacute;|&ocirc;|&otilde;|&ouml;|&oslash;/', 'U' => '/&Ugrave;|&Uacute;|&Ucirc;|&Uuml;/', 'u' => '/&ugrave;|&uacute;|&ucirc;|&uuml;/', 'Y' => '/&Yacute;/', 'y' => '/&yacute;|&yuml;/', 'a.' => '/&ordf;/', 'o.' => '/&ordm;/', 'and' => '/&amp;/');
    // remove accents from characters
    $htmlEncodedFieldValue = htmlentities($fieldValue, ENT_NOQUOTES, 'UTF-8');
    $output = preg_replace($charsToEntities, array_keys($charsToEntities), $htmlEncodedFieldValue);
    // perform other formatting
    $output = preg_replace('/[^a-z0-9\\.\\-\\_]+/i', '-', $output);
    // replace any remaining characters with -
    $output = preg_replace('/(^-+|-+$)/', '', $output);
    // remove leading and trailing dashes
    if ($output) {
        $output .= '-';
    }
    // add trailing dash to content
    //
    return $output;
}
Example #11
0
if (isset($_GET['listtype'])) {
    $listtype = $_GET['listtype'];
} elseif (isset($_GET['user_id'])) {
    $listtype = 'user';
} else {
    $listtype = '';
}
$addAdfterSQL = '';
$return_to = 'entry_list';
switch ($listtype) {
    case 'user':
        if (isset($_GET['user_id'])) {
            $tittel = '';
            $filters = array();
            $filters = addFilter($filters, 'user_assigned', $_GET['user_id']);
            $filters = addFilter($filters, 'time_start', mktime(0, 0, 0, date('m'), date('d'), date('Y')), '>');
        }
        break;
    default:
        $tittel = _('Entry list');
        if (!isset($_GET['filters'])) {
            $_GET['filters'] = '';
        }
        $filters = filterGetFromSerialized($_GET['filters']);
        if (!$filters) {
            $filters = array();
        }
        $return_to = 'entry_list';
        break;
}
$SQL = genSQLFromFilters($filters, 'entry_id');
require "include/invoice_top.php";
$section = 'tobemade_ready';
require "include/invoice_menu.php";
echo '<h1>' . _('Ready to be made');
if (isset($_GET['filters'])) {
    echo ' - ' . _('customized list');
    echo '</h1>' . chr(10) . chr(10);
    $filters = filterGetFromSerialized($_GET['filters']);
    if (!$filters) {
        $filters = array();
    }
    $SQL = genSQLFromFilters($filters, 'entry_id');
    filterLink($filters, 'invoice_tobemade_ready');
    echo '<br>' . chr(10);
    filterPrint($filters);
    echo '<br>' . chr(10);
    echo '<br>' . chr(10) . chr(10);
    entrylist_invoice_tobemade_ready($SQL);
} else {
    echo '</h1>' . chr(10) . chr(10);
    $filters = array();
    $filters = addFilter($filters, 'invoice', '1');
    $filters = addFilter($filters, 'invoice_status', '2');
    $SQL = genSQLFromFilters($filters, 'entry_id');
    filterLink($filters, 'invoice_tobemade_ready');
    echo '<br>' . chr(10);
    filterPrint($filters);
    echo '<br>' . chr(10);
    echo '<br>' . chr(10) . chr(10);
    entrylist_invoice_tobemade_ready($SQL);
}
Example #13
0
          <anchor id="log3"/><h2>' . t("current.config") . '</h2><p >' . $var . '
          <anchor id="log4"/><h2>' . t("current.db.consistence.check") . '</h2>
          <p >';
            $res = check_db_constraints();
            if ($res == "") {
                $txt .= "\n          <p>" . t("found.no.problem");
            } else {
                $txt .= $res . '
          <p><a href="?q=about&consistentcheck=true" class="btn">' . t("detailed.report") . '</a>';
            }
        }
    }
    $txt .= '</div>';
    return $txt;
}
addFilter('add_about_text', 'getAboutText');
function getAboutText($txt)
{
    return $txt . '<p>' . t("churchtools.claim") . '<br/>' . t("read.more") . ': <a href="http://www.churchtools.de" target="_clean">www.churchtools.de</a>
  </p>
  ChurchTools 2.0  is licensed under the following license: MIT license
  <br/>The MIT License (MIT)
  <br/>Copyright (c) 2014 Jens Martin Rauen
  <br/>Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
    <br/>The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
    <br/>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
    <br/>ChurchTools Pro is licensed under commercial licence.
    <br/>(C) 2014 Jens Martin Rauen
    </p>';
}
/**
Example #14
0
        foreach ($customer_names as $customer_id => $customer_name) {
            $c = $customer_list[$customer_id];
            echo '	<tr>' . chr(10);
            echo '		<td>';
            if ($c['customer_id'] > 0) {
                echo '<a href="customer.php?customer_id=' . $c['customer_id'] . '">';
            }
            echo $c['customer_name'];
            if ($c['customer_id'] > 0) {
                echo '</a>';
            }
            echo '</td>';
            echo '		<td style="text-align: center;">' . $c['c'] . '&nbsp;/&nbsp;' . $c['a'] . '</td>' . chr(10);
            echo '		<td>';
            $tmpfilter = $filters;
            $tmpfilter = addFilter($tmpfilter, 'customer_id', $c['customer_id']);
            echo '<a href="entry_list.php?filters=' . filterSerialized($tmpfilter) . '">';
            echo $c['e'] . ' boooking';
            if ($c['e'] != '1') {
                echo 'er';
            }
            echo '</a>';
            echo '</td>' . chr(10);
            echo '	</tr>' . chr(10);
        }
    }
    echo '</table>';
}
if (isset($_GET['emaillist']) && $_GET['emaillist'] == 1) {
    echo '<textarea rows="60" cols="150">';
    echo implode("\n", $emaillist_entry);
//, $SETTINGS, $CURRENT_USER, $TABLE_PREFIX;
$APP['selectedMenu'] = 'admin';
// show admin menu as selected
// check access level - admin only!
if (!$GLOBALS['CURRENT_USER']['isAdmin']) {
    alert(t("You don't have permissions to access this menu."));
    showInterface('');
}
// list-page display plugin hooks
addAction('record_preedit', '_emt_cmsList_customWysiwyg', null, 2);
addFilter('listHeader_displayLabel', '_emt_cmsList_messageColumn', null, 3);
addFilter('listRow_displayValue', '_emt_cmsList_messageColumn', null, 4);
// add default templates
emailTemplate_addDefaults();
### Advanced Command: Developers: Export Templates As PHP
addFilter('list_advancedCommands', 'emailTemplatesMenu_addAdvancedOption', null, 1);
function emailTemplatesMenu_addAdvancedOption($labelsToValues)
{
    $labelsToValues[t('Developers: Export Templates As PHP')] = 'emailTemplatesMenu_exportTemplatesPHP';
    $labelsToValues[t('Developers: Show sendMessage() PHP')] = 'emailTemplatesMenu_showSendMessagePHP';
    return $labelsToValues;
}
if (@$_REQUEST['_advancedAction'] == 'emailTemplatesMenu_exportTemplatesPHP') {
    emailTemplatesMenu_exportTemplatesPHP();
}
if (@$_REQUEST['_advancedAction'] == 'emailTemplatesMenu_showSendMessagePHP') {
    emailTemplatesMenu_showSendMessagePHP();
}
// Let regular actionHandler run
$REDIRECT_FOR_CUSTOM_MENUS_DONT_EXIT = true;
return;