• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP w2p_Utilities_Date类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中w2p_Utilities_Date的典型用法代码示例。如果您正苦于以下问题:PHP w2p_Utilities_Date类的具体用法?PHP w2p_Utilities_Date怎么用?PHP w2p_Utilities_Date使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了w2p_Utilities_Date类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: getEventLinks

/**
 * Sub-function to collect events within a period
 * @param Date the starting date of the period
 * @param Date the ending date of the period
 * @param array by-ref an array of links to append new items to
 * @param int the length to truncate entries by
 * @author Andrew Eddie <[email protected]>
 */
function getEventLinks($startPeriod, $endPeriod, &$links, $notUsed = null, $minical = false)
{
    global $event_filter;
    $events = CEvent::getEventsForPeriod($startPeriod, $endPeriod, $event_filter);
    $cwd = explode(',', w2PgetConfig('cal_working_days'));
    // assemble the links for the events
    foreach ($events as $row) {
        $start = new w2p_Utilities_Date($row['event_start_date']);
        $end = new w2p_Utilities_Date($row['event_end_date']);
        $date = $start;
        for ($i = 0, $i_cmp = $start->dateDiff($end); $i <= $i_cmp; $i++) {
            // the link
            // optionally do not show events on non-working days
            if ($row['event_cwd'] && in_array($date->getDayOfWeek(), $cwd) || !$row['event_cwd']) {
                if ($minical) {
                    $link = array();
                } else {
                    $url = '?m=calendar&a=view&event_id=' . $row['event_id'];
                    $link['href'] = '';
                    $link['alt'] = '';
                    $link['text'] = w2PtoolTip($row['event_name'], getEventTooltip($row['event_id']), true) . w2PshowImage('event' . $row['event_type'] . '.png', 16, 16, '', '', 'calendar') . '</a>&nbsp;' . '<a href="' . $url . '"><span class="event">' . $row['event_name'] . '</span></a>' . w2PendTip();
                }
                $links[$date->format(FMT_TIMESTAMP_DATE)][] = $link;
            }
            $date = $date->getNextDay();
        }
    }
}
开发者ID:caseysoftware,项目名称:web2project-planner,代码行数:36,代码来源:links_events.php


示例2: formatDate

 private function formatDate($mysqlDate)
 {
     $myDate = new w2p_Utilities_Date($mysqlDate);
     $myDatetime = $myDate->format('%Y%m%d %T');
     $myDatetime = str_replace(':', '', $myDatetime);
     $myDatetime = str_replace(' ', 'T', $myDatetime) . 'Z';
     return $myDatetime;
 }
开发者ID:eureka2,项目名称:web2project,代码行数:8,代码来源:iCalendar.class.php


示例3: hook_preStore

 protected function hook_preStore()
 {
     if ($this->budget_start_date) {
         $date = new w2p_Utilities_Date($this->budget_start_date);
         $this->budget_start_date = $date->format(FMT_DATETIME_MYSQL);
     }
     if ($this->budget_end_date) {
         $date = new w2p_Utilities_Date($this->budget_end_date);
         $this->budget_end_date = $date->format(FMT_DATETIME_MYSQL);
     }
     parent::hook_preStore();
 }
开发者ID:illuminate3,项目名称:web2project,代码行数:12,代码来源:budgets.class.php


示例4: calcDuration

function calcDuration($start_date, $start_hour, $start_minute, $end_date, $end_hour, $end_minute, $duration_type)
{
    $year = substr($start_date, 0, 4);
    $month = substr($start_date, 4, 2);
    $day = substr($start_date, 6, 2);
    $startDate = new w2p_Utilities_Date($year . '-' . $month . '-' . $day);
    $startDate->setTime($start_hour, $start_minute);
    $year = substr($end_date, 0, 4);
    $month = substr($end_date, 4, 2);
    $day = substr($end_date, 6, 2);
    $endDate = new w2p_Utilities_Date($year . '-' . $month . '-' . $day);
    $endDate->setTime($end_hour, $end_minute);
    $duration = $startDate->calcDuration($endDate);
    if (intval($duration_type) == 24) {
        $workHours = intval(w2PgetConfig('daily_working_hours'));
        $duration = $duration / $workHours;
    }
    $response = new xajaxResponse();
    $response->assign('task_duration', 'value', $duration);
    return $response;
}
开发者ID:viniciusbudines,项目名称:sisnuss,代码行数:21,代码来源:ajax_functions.php


示例5: clickDay

$titleBlock->show();
?>

<script language="javascript" type="text/javascript">
function clickDay( uts, fdate ) {
	window.location = './index.php?m=calendar&a=day_view&date='+uts+'&tab=0';
}
function clickWeek( uts, fdate ) {
	window.location = './index.php?m=calendar&a=week_view&date='+uts;
}
</script>

<table cellspacing="0" cellpadding="0" border="0" width="100%"><tr><td>
<?php 
// establish the focus 'date'
$date = new w2p_Utilities_Date($date);
// prepare time period for 'events'
// "go back" to the first day shown on the calendar
// and "go forward" to the last day shown on the calendar
$first_time = new w2p_Utilities_Date($date);
$first_time->setDay(1);
$first_time->setTime(0, 0, 0);
// if Sunday is the 1st, we don't need to go back
// as that's the first day shown on the calendar
if ($first_time->getDayOfWeek() != 0) {
    $last_day_of_previous_month = $first_time->getPrevDay();
    $day_of_previous_month = $last_day_of_previous_month->getDayOfWeek();
    $seconds_to_sub_in_previous_month = 86400 * $day_of_previous_month;
    // need to cast it to int because Pear::Date_Span::set down the line
    // fails to set the seconds correctly
    $last_day_of_previous_month->subtractSeconds((int) $seconds_to_sub_in_previous_month);
开发者ID:viniciusbudines,项目名称:sisnuss,代码行数:31,代码来源:index.php


示例6: CForum

}
$forum = new CForum();
$forum->load($forum_id);
$project = new CProject();
$project->load($forum->forum_project);
$messages = $forum->getMessages(null, $forum_id, $message_id, $sort);
// get the prefered date format
$df = $AppUI->getPref('SHDATEFORMAT');
$df .= ' ' . $AppUI->getPref('TIMEFORMAT');
$pdfdata = array();
$pdfhead = array('Date', 'User', 'Message');
foreach ($messages as $row) {
    // Find the parent message - the topic.
    if ($row['message_id'] == $message_id) {
        $topic = $row['message_title'];
    }
    $date = new w2p_Utilities_Date($AppUI->formatTZAwareTime($row['message_date'], '%Y-%m-%d %T'));
    $pdfdata[] = array($date->format($df), $row['contact_display_name'], '<b>' . $row['message_title'] . '</b>' . "\n" . $row['message_body']);
}
$font_dir = W2P_BASE_DIR . '/lib/ezpdf/fonts';
$temp_dir = W2P_BASE_DIR . '/files/temp';
$output = new w2p_Output_PDFRenderer();
$pdf = $output->getPDF();
$pdf->selectFont($font_dir . '/Helvetica.afm');
$pdf->ezText('Project: ' . $project->project_name);
$pdf->ezText('Forum: ' . $forum->forum_name);
$pdf->ezText('Topic: ' . $topic);
$pdf->ezText('');
$options = array('showLines' => 1, 'showHeadings' => 1, 'fontSize' => 8, 'rowGap' => 2, 'colGap' => 5, 'xPos' => 35, 'xOrientation' => 'right', 'width' => '400', 'cols' => array(0 => array('justification' => 'left', 'width' => 75), 1 => array('justification' => 'left', 'width' => 100), 2 => array('justification' => 'left', 'width' => 350)));
$pdf->ezTable($pdfdata, $pdfhead, null, $options);
$pdf->ezStream(array('Content-Disposition' => 'forum-thread-' . $forum_id . '.pdf'));
开发者ID:illuminate3,项目名称:web2project,代码行数:31,代码来源:view_pdf.php


示例7: __construct

 public function __construct($datetime = null, $tz = '')
 {
     parent::__construct($datetime, $tz);
     trigger_error("CDate has been deprecated in v2.0 and will be removed by v4.0. Please use w2p_Utilities_Date instead.", E_USER_NOTICE);
 }
开发者ID:,项目名称:,代码行数:5,代码来源:


示例8: w2p_Utilities_Date

        $df = $AppUI->getPref('SHDATEFORMAT');
        $df .= ' ' . $AppUI->getPref('TIMEFORMAT');
        $contact_updatekey = $carr[$z][$x]['contact_updatekey'];
        $contact_lastupdate = $carr[$z][$x]['contact_lastupdate'];
        $contact_updateasked = $carr[$z][$x]['contact_updateasked'];
        $last_ask = new w2p_Utilities_Date($contact_updateasked);
        $lastAskFormatted = $last_ask->format($df);
        if (count($projectList) > 0) {
            echo '<a href="" onclick="	window.open(\'./index.php?m=public&a=selector&dialog=1&callback=goProject&table=projects&user_id=' . $carr[$z][$x]['contact_id'] . '\', \'selector\', \'left=50,top=50,height=250,width=400,resizable\');return false;">' . w2PshowImage('projects.png', '', '', $m, 'click to view projects associated with this contact') . '</a>';
        }
        if ($contact_updateasked && (!$contact_lastupdate || $contact_lastupdate == 0) && $contact_updatekey) {
            echo w2PtoolTip('info', 'Waiting for Contact Update Information. (Asked on: ' . $lastAskFormatted . ')') . '<img src="' . w2PfindImage('log-info.gif') . '" style="float: right;">' . w2PendTip();
        } elseif ($contact_updateasked && (!$contact_lastupdate || $contact_lastupdate == 0) && !$contact_updatekey) {
            echo w2PtoolTip('info', 'Waiting for too long! (Asked on ' . $lastAskFormatted . ')') . '<img src="' . w2PfindImage('log-error.gif') . '" style="float: right;">' . w2PendTip();
        } elseif ($contact_updateasked && !$contact_updatekey) {
            $last_ask = new w2p_Utilities_Date($contact_lastupdate);
            echo w2PtoolTip('info', 'Update sucessfully done on: ' . $last_ask->format($df) . '') . '<img src="' . w2PfindImage('log-notice.gif') . '" style="float: right;">' . w2PendTip();
        }
        ?>
                                                    </span>
												</th>
											</table>
										</td>
									</tr>
									<tr>
										<?php 
        reset($showfields);
        $s = '';
        while (list($key, $val) = each($showfields)) {
            if (mb_strlen($carr[$z][$x][$key]) > 0) {
                if ($val == 'contact_email') {
开发者ID:viniciusbudines,项目名称:sisnuss,代码行数:31,代码来源:index.php


示例9: w2p_Utilities_Date

         $upd_task->task_allow_other_user_tasklogs = $bulk_task_allow_other_user_tasklogs;
         $result = $upd_task->store($AppUI);
         if (is_array($result)) {
             break;
         }
     }
 }
 //Action: Other Actions
 if (isset($_POST['bulk_task_other']) && $bulk_task_other != '') {
     if ($upd_task->task_id) {
         //Option 1 - Mark as finished
         if ($bulk_task_other == '1') {
             $upd_task->task_percent_complete = 100;
             if (!$upd_task->task_end_date || $upd_task->task_end_date == '0000-00-00 00:00:00') {
                 $end_date = null;
                 $end_date = new w2p_Utilities_Date();
                 $upd_task->task_end_date = $end_date->format(FMT_DATETIME_MYSQL);
             }
             $result = $upd_task->store($AppUI);
             if (is_array($result)) {
                 break;
             }
             //Option 2 - Mark as milestone
         } elseif ($bulk_task_other == '2') {
             $upd_task->task_milestone = 1;
             $result = $upd_task->store($AppUI);
             if (is_array($result)) {
                 break;
             }
             //Option 3 - Mark as non milestone
         } elseif ($bulk_task_other == '3') {
开发者ID:eureka2,项目名称:web2project,代码行数:31,代码来源:do_task_bulk_aed.php


示例10: addHelpDeskTaskLog

 public function addHelpDeskTaskLog()
 {
     global $helpdesk_available;
     if ($helpdesk_available && $this->file_helpdesk_item != 0) {
         // create task log with information about the file that was uploaded
         $task_log = new CHDTaskLog();
         $task_log->overrideDatabase($this->_query);
         $task_log->task_log_help_desk_id = $this->_hditem->item_id;
         if ($this->_message != 'deleted') {
             $task_log->task_log_name = 'File ' . $this->file_name . ' uploaded';
         } else {
             $task_log->task_log_name = 'File ' . $this->file_name . ' deleted';
         }
         $task_log->task_log_description = $this->file_description;
         $task_log->task_log_creator = $this->_AppUI->user_id;
         $date = new w2p_Utilities_Date();
         $task_log->task_log_date = $date->format(FMT_DATETIME_MYSQL);
         if ($msg = $task_log->store()) {
             $this->_AppUI->setMsg($msg, UI_MSG_ERROR);
         }
     }
     return null;
 }
开发者ID:,项目名称:,代码行数:23,代码来源:


示例11: array

<?php 
$tabview = array('either', 'tabbed', 'flat');
echo arraySelect($tabview, 'pref_name[TABVIEW]', 'class=text size=1', $prefs['TABVIEW'], true);
?>
	</td>
</tr>

<tr>
	<td align="right"><?php 
echo $AppUI->_('Short Date Format');
?>
:</td>
	<td>
<?php 
// exmample date
$ex = new w2p_Utilities_Date();
$dates = array();
$f = '%d/%m/%Y';
$dates[$f] = $ex->format($f);
$f = '%d/%b/%Y';
$dates[$f] = $ex->format($f);
$f = '%m/%d/%Y';
$dates[$f] = $ex->format($f);
$f = '%b/%d/%Y';
$dates[$f] = $ex->format($f);
$f = '%d.%m.%Y';
$dates[$f] = $ex->format($f);
$f = '%m.%d.%Y';
$dates[$f] = $ex->format($f);
$f = '%Y/%b/%d';
$dates[$f] = $ex->format($f);
开发者ID:,项目名称:,代码行数:31,代码来源:


示例12: clash_suggest

function clash_suggest(w2p_Core_CAppUI $AppUI, $cal_sdf)
{
    global $m, $a;
    $obj = new CEvent();
    $obj->bind($_SESSION['add_event_post']);
    $start_date = new w2p_Utilities_Date($obj->event_start_date);
    $end_date = new w2p_Utilities_Date($obj->event_end_date);
    $df = $AppUI->getPref('SHDATEFORMAT');
    $start_secs = $start_date->getTime();
    $end_secs = $end_date->getTime();
    $duration = (int) (($end_secs - $start_secs) / 60);
    $titleBlock = new w2p_Theme_TitleBlock('Suggest Alternative Event Time', 'myevo-appointments.png', $m, $m . '.' . $a);
    $titleBlock->show();
    $calurl = W2P_BASE_URL . '/index.php?m=calendar&a=clash&event_id=' . $obj->event_id;
    $times = array();
    $t = new w2p_Utilities_Date();
    $t->setTime(0, 0, 0);
    if (!defined('LOCALE_TIME_FORMAT')) {
        define('LOCALE_TIME_FORMAT', '%I:%M %p');
    }
    for ($m = 0; $m < 60; $m++) {
        $times[$t->format('%H%M%S')] = $t->format(LOCALE_TIME_FORMAT);
        $t->addSeconds(1800);
    }
    /* TODO: This needs to be refactored to use the core setDate_new function. */
    ?>
    <script language="javascript" type="text/javascript">
    function setDate( frm_name, f_date ) {
        fld_date = eval( 'document.' + frm_name + '.' + f_date );
        fld_real_date = eval( 'document.' + frm_name + '.' + 'event_' + f_date );
        if (fld_date.value.length>0) {
          if ((parseDate(fld_date.value))==null) {
                alert('The Date/Time you typed does not match your prefered format, please retype.');
                fld_real_date.value = '';
                fld_date.style.backgroundColor = 'red';
            } else {
                fld_real_date.value = formatDate(parseDate(fld_date.value), 'yyyyMMdd');
                fld_date.value = formatDate(parseDate(fld_date.value), '<?php 
    echo $cal_sdf;
    ?>
');
                fld_date.style.backgroundColor = '';
            }
        } else {
            fld_real_date.value = '';
        }
    }

    function set_clash_action(action) {
        document.editFrm.clash_action.value = action;
        document.editFrm.submit();
    }

    </script>
    <form name="editFrm" method="post" action="<?php 
    echo $calurl . '&clash_action=process';
    ?>
" accept-charset="utf-8">
    <table width='100%' class='std addedit'>
    <tr>
      <td width='50%' align='right'><?php 
    echo $AppUI->_('Earliest Date');
    ?>
:</td>
      <td width='50%' align='left' nowrap="nowrap">
        <input type="hidden" name="event_start_date" id="event_start_date" value="<?php 
    echo $start_date ? $start_date->format(FMT_TIMESTAMP_DATE) : '';
    ?>
" />
        <input type="text" name="start_date" id="start_date" onchange="setDate('editFrm', 'start_date');" value="<?php 
    echo $start_date ? $start_date->format($df) : '';
    ?>
" class="text" />
        <a href="javascript: void(0);" onclick="return showCalendar('start_date', '<?php 
    echo $df;
    ?>
', 'editFrm', null, true)">
        <img src="<?php 
    echo w2PfindImage('calendar.gif');
    ?>
" width="24" height="12" alt="<?php 
    echo $AppUI->_('Calendar');
    ?>
" border="0" />
          </a>
      </td>
    </tr>
    <tr>
      <td width='50%' align='right'><?php 
    echo $AppUI->_('Latest Date');
    ?>
:</td>
      <td width='50%' align='left' nowrap="nowrap">
        <input type="hidden" name="event_end_date" id="event_end_date" value="<?php 
    echo $end_date ? $end_date->format(FMT_TIMESTAMP_DATE) : '';
    ?>
" />
        <input type="text" name="end_date" id="end_date" onchange="setDate('editFrm', 'end_date');" value="<?php 
    echo $end_date ? $end_date->format($df) : '';
    ?>
//.........这里部分代码省略.........
开发者ID:caseysoftware,项目名称:web2project-planner,代码行数:101,代码来源:clash.php


示例13: showWeeks

function showWeeks()
{
    global $allocated_hours_sum, $end_date, $start_date, $AppUI, $user_list, $user_names, $user_usage, $hideNonWd, $table_header, $table_rows, $df, $working_days_count, $total_hours_capacity, $total_hours_capacity_all;
    $working_days_count = 0;
    $allocated_hours_sum = 0;
    $ed = new w2p_Utilities_Date(Date_Calc::endOfWeek($end_date->day, $end_date->month, $end_date->year));
    $sd = new w2p_Utilities_Date(Date_Calc::beginOfWeek($start_date->day, $start_date->month, $start_date->year));
    $week_difference = ceil($ed->workingDaysInSpan($sd) / count(explode(',', w2PgetConfig('cal_working_days'))));
    $actual_date = $sd;
    $table_header = '<tr><th>' . $AppUI->_('User') . '</th>';
    for ($i = 0; $i < $week_difference; $i++) {
        $actual_date->addSeconds(168 * 3600);
        // + one week
        $working_days_count = $working_days_count + count(explode(',', w2PgetConfig('cal_working_days')));
    }
    $table_header .= '<th nowrap="nowrap" colspan="2">' . $AppUI->_('Allocated') . '</th></tr>';
    $table_rows = '';
    foreach ($user_list as $user_id => $user_data) {
        $user_names[$user_id] = $user_data['contact_first_name'] . ' ' . $user_data['contact_last_name'];
        if (isset($user_usage[$user_id])) {
            $table_rows .= '<tr><td nowrap="nowrap">(' . $user_data['user_username'] . ') ' . $user_data['contact_first_name'] . ' ' . $user_data['contact_last_name'] . '</td>';
            $actual_date = $sd;
            $array_sum = array_sum($user_usage[$user_id]);
            $average_user_usage = number_format($array_sum / ($week_difference * count(explode(',', w2PgetConfig('cal_working_days'))) * w2PgetConfig('daily_working_hours')) * 100, 2);
            $allocated_hours_sum += $array_sum;
            $bar_color = 'blue';
            if ($average_user_usage > 100) {
                $bar_color = 'red';
                $average_user_usage = 100;
            }
            $table_rows .= '<td ><div align="left">' . round($array_sum, 2) . ' ' . $AppUI->_('hours') . '</td> <td align="right"> ' . $average_user_usage;
            $table_rows .= '%</div>';
            $table_rows .= '<div align="left" style="height:2px;width:' . $average_user_usage . '%; background-color:' . $bar_color . '">&nbsp;</div></td>';
            $table_rows .= '</tr>';
        }
    }
    $total_hours_capacity = $working_days_count / 2 * w2PgetConfig('daily_working_hours') * count($user_usage);
    $total_hours_capacity_all = $working_days_count / 2 * w2PgetConfig('daily_working_hours') * count($user_list);
}
开发者ID:viniciusbudines,项目名称:sisnuss,代码行数:39,代码来源:cleanup_functions.php


示例14: foreach

     $res = $task->getAssignedUsers($task_id);
     foreach ($res as $rw) {
         switch ($rw['perc_assignment']) {
             case 100:
                 $caption .= $rw['contact_display_name'] . ';';
                 break;
             default:
                 $caption .= $rw['contact_display_name'] . ' [' . $rw['perc_assignment'] . '%];';
                 break;
         }
     }
     $q->clear();
     $caption = mb_substr($caption, 0, mb_strlen($caption) - 1);
 }
 if ($flags == 'm') {
     $start = new w2p_Utilities_Date($start);
     $start->addDays(0);
     $s = $start->format($df);
     if ($caller == 'todo') {
         $gantt->addMilestone(array($name, $pname, '', $s, $s), $a['task_start_date']);
     } else {
         $gantt->addMilestone(array($name, '', $s, $s), $a['task_start_date']);
     }
 } else {
     $type = $a['task_duration_type'];
     $dur = $a['task_duration'];
     if ($type == 24) {
         $dur *= $w2Pconfig['daily_working_hours'];
     }
     if ($showWork == '1') {
         $work_hours = 0;
开发者ID:,项目名称:,代码行数:31,代码来源:


示例15: w2p_Utilities_Date

$no_modify = false;
$start_date = new w2p_Utilities_Date('2001-01-01 00:00:00');
$end_date = new w2p_Utilities_Date('2100-12-31 23:59:59');
// assemble the links for the events
$events = CEvent::getEventsForPeriod($start_date, $end_date, 'all', 0, $project_id);
$start_hour = w2PgetConfig('cal_day_start');
$end_hour = w2PgetConfig('cal_day_end');
$tf = $AppUI->getPref('TIMEFORMAT');
$df = $AppUI->getPref('SHDATEFORMAT');
$types = w2PgetSysVal('EventType');
$html = '<table cellspacing="1" cellpadding="2" border="0" width="100%" class="tbl">';
$html .= '<tr><th>' . $AppUI->_('Date') . '</th><th>' . $AppUI->_('Type') . '</th><th>' . $AppUI->_('Event') . '</th></tr>';
foreach ($events as $row) {
    $html .= '<tr>';
    $start = new w2p_Utilities_Date($row['event_start_date']);
    $end = new w2p_Utilities_Date($row['event_end_date']);
    $html .= '<td width="25%" nowrap="nowrap">' . $start->format($df . ' ' . $tf) . '&nbsp;-&nbsp;';
    $html .= $end->format($df . ' ' . $tf) . '</td>';
    $href = '?m=calendar&a=view&event_id=' . $row['event_id'];
    $alt = $row['event_description'];
    $html .= '<td width="10%" nowrap="nowrap">';
    $html .= w2PshowImage('event' . $row['event_type'] . '.png', 16, 16, '', '', 'calendar');
    $html .= '&nbsp;<b>' . $AppUI->_($types[$row['event_type']]) . '</b><td>';
    $html .= w2PtoolTip($row['event_title'], getEventTooltip($row['event_id']), true);
    $html .= '<a href="' . $href . '" class="event">';
    $html .= $row['event_title'];
    $html .= '</a>';
    $html .= w2PendTip();
    $html .= '</td></tr>';
}
$html .= '</table>';
开发者ID:viniciusbudines,项目名称:sisnuss,代码行数:31,代码来源:projects_tab.view.events.php


示例16: die

/* $Id$ $URL$ */
if (!defined('W2P_BASE_DIR')) {
    die('You should not access this file directly.');
}
$del = (int) w2PgetParam($_POST, 'del', 0);
$obj = new CEvent();
if (!$obj->bind($_POST)) {
    $AppUI->setMsg($obj->getError(), UI_MSG_ERROR);
    $AppUI->redirect();
}
if ($obj->event_start_date) {
    $start_date = new w2p_Utilities_Date($obj->event_start_date . $_POST['start_time']);
    $obj->event_start_date = $start_date->format(FMT_DATETIME_MYSQL);
}
if ($obj->event_end_date) {
    $end_date = new w2p_Utilities_Date($obj->event_end_date . $_POST['end_time']);
    $obj->event_end_date = $end_date->format(FMT_DATETIME_MYSQL);
}
$action = $del ? 'deleted' : 'stored';
$clashRedirect = false;
if ($del) {
    $result = $obj->delete();
} else {
    if ($_POST['event_assigned'] > '' && ($clash = $obj->checkClash($_POST['event_assigned']))) {
        $last_a = $a;
        $GLOBALS['a'] = "clash";
        $clashRedirect = true;
    } else {
        $result = $obj->store();
        if (isset($_POST['event_assigned'])) {
            $obj->updateAssigned(explode(',', $_POST['event_assigned']));
开发者ID:caseysoftware,项目名称:web2project-planner,代码行数:31,代码来源:do_event_aed.php


示例17: w2PgetParam

$today = $ctoday->format(FMT_TIMESTAMP_DATE);
$date = w2PgetParam($_GET, 'date', $today);
// establish the focus 'date'
$this_day = new w2p_Utilities_Date($date);
$dd = $this_day->getDay();
$mm = $this_day->getMonth();
$yy = $this_day->getYear();
// get current week
$this_week = Date_calc::beginOfWeek($dd, $mm, $yy, FMT_TIMESTAMP_DATE, LOCALE_FIRST_DAY);
// prepare time period for 'events'
$first_time = clone $this_day;
$first_time->setTime(0, 0, 0);
$last_time = clone $this_day;
$last_time->setTime(23, 59, 59);
$prev_day = new w2p_Utilities_Date(Date_calc::prevDay($dd, $mm, $yy, FMT_TIMESTAMP_DATE));
$next_day = new w2p_Utilities_Date(Date_calc::nextDay($dd, $mm, $yy, FMT_TIMESTAMP_DATE));
// get the list of visible companies
$company = new CCompany();
global $companies;
$companies = $company->getAllowedRecords($AppUI->user_id, 'company_id,company_name', 'company_name');
$companies = arrayMerge(array('0' => $AppUI->_('All')), $companies);
// setup the title block
$titleBlock = new CTitleBlock('Day View', 'myevo-appointments.png', $m, $m . '.' . $a);
$titleBlock->addCrumb('?m=calendar&a=year_view&date=' . $this_day->format(FMT_TIMESTAMP_DATE), 'year view');
$titleBlock->addCrumb('?m=calendar&date=' . $this_day->format(FMT_TIMESTAMP_DATE), 'month view');
$titleBlock->addCrumb('?m=calendar&a=week_view&date=' . $this_week, 'week view');
$titleBlock->addCrumb('?m=calendar&a=day_view&date=' . $this_day->format(FMT_TIMESTAMP_DATE), 'day view');
$titleBlock->addCell($AppUI->_('Company') . ':');
$titleBlock->addCell(arraySelect($companies, 'company_id', 'onChange="document.pickCompany.submit()" class="text"', $company_id), '', '<form action="' . $_SERVER['REQUEST_URI'] . '" method="post" name="pickCompany" accept-charset="utf-8">', '</form>');
$titleBlock->addCell('<input type="submit" class="button" value="' . $AppUI->_('new event') . '">', '', '<form action="?m=calendar&a=addedit&date=' . $this_day->format(FMT_TIMESTAMP_DATE) . '" method="post" accept-charset="utf-8">', '</form>');
$titleBlock->show();
开发者ID:eureka2,项目名称:web2project,代码行数:31,代码来源:day_view.php


示例18: w2p_Utilities_Date

        echo $AppUI->_('My Info');
        ?>
</span></a>
                                                </td>
                                                <?php 
        if (canAccess('tasks')) {
            ?>
                                                    <td nowrap="nowrap" align="right">
                                                    <a class="button" href="./index.php?m=tasks&amp;a=todo"><span><b><?php 
            echo $AppUI->_('Todo');
            ?>
</b></span></a>
                                                    </td><?php 
        }
        if (canAccess('calendar')) {
            $now = new w2p_Utilities_Date();
            ?>
                                                    <td nowrap="nowrap" align="right">
                                                        <a class="button" href="./index.php?m=calendar&amp;a=day_view&amp;date=<?php 
            echo $now->format(FMT_TIMESTAMP_DATE);
            ?>
"><span><?php 
            echo $AppUI->_('Today');
            ?>
</span></a>
                                                    </td><?php 
        }
        ?>
                                                <td nowrap="nowrap" align="right">
                                                    <a class="button" href="./index.php?logout=-1"><span><?php 
        echo $AppUI->_('Logout');
开发者ID:viniciusbudines,项目名称:sisnuss,代码行数:31,代码来源:header.php


示例19: die

along with web2Project; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/
if (!defined('W2P_BASE_DIR')) {
    die('You should not access this file directly');
}
global $AppUI, $w2Pconfig, $cal_df, $cf;
// check permissions for this module
$perms =& $AppUI->acl();
$canView = canView($m);
$canAddProject = $perms->checkModuleItem('projects', 'add', $project_id);
if (!$canView) {
    $AppUI->redirect('m=public&a=access_denied');
}
$AppUI->loadCalendarJS();
$today = new w2p_Utilities_Date();
$today->convertTZ($AppUI->getPref('TIMEZONE'));
//Lets load the users panel viewing options
$q = new w2p_Database_Query();
$q->addTable('project_designer_options', 'pdo');
$q->addQuery('pdo.*');
$q->addWhere('pdo.pd_option_user = ' . (int) $AppUI->user_id);
$view_options = $q->loadList();
$project_id = (int) w2PgetParam($_POST, 'project_id', 0);
$project_id = (int) w2PgetParam($_GET, 'project_id', $project_id);
$extra = array('where' => 'project_active = 1');
$project = new CProject();
$projects = $project->getAllowedRecords($AppUI->user_id, 'projects.project_id,project_name', 'project_name', null, $extra, 'projects');
$q = new w2p_Database_Query();
$q->addTable('projects');
$q->addQuery('projects.project_id, company_name');
开发者ID:,项目名称:,代码行数:31,代码来源:


示例20: store

 /**
  * Stores the current task log in the database updating the task_log_updated
  * field appropriately. Then updates total hours worked cache on task.
  *
  * @return void
  *
  * @access public
  */
 public function store()
 {
     $this->_error = $this->check();
     if (count($this->_error)) {
         return $this->_error;
     }
     $q = $this->_getQuery();
     $this->task_log_updated = $q->dbfnNowWithTZ();
     if ($this->task_log_date) {
         $date = new w2p_Utilities_Date($this->task_log_date);
         $this->task_log_date = $date->format(FMT_DATETIME_MYSQL);
     }
     $dot = strpos($this->task_log_hours, ':');
     if ($dot > 0) {
         $log_duration_minutes = sprintf('%.3f', substr($this->task_log_hours, $dot + 1) / 60.0);
         $this->task_log_hours = floor($this->task_log_hours) + $log_duration_minutes;
     }
     $this->task_log_hours = $this->task_log_hours;
     $this->task_log_costcode = cleanText($this->task_log_costcode);
     if ($this->{$this->_tbl_key} && $this->_perms->checkModuleItem($this->_tbl_module, 'edit', $this->{$this->_tbl_key})) {
         if ($msg = parent::store()) {
             $this->_error['store-check'] = $msg;
         } else {
             $stored = true;
             $this->updateTaskSummary($this->_AppUI, $this->task_log_task);
         }
     }
     if (0 == $this->{$this->_tbl_key} && $this->_perms->checkModuleItem($this->_tbl_module, 'add')) {
         $this->task_log_created = $q->dbfnNowWithTZ();
         if ($msg = parent::store()) {
             $this->_error['store-check'] = $msg;
         } else {
             $stored = true;
             $this->updateTaskSummary(null, $this->task_log_task);
         }
     }
     return $stored;
 }
开发者ID:,项目名称:,代码行数:46,代码来源:



注:本文中的w2p_Utilities_Date类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP wAvatar类代码示例发布时间:2022-05-23
下一篇:
PHP w2p_Theme_TitleBlock类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap