2011-09-20 19:08:31 -04:00
|
|
|
<?php
|
|
|
|
|
/**
|
2012-01-26 09:33:01 -04:00
|
|
|
* Admin controller
|
2011-09-20 19:08:31 -04:00
|
|
|
* @access public
|
|
|
|
|
*/
|
|
|
|
|
class Admin extends Controller
|
|
|
|
|
{
|
|
|
|
|
/**
|
2012-01-26 09:33:01 -04:00
|
|
|
* UX - User experience
|
|
|
|
|
*/
|
2012-03-15 17:45:18 -04:00
|
|
|
|
|
|
|
|
public $debug = true;
|
2012-01-26 09:33:01 -04:00
|
|
|
|
|
|
|
|
public function uxList()
|
|
|
|
|
{
|
2012-01-31 18:45:30 -04:00
|
|
|
require_once PATH_CONTROLLERS . 'adminProxy.php';
|
2012-01-26 09:33:01 -04:00
|
|
|
$this->includeExtJS('admin/uxUsersList');
|
|
|
|
|
G::LoadClass('configuration');
|
2012-01-31 18:45:30 -04:00
|
|
|
|
2012-01-26 09:33:01 -04:00
|
|
|
$c = new Configurations();
|
|
|
|
|
$configPage = $c->getConfiguration('usersList', 'pageSize','',$_SESSION['USER_LOGGED']);
|
|
|
|
|
$Config['pageSize'] = isset($configPage['pageSize']) ? $configPage['pageSize'] : 20;
|
|
|
|
|
|
2012-01-31 18:45:30 -04:00
|
|
|
$this->setJSVar('CONFIG', $Config);
|
|
|
|
|
$this->setJSVar('FORMATS', $c->getFormats());
|
|
|
|
|
$this->setJSVar('uxTypes', AdminProxy::getUxTypesList('list'));
|
2012-01-26 09:33:01 -04:00
|
|
|
|
|
|
|
|
G::RenderPage('publish', 'extJs');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* CALENDAR
|
2011-09-20 19:08:31 -04:00
|
|
|
* getting default list
|
|
|
|
|
* @param string $httpData->PRO_UID (opional)
|
|
|
|
|
*/
|
|
|
|
|
public function calendarEdit($httpData)
|
|
|
|
|
{
|
|
|
|
|
global $RBAC;
|
2012-01-26 09:33:01 -04:00
|
|
|
//$RBAC->requirePermissions('PM_SETUP_ADVANCE');
|
|
|
|
|
G::LoadClass('configuration');
|
|
|
|
|
G::LoadClass('calendar');
|
|
|
|
|
|
2011-09-20 19:08:31 -04:00
|
|
|
$CalendarUid = str_replace ( '"', '', isset ( $_GET ['id'] ) ? $_GET ['id'] : G::GenerateUniqueID () );
|
|
|
|
|
$calendarObj = new calendar ( );
|
|
|
|
|
|
|
|
|
|
if ((isset ( $_GET ['id'] )) && ($_GET ['id'] != "")) {
|
|
|
|
|
$fields = $calendarObj->getCalendarInfoE ( $CalendarUid );
|
|
|
|
|
$fields ['OLD_NAME'] = $fields['CALENDAR_NAME'];
|
|
|
|
|
}
|
2012-01-26 09:33:01 -04:00
|
|
|
if (!isset($fields['CALENDAR_UID'])) { //For a new Calendar
|
2011-09-20 19:08:31 -04:00
|
|
|
$fields ['CALENDAR_UID'] = $CalendarUid;
|
|
|
|
|
$fields ['OLD_NAME'] = '';
|
|
|
|
|
|
|
|
|
|
//Default Business Hour
|
|
|
|
|
$fields ['BUSINESS_DAY'] [1] ['CALENDAR_BUSINESS_DAY'] = 7;
|
|
|
|
|
$fields ['BUSINESS_DAY'] [1] ['CALENDAR_BUSINESS_START'] = "09:00";
|
|
|
|
|
$fields ['BUSINESS_DAY'] [1] ['CALENDAR_BUSINESS_END'] = "17:00";
|
|
|
|
|
}
|
|
|
|
|
if ((isset ( $_GET ['cp'] )) && ($_GET ['cp'] == 1)) { // Copy Calendar
|
|
|
|
|
$fields ['CALENDAR_UID'] = G::GenerateUniqueID ();
|
|
|
|
|
$fields ['CALENDAR_NAME'] = G::LoadTranslation ( "ID_COPY_OF" ) . " " . $fields ['CALENDAR_NAME'];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$c = new Configurations();
|
|
|
|
|
$configPage = $c->getConfiguration('additionalTablesList', 'pageSize','',$_SESSION['USER_LOGGED']);
|
|
|
|
|
$Config['pageSize'] = isset($configPage['pageSize']) ? $configPage['pageSize'] : 20;
|
|
|
|
|
|
|
|
|
|
$this->includeExtJS('admin/calendarEdit');
|
|
|
|
|
$this->setView('admin/calendarEdit');
|
2012-01-26 09:33:01 -04:00
|
|
|
$businessDayArray = array();
|
2011-09-20 19:08:31 -04:00
|
|
|
|
2012-01-26 09:33:01 -04:00
|
|
|
for($i=0;$i<sizeof($fields['BUSINESS_DAY']);$i++) {
|
|
|
|
|
$businessDayArray[$i] = $fields['BUSINESS_DAY'][$i+1];
|
|
|
|
|
}
|
2011-09-20 19:08:31 -04:00
|
|
|
|
|
|
|
|
$fields['BUSINESS_DAY'] = $businessDayArray;
|
2011-10-28 17:41:03 -04:00
|
|
|
//validating if the calendar is new, it means that we don't have the $_GET array
|
|
|
|
|
$fields['HOLIDAY']=(isset ( $_GET['id'] )&&$_GET['id']!='')?$fields['HOLIDAY']:array();
|
|
|
|
|
$holidayArray = array();
|
|
|
|
|
for($i=0;$i<sizeof($fields['HOLIDAY']);$i++) {
|
|
|
|
|
$holidayArray[$i] = $fields['HOLIDAY'][$i+1];
|
|
|
|
|
|
|
|
|
|
}
|
2011-09-20 19:08:31 -04:00
|
|
|
|
2011-10-28 17:41:03 -04:00
|
|
|
$_GET ['id']= (isset ( $_GET['id'] )&&$_GET['id']!='')?$_GET['id']:'';
|
2011-09-20 19:08:31 -04:00
|
|
|
$fields['HOLIDAY'] = $holidayArray;
|
|
|
|
|
$fields['NEWCALENDAR'] = 'NO';
|
2011-10-28 17:41:03 -04:00
|
|
|
if(isset ( $_GET['id'] )&&$_GET['id']=='') {
|
2011-09-20 19:08:31 -04:00
|
|
|
$fields['CALENDAR_UID'] = G::GenerateUniqueID();
|
|
|
|
|
$fields['NEWCALENDAR'] = 'YES';
|
|
|
|
|
}
|
|
|
|
|
$this->setJSVar('CALENDAR_UID',$fields['CALENDAR_UID']);
|
|
|
|
|
$this->setJSVar('fields',$fields);
|
|
|
|
|
|
|
|
|
|
G::RenderPage('publish', 'extJs');
|
|
|
|
|
}
|
2012-03-15 17:45:18 -04:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* getting email configuration
|
|
|
|
|
* @autor Alvaro <alvaro@colosa.com>
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
public function emails()
|
|
|
|
|
{
|
|
|
|
|
global $RBAC;
|
|
|
|
|
|
|
|
|
|
$RBAC->requirePermissions('PM_SETUP_ADVANCE');
|
|
|
|
|
$this->includeExtJS('admin/emails');
|
|
|
|
|
//render content
|
|
|
|
|
G::RenderPage('publish', 'extJs');
|
|
|
|
|
}
|
2011-10-28 17:41:03 -04:00
|
|
|
}
|