예제 #1
0
 /** @deprecated */
 public static function renderContactList(w2p_Core_CAppUI $AppUI, array $contactList)
 {
     $output = '<table cellspacing="1" cellpadding="2" border="0" width="100%" class="tbl">';
     $output .= '<tr><th>' . $AppUI->_('Name') . '</th><th>' . $AppUI->_('Email') . '</th>';
     $output .= '<th>' . $AppUI->_('Phone') . '</th><th>' . $AppUI->_('Department') . '</th></tr>';
     foreach ($contactList as $contact_id => $contact_data) {
         $contact = new CContact();
         $contact->contact_id = $contact_id;
         $output .= '<tr>';
         $output .= '<td class="hilite"><a href="index.php?m=contacts&amp;a=addedit&amp;contact_id=' . $contact_id . '">' . $contact_data['contact_order_by'] . '</a></td>';
         $output .= '<td class="hilite">' . w2p_email($contact_data['contact_email']) . '</td>';
         $output .= '<td class="hilite">' . $contact_data['contact_phone'] . '</td>';
         $output .= '<td class="hilite">' . $contact_data['dept_name'] . '</td>';
         $output .= '</tr>';
     }
     $output .= '</table>';
     return $output;
 }
예제 #2
0
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) : '';
    ?>
" class="text" />
        <a href="javascript: void(0);" onclick="return showCalendar('end_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->_('Earliest Start Time');
    ?>
:</td>
      <td width='50%' align='left'>
        <?php 
    echo arraySelect($times, 'start_time', 'size="1" class="text"', $start_date->format('%H%M%S'));
    ?>
      </td>
    </tr>
    <tr>
      <td width='50%' align='right'><?php 
    echo $AppUI->_('Latest Finish Time');
    ?>
:</td>
      <td width='50%' align='left'>
        <?php 
    echo arraySelect($times, 'end_time', 'size="1" class="text"', $end_date->format('%H%M%S'));
    ?>
      </td>
    </tr>
    <tr>
      <td width='50%' align='right'><?php 
    echo $AppUI->_('Duration');
    ?>
:</td>
      <td width='50%' align='left'>
        <input type="text" class="text" size="5" name="duration" value="<?php 
    echo $duration;
    ?>
" />
        <?php 
    echo $AppUI->_('minutes');
    ?>
      </td>
    </tr>
    <tr>
      <td><input type="button" value="<?php 
    echo $AppUI->_('cancel');
    ?>
" class="button" onclick="set_clash_action('cancel');" /></td>
      <td align="right"><input type="button" value="<?php 
    echo $AppUI->_('submit');
    ?>
" class="button" onclick="set_clash_action('process')" /></td>
    </tr>
    </table>
    <input type='hidden' name='clash_action' value='cancel' />
    </form>
    <?php 
}
예제 #3
0
<?php

require_once 'base.php';
require_once W2P_BASE_DIR . '/includes/config.php';
require_once W2P_BASE_DIR . '/includes/main_functions.php';
require_once W2P_BASE_DIR . '/includes/db_adodb.php';
$AppUI = new w2p_Core_CAppUI();
$updatekey = w2PgetParam($_GET, 'updatekey', 0);
$updatekey = preg_replace("/[^A-Za-z0-9]/", "", $updatekey);
$contact_id = CContact::getContactByUpdatekey($updatekey);
$company_id = intval(w2PgetParam($_REQUEST, 'company_id', 0));
$company_name = w2PgetParam($_REQUEST, 'company_name', null);
// check permissions for this record
if (!$contact_id) {
    echo $AppUI->_('You are not authorized to use this page. If you should be authorized please contact') . ' ' . $w2Pconfig['company_name'] . ' ' . $AppUI->_('to give you another valid link, thank you.');
    exit;
}
// load the record data
$msg = '';
$row = new CContact();
if (!$row->load($contact_id) && $contact_id > 0) {
    $AppUI->setMsg('Contact');
    $AppUI->setMsg('invalidID', UI_MSG_ERROR, true);
    $AppUI->redirect();
} else {
    //TODO: replace with the proper canEdit()
    if ($row->contact_private && $row->contact_owner != $AppUI->user_id && $row->contact_owner && $contact_id != 0) {
        // check only owner can edit
        $AppUI->redirect(ACCESS_DENIED);
    }
}
예제 #4
0
<?php

/* $Id$ $URL$ */
require_once 'base.php';
require_once W2P_BASE_DIR . '/includes/config.php';
require_once W2P_BASE_DIR . '/includes/main_functions.php';
require_once W2P_BASE_DIR . '/includes/db_adodb.php';
require_once W2P_BASE_DIR . '/classes/ui.class.php';
$AppUI = new w2p_Core_CAppUI();
$updatekey = w2PgetParam($_POST, 'updatekey', 0);
$contact_id = (int) CContact::getContactByUpdatekey($updatekey);
if (!$contact_id) {
    echo $AppUI->_('You are not authorized to use this page. If you should be authorized please contact the sender to give you another valid link, thank you.');
    exit;
}
$contact = new CContact();
if (!$contact->bind($_POST)) {
    $msg = $AppUI->_('There was an error recording your contact data, please contact the system administrator. Thank you very much.');
} else {
    $result = $contact->store();
    if (is_array($result)) {
        $msg = $AppUI->_('There was an error recording your contact data, please contact the system administrator. Thank you very much.');
    } else {
        $custom_fields = new w2p_Core_CustomFields('contacts', 'addedit', $contact->contact_id, 'edit', 1);
        $custom_fields->bind($_POST);
        $custom_fields->store($contact->contact_id);
        $contact->clearUpdateKey();
        $msg = $AppUI->_('Your contact data has been recorded successfully. Your may now close your browser window.  Thank you very much, ' . $contact->contact_first_name);
    }
}
?>
예제 #5
0
 /**
  *
  * @param w2p_Core_CAppUI $AppUI
  * @param CProject $project_id
  *
  * The point of this function is to create/update a task to represent a
  *   subproject.
  *
  */
 public static function storeTokenTask(w2p_Core_CAppUI $AppUI, $project_id)
 {
     $subProject = new CProject();
     //TODO: We need to convert this from static to use ->overrideDatabase() for testing.
     $subProject->load($project_id);
     if ($subProject->project_parent > 0 && $subProject->project_id != $subProject->project_parent) {
         $q = new w2p_Database_Query();
         $q->addTable('tasks');
         $q->addQuery('MIN(task_start_date) AS min_task_start_date');
         $q->addQuery('MAX(task_end_date) AS max_task_end_date');
         $q->addWhere('task_project = ' . $subProject->project_id);
         $q->addWhere('task_status <> -1');
         $projectDates = $q->loadList();
         $q->clear();
         $q->addTable('tasks');
         $q->addQuery('task_id');
         $q->addWhere('task_represents_project = ' . $subProject->project_id);
         $task_id = (int) $q->loadResult();
         $task = new CTask();
         //TODO: We need to convert this from static to use ->overrideDatabase() for testing.
         if ($task_id) {
             $task->load($task_id);
         } else {
             $task->task_description = $task->task_name;
             $task->task_priority = $subProject->project_priority;
             $task->task_project = $subProject->project_parent;
             $task->task_represents_project = $subProject->project_id;
             $task->task_owner = $AppUI->user_id;
         }
         $task->task_name = $AppUI->_('Subproject') . ': ' . $subProject->project_name;
         $task->task_duration_type = 1;
         $task->task_duration = $subProject->project_scheduled_hours;
         $task->task_start_date = $projectDates[0]['min_task_start_date'];
         $task->task_end_date = $projectDates[0]['max_task_end_date'];
         $task->task_percent_complete = $subProject->project_percent_complete;
         $task->store();
         //TODO: we should do something with this store result?
     }
 }
예제 #6
0
<?php

require_once 'base.php';
require_once W2P_BASE_DIR . '/includes/config.php';
require_once W2P_BASE_DIR . '/includes/main_functions.php';
require_once W2P_BASE_DIR . '/includes/db_adodb.php';
$AppUI = new w2p_Core_CAppUI();
if (w2PgetConfig('activate_external_user_creation') != 'true') {
    echo $AppUI->_('You should not access this file directly');
    die;
}
$uistyle = 'web2project';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
       "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
        <title><?php 
echo $AppUI->_('New User Signup');
?>
</title>
        <meta http-equiv="Content-Type" content="text/html;charset=<?php 
echo 'UTF-8';
?>
" />
        <meta http-equiv="Pragma" content="no-cache" />
        <link rel="stylesheet" type="text/css" href="./style/common.css" media="all" charset="utf-8"/>
        <link rel="stylesheet" type="text/css" href="./style/<?php 
echo $uistyle;
?>
/main.css" media="all" charset="utf-8"/>
예제 #7
0
// Can not load the passwordstrength.js file via AppUI->addJavascriptFile()
// because AppUI->loadFooterJS() is never called...
?>
<script type="text/javascript" src="<?php 
echo W2P_BASE_URL;
?>
/js/passwordstrength.js"></script>
<script language="javascript">
function submitIt(){
    var form = document.editFrm;
   if (form.user_username.value.length < <?php 
echo w2PgetConfig('username_min_len');
?>
) {
        alert("<?php 
echo $AppUI->_('Username size is invalid, should be greater than', UI_OUTPUT_JS);
?>
" + ' ' + <?php 
echo w2PgetConfig('username_min_len');
?>
);
        form.user_username.focus();
    } else if (form.user_password.value.length < <?php 
echo w2PgetConfig('password_min_len');
?>
) {
        alert("<?php 
echo $AppUI->_('Password size is invalid, should be greater than', UI_OUTPUT_JS);
?>
" + ' ' + <?php 
echo w2PgetConfig('password_min_len');