Пример #1
0
" target="_blank"><?php 
    echo module_calendar::link_calendar('finance_recurring', array('debit' => 1));
    ?>
</a>
</p>
<hr>
<p><?php 
    _e('Here is the URL for <strong>Weekly Finance Summary</strong> (ie: amount invoiced, earnt and spent at the end of each week).');
    ?>
</p>
<p>
    <a href="<?php 
    echo module_calendar::link_calendar('finance_summary', array());
    ?>
" target="_blank"><?php 
    echo module_calendar::link_calendar('finance_summary', array());
    ?>
</a>
</p>

<?php 
} else {
    ?>

    <p>
        <?php 
    _e('Please install the <a href="%s" target="_blank">Finance Plugin</a> to receive more financial reporting in the calendar.', 'http://codecanyon.net/item/ucm-plugin-finance-manager/1396831?ref=dtbaker');
    ?>
    </p>

<?php 
Пример #2
0
    if (isset($_POST['start_date_time']) && $_POST['start_date_time']) {
        $start_time = js2PhpTime($_POST['start_date_time']);
        $calendar['start'] = $start_time;
    }
    if (isset($_POST['end_date_time']) && $_POST['end_date_time']) {
        $end_time = js2PhpTime($_POST['end_date_time']);
        $calendar['end'] = $end_time;
    }
    if (isset($_POST['is_all_day']) && $_POST['is_all_day']) {
        $calendar['is_all_day'] = $_POST['is_all_day'];
    }
    if (isset($_POST['title']) && $_POST['title']) {
        $calendar['subject'] = $_POST['title'];
    }
}
if ($calendar_id && module_calendar::can_i('edit', 'Calendar') || !$calendar_id && module_calendar::can_i('create', 'Calendar')) {
    // perms are good to go!
} else {
    die('Permission denied');
}
?>
<form action="" method="post" id="calendar_event_form">
<?php 
module_form::set_required(array('fields' => array('subject' => 'Subject', 'start' => 'Start Date', 'end' => 'End Date')));
$customer_list = array();
$customers = module_customer::get_customers();
foreach ($customers as $customer) {
    $customer_list[$customer['customer_id']] = $customer['customer_name'];
}
$staff_members = module_user::get_staff_members();
$staff_member_rel = array();
Пример #3
0
      <div id="calhead" style="padding-left:1px;padding-right:1px;">
            <div class="cHead"><div class="ftitle">&nbsp;</div>
            <div id="loadingpannel" class="ptogtitle loadicon" style="display: none;"><?php 
_e('Loading data...');
?>
</div>
             <div id="errorpannel" class="ptogtitle loaderror" style="display: none;"><?php 
_e('Sorry, could not load your data, please try again later');
?>
</div>
            </div>

            <div id="caltoolbar" class="ctoolbar">
              <?php 
if (module_calendar::can_i('create', 'Calendar')) {
    ?>
<div id="faddbtn" class="fbutton">
                <div><span title='Click to Create New Event' class="addcal">
                <?php 
    _e('New Event');
    ?>
                </span></div>
            </div>
              <?php 
}
?>
                <div class="btnseparator"></div>
             <div id="showtodaybtn" class="fbutton">
                <div><span title='Click to back to today ' class="showtoday">
                <?php 
Пример #4
0
 public function process()
 {
     if ("ajax_calendar" == $_REQUEST['_process'] && module_calendar::can_i('view', 'Calendar')) {
         // ajax functions from wdCalendar. copied from the datafeed.php sample files.
         header('Content-type: text/javascript');
         $ret = array();
         $method = isset($_REQUEST['method']) ? $_REQUEST['method'] : false;
         switch ($method) {
             case "quick_add":
                 if (module_calendar::can_i('create', 'Calendar')) {
                     $ret = addCalendar($_POST["CalendarStartTime"], $_POST["CalendarEndTime"], $_POST["CalendarTitle"], $_POST["IsAllDayEvent"]);
                 }
                 break;
             case "list":
                 $ret = listCalendar($_POST["showdate"], $_POST["viewtype"]);
                 break;
             case "quick_update":
                 if (module_calendar::can_i('edit', 'Calendar')) {
                     $ret = updateCalendar($_POST["calendarId"], $_POST["CalendarStartTime"], $_POST["CalendarEndTime"]);
                 }
                 break;
             case "quick_remove":
                 if (module_calendar::can_i('delete', 'Calendar')) {
                     $ret = removeCalendar($_POST["calendarId"]);
                 }
                 break;
         }
         echo json_encode($ret);
         exit;
     }
     if ("save_calendar_entry" == $_REQUEST['_process']) {
         header('Content-type: text/javascript');
         $calendar_id = isset($_REQUEST['calendar_id']) ? (int) $_REQUEST['calendar_id'] : 0;
         $response = array();
         if ($calendar_id && module_calendar::can_i('edit', 'Calendar') || !$calendar_id && module_calendar::can_i('create', 'Calendar')) {
             $data = $_REQUEST;
             if (isset($data['start'])) {
                 $start_time = $data['start'];
                 if (isset($data['start_time']) && (!isset($data['is_all_day']) || !$data['is_all_day'])) {
                     $data['is_all_day'] = 0;
                     $time_hack = $data['start_time'];
                     $time_hack = str_ireplace(_l("am"), '', $time_hack);
                     $time_hack = str_ireplace(_l("pm"), '', $time_hack);
                     $bits = explode(':', $time_hack);
                     if (strpos($data['end_time'], _l("pm"))) {
                         if ($bits[0] < 12) {
                             $bits[0] += 12;
                         }
                     }
                     // add the time if it exists
                     $start_time .= ' ' . implode(':', $bits) . ':00';
                     $data['start'] = strtotime(input_date($start_time, true));
                 } else {
                     $data['start'] = strtotime(input_date($start_time));
                 }
             }
             if (isset($data['end'])) {
                 $end_time = $data['end'];
                 if (isset($data['end_time']) && (!isset($data['is_all_day']) || !$data['is_all_day'])) {
                     $data['is_all_day'] = 0;
                     $time_hack = $data['end_time'];
                     $time_hack = str_ireplace(_l("am"), '', $time_hack);
                     $time_hack = str_ireplace(_l("pm"), '', $time_hack);
                     $bits = explode(':', $time_hack);
                     if (strpos($data['end_time'], _l("pm"))) {
                         if ($bits[0] < 12) {
                             $bits[0] += 12;
                         }
                     }
                     // add the time if it exists
                     $end_time .= ' ' . implode(':', $bits) . ':00';
                     //echo $end_time;
                     $data['end'] = strtotime(input_date($end_time, true));
                 } else {
                     $data['end'] = strtotime(input_date($end_time));
                 }
             }
             if (!$data['start'] || !$data['end']) {
                 $response['message'] = 'Missing Date';
             } else {
                 //print_r($_REQUEST); print_r($data); exit;
                 $calendar_id = update_insert('calendar_id', $calendar_id, 'calendar', $data);
                 if ($calendar_id) {
                     // save staff members.
                     $staff_ids = isset($_REQUEST['staff_ids']) && is_array($_REQUEST['staff_ids']) ? $_REQUEST['staff_ids'] : array();
                     delete_from_db('calendar_user_rel', 'calendar_id', $calendar_id);
                     foreach ($staff_ids as $staff_id) {
                         if ((int) $staff_id > 0) {
                             $sql = "INSERT INTO `" . _DB_PREFIX . "calendar_user_rel` SET calendar_id = " . (int) $calendar_id . ", user_id = " . (int) $staff_id;
                             query($sql);
                         }
                     }
                     $response['calendar_id'] = $calendar_id;
                     $response['message'] = 'Success';
                 } else {
                     $response['message'] = 'Error Saving';
                 }
             }
         } else {
             $response['message'] = 'Access Denied';
         }
         echo json_encode($response);
         exit;
     }
 }
Пример #5
0
 * Copyright: dtbaker 2012
 * Licence: Please check CodeCanyon.net for licence details. 
 * More licence clarification available here:  http://codecanyon.net/wiki/support/legal-terms/licensing-terms/ 
 * Deploy: 9809 f200f46c2a19bb98d112f2d32a8de0c4
 * Envato: 4ffca17e-861e-4921-86c3-8931978c40ca
 * Package Date: 2015-11-25 02:55:20 
 * IP Address: 67.79.165.254
 */
header('Content-type: text/calendar; charset=utf-8');
header('Content-Disposition: inline; filename="calfull.ics"');
$calendar_entries = array();
$login = false;
// is this a calendar event for a specific staff member?
if (isset($options['staff_id']) && (int) $options['staff_id'] > 0 && isset($options['staff_hash']) && !empty($options['staff_hash'])) {
    // check hash matches again. even though this is already done in the external hook part of calednar.php
    if ($options['staff_hash'] == module_calendar::staff_hash($options['staff_id'])) {
        // correct! log this user in, temporarily for the query and then log them out again.
        module_security::user_id_temp_set($options['staff_id']);
        $login = true;
    }
}
// get 4 months either side of todays date.
for ($x = -4; $x <= 4; $x++) {
    $ret = listCalendar(date('m/d/Y', strtotime('+' . $x . ' months')), 'month');
    if (is_array($ret) && isset($ret['events']) && count($ret['events'])) {
        $calendar_entries = array_merge($calendar_entries, $ret['events']);
    }
}
if ($login) {
    module_security::user_id_temp_restore();
}