diff --git a/modules/stic_Bookings/Utils.js b/modules/stic_Bookings/Utils.js
index 2bb11a52098..0e98f55eb59 100644
--- a/modules/stic_Bookings/Utils.js
+++ b/modules/stic_Bookings/Utils.js
@@ -176,45 +176,46 @@ switch (viewType()) {
previousPlannedEndHours = $("#planned_end_date_hours").val();
previousPlannedEndMinutes = $("#planned_end_date_minutes").val();
- setInterval(function() {
- currentPlannedStartDate = $("#planned_start_date_date").val();
- currentPlannedStartHours = $("#planned_start_date_hours").val();
- currentPlannedStartMinutes = $("#planned_start_date_minutes").val()
- currentPlannedEndDate = $("#planned_end_date_date").val();
- currentPlannedEndHours = $("#planned_end_date_hours").val();
- currentPlannedEndMinutes = $("#planned_end_date_minutes").val()
-
- if (currentPlannedStartDate !== previousPlannedStartDate) {
- $("#start_date_date").val(currentPlannedStartDate).trigger("change");
- previousPlannedStartDate = currentPlannedStartDate;
- }
-
- if (currentPlannedStartHours !== previousPlannedStartHours) {
- $("#start_date_hours").val(currentPlannedStartHours).trigger("change");
- previousPlannedStartHours = currentPlannedStartHours;
- }
-
- if (currentPlannedStartMinutes !== previousPlannedStartMinutes) {
- $("#start_date_minutes").val(currentPlannedStartMinutes).trigger("change");
- previousPlannedStartMinutes = currentPlannedStartMinutes;
- }
- if (currentPlannedEndDate !== previousPlannedEndDate) {
- $("#end_date_date").val(currentPlannedEndDate).trigger("change");
- previousPlannedEndDate = currentPlannedEndDate;
+ setInterval(function () {
+ currentPlannedStartDate = $("#planned_start_date_date").val();
+ currentPlannedStartHours = $("#planned_start_date_hours").val();
+ currentPlannedStartMinutes = $("#planned_start_date_minutes").val();
+ currentPlannedEndDate = $("#planned_end_date_date").val();
+ currentPlannedEndHours = $("#planned_end_date_hours").val();
+ currentPlannedEndMinutes = $("#planned_end_date_minutes").val();
+
+ if (currentPlannedStartDate !== previousPlannedStartDate) {
+ $("#start_date_date").val(currentPlannedStartDate).trigger("change");
+ previousPlannedStartDate = currentPlannedStartDate;
+ }
+
+ if (currentPlannedStartHours !== previousPlannedStartHours) {
+ $("#start_date_hours").val(currentPlannedStartHours).trigger("change");
+ previousPlannedStartHours = currentPlannedStartHours;
+ }
+
+ if (currentPlannedStartMinutes !== previousPlannedStartMinutes) {
+ $("#start_date_minutes")
+ .val(currentPlannedStartMinutes)
+ .trigger("change");
+ previousPlannedStartMinutes = currentPlannedStartMinutes;
}
-
+ if (currentPlannedEndDate !== previousPlannedEndDate) {
+ $("#end_date_date").val(currentPlannedEndDate).trigger("change");
+ previousPlannedEndDate = currentPlannedEndDate;
+ }
+
if (currentPlannedEndHours !== previousPlannedEndHours) {
- $("#end_date_hours").val(currentPlannedEndHours).trigger("change");
- previousPlannedEndHours = currentPlannedEndHours;
+ $("#end_date_hours").val(currentPlannedEndHours).trigger("change");
+ previousPlannedEndHours = currentPlannedEndHours;
}
-
+
if (currentPlannedEndMinutes !== previousPlannedEndMinutes) {
- $("#end_date_minutes").val(currentPlannedEndMinutes).trigger("change");
- previousPlannedEndMinutes = currentPlannedEndMinutes;
+ $("#end_date_minutes").val(currentPlannedEndMinutes).trigger("change");
+ previousPlannedEndMinutes = currentPlannedEndMinutes;
}
+ }, 500);
- }, 500);
-
// Set event listener for center popup
$("#openCenterPopup").click(function () {
openCenterPopup();
@@ -222,6 +223,17 @@ switch (viewType()) {
// Set autofill mark beside field label
setAutofill(["name"]);
+ document
+ .getElementById("place_booking")
+ .addEventListener("change", function () {
+ if (this.checked) {
+ updateResourceFields();
+ $("#openCenterPopup").show();
+ } else {
+ $("#openCenterPopup").hide();
+ updateResourceFields();
+ }
+ });
break;
@@ -376,39 +388,37 @@ function resourceLineWithData(resourcesCount) {
return false;
}
function updateResourceFields() {
- var isPlaceBooking = $("#place_booking").is(":checked");
- var fields = isPlaceBooking ? config_place_fields : config_resource_fields;
-
- var header = "
";
- fields.forEach(function (field) {
- header +=
- "" +
- SUGAR.language.get(
- "stic_Bookings",
- "LBL_RESOURCES_" + field.toUpperCase()
- ) +
- " | ";
- });
- header += " |
";
- $("#resourceLine thead").html(header);
-
- $("#resourceLine tbody").empty();
- resourceMaxCount = 0;
+ var isPlaceBooking = $("#place_booking").is(":checked");
+ var fields = isPlaceBooking ? config_place_fields : config_resource_fields;
- insertResourceLine();
- if (!isPlaceBooking) {
- $("#resourceSearchFields").hide();
- $("#resourceType").val('');
- $("#resourceStatus").val('');
- $("#resourceName").val('');
- $("#numberOfCenters").val('');
- }
+ var header = "";
+ fields.forEach(function (field) {
+ header +=
+ "" +
+ SUGAR.language.get(
+ "stic_Bookings",
+ "LBL_RESOURCES_" + field.toUpperCase()
+ ) +
+ " | ";
+ });
+ header += " |
";
+ $("#resourceLine thead").html(header);
+ $("#resourceLine tbody").empty();
+ resourceMaxCount = 0;
+ insertResourceLine();
+ if (!isPlaceBooking) {
+ $("#resourceSearchFields").hide();
+ $("#resourceType").val("");
+ $("#resourceStatus").val("");
+ $("#resourceName").val("");
+ $("#numberOfCenters").val("");
}
- // Delete a resource row
+}
+// Delete a resource row
function markResourceLineDeleted(ln) {
$("#resourceLine" + ln).remove();
@@ -436,17 +446,29 @@ function openResourceSelectPopup(ln) {
field_to_name_array: field_to_name_array,
};
- var resourceTypes = SUGAR.language.languages['app_list_strings']['stic_resources_types_list'];
+ var resourceTypes =
+ SUGAR.language.languages["app_list_strings"]["stic_resources_types_list"];
var filteredTypes = Object.keys(resourceTypes).filter(function (type) {
- return isPlaceBooking ? type === "places" : type !== "places" && type !== "";
+ return isPlaceBooking
+ ? type === "places"
+ : type !== "places" && type !== "";
});
- var typeQuery = filteredTypes.map(function (type) {
- return "&type_advanced[]=" + encodeURIComponent(type);
- }).join("");
-
- open_popup("stic_Resources", 600, 400, typeQuery, true, false, popupRequestData);
-
+ var typeQuery = filteredTypes
+ .map(function (type) {
+ return "&type_advanced[]=" + encodeURIComponent(type);
+ })
+ .join("");
+
+ open_popup(
+ "stic_Resources",
+ 600,
+ 400,
+ typeQuery,
+ true,
+ false,
+ popupRequestData
+ );
}
function callbackResourceSelectQS(ln) {
@@ -617,18 +639,6 @@ function loadResources() {
);
}
-document
- .getElementById("place_booking")
- .addEventListener("change", function () {
- if (this.checked) {
- updateResourceFields();
- $("#openCenterPopup").show();
- } else {
- $("#openCenterPopup").hide();
- updateResourceFields();
- }
- });
-
$(document).ready(function () {
$("#resourceSearchFields").hide();
$("#openCenterPopup").hide();
@@ -754,25 +764,27 @@ function updateResourceLines(resources) {
});
}
function closeResource(resourceId, bookingId) {
- if (confirm(SUGAR.language.get("stic_Bookings", "LBL_CLOSE_RESOURCE_CONFIRM"))) {
- $.ajax({
- url: "index.php?module=stic_Bookings&action=closeResource&sugar_body_only=true",
- dataType: "json",
- data: {
- record_id: bookingId,
- resource_id: resourceId
- },
- success: function(res) {
- if (res.success) {
- // Recargar la vista de detalle
- window.location.reload();
- } else {
- alert(res.message);
- }
- },
- error: function() {
- alert("Error al cerrar el recurso");
- }
- });
+ if (
+ confirm(SUGAR.language.get("stic_Bookings", "LBL_CLOSE_RESOURCE_CONFIRM"))
+ ) {
+ $.ajax({
+ url: "index.php?module=stic_Bookings&action=closeResource&sugar_body_only=true",
+ dataType: "json",
+ data: {
+ record_id: bookingId,
+ resource_id: resourceId,
+ },
+ success: function (res) {
+ if (res.success) {
+ // Recargar la vista de detalle
+ window.location.reload();
+ } else {
+ alert(res.message);
+ }
+ },
+ error: function () {
+ alert("Error al cerrar el recurso");
+ },
+ });
}
}
diff --git a/modules/stic_Bookings/views/view.edit.php b/modules/stic_Bookings/views/view.edit.php
index cc3b5b0136f..4b9f0f02f80 100644
--- a/modules/stic_Bookings/views/view.edit.php
+++ b/modules/stic_Bookings/views/view.edit.php
@@ -161,6 +161,7 @@ public function parseResourceItems($resourcesBeanArray)
$parsedResources = array();
foreach ($resourcesBeanArray as $resourceBean) {
$resource = array();
+ $resource['resource_id'] = $resourceBean->id;
foreach ($config_resource_fields as $field => $label) {
$value = $resourceBean->$field;
if ($field === 'status' || $field === 'type') {
diff --git a/modules/stic_Bookings_Places_Calendar/Utils.js b/modules/stic_Bookings_Places_Calendar/Utils.js
index fcf121ebdb8..2b1c5ffdd37 100644
--- a/modules/stic_Bookings_Places_Calendar/Utils.js
+++ b/modules/stic_Bookings_Places_Calendar/Utils.js
@@ -52,11 +52,13 @@ function initializeCalendar() {
let occupiedCount = 0;
for (var booking in data[date].occupied) {
- for (var center in data[date].occupied[booking]) {
- occupiedCount += data[date].occupied[booking][center].length;
+
+ for (var prop in data[date].occupied[booking]) {
+ if (Array.isArray(data[date].occupied[booking][prop])) {
+ occupiedCount += data[date].occupied[booking][prop].length;
+ }
}
}
-
events.push({
start: date,
allDay: true,
@@ -93,42 +95,53 @@ function initializeCalendar() {
},
eventDidMount: function (info) {
- var eventData = info.event.title;
+ var eventData = info.event.title;
var title =
'' +
SUGAR.language.translate("app_strings", "LBL_ADDITIONAL_DETAILS") +
"
" +
- '' +
- "
";
+ '';
var occupiedInfo = info.event.extendedProps.occupiedInfo;
var body = "";
for (var booking in occupiedInfo) {
if (occupiedInfo.hasOwnProperty(booking)) {
- body += `${booking}
`;
-
+ if (occupiedInfo[booking].id && occupiedInfo[booking].name) {
+ body += ``;
+ }
var centers = occupiedInfo[booking];
for (var center in centers) {
- if (centers.hasOwnProperty(center)) {
- body += `- ${SUGAR.language.get(
- "stic_Bookings_Places_Calendar",
- "LBL_STIC_CENTERS"
- )}: ${center}
`;
+ if (
+ center !== "id" &&
+ center !== "name" &&
+ centers.hasOwnProperty(center)
+ ) {
+ body += `- ${SUGAR.language.get(
+ "stic_Bookings_Places_Calendar",
+ "LBL_STIC_CENTERS"
+ )}: ${center}
`;
- var resources = centers[center];
- body += ` ${SUGAR.language.get(
- "stic_Bookings_Places_Calendar",
- "LBL_STIC_RESOURCES"
- )}
`;
+ var resources = centers[center];
+ body += `${SUGAR.language.get(
+ "stic_Bookings_Places_Calendar",
+ "LBL_STIC_RESOURCES"
+ )}
`;
+ if (Array.isArray(resources)) {
resources.forEach(function (resource) {
body += `- •${resource}
`;
});
- body += "
";
+ } else {
+ console.warn("Resources is not an array:", resources);
+ if (resources) {
+ body += `- •${resources}
`;
+ }
}
+ body += "
";
}
}
+ }
}
$(info.el).qtip({
content: {
@@ -140,11 +153,11 @@ function initializeCalendar() {
at: "top left",
target: "mouse",
adjust: {
- mouse: false,
+ mouse: false,
},
},
show: {
- solo: true,
+ solo: true,
},
hide: {
event: "mouseleave",
@@ -232,7 +245,7 @@ function initializeCalendar() {
$("#openCenterPopup").click(function () {
openCenterPopup();
});
-var globalCalendar;
+var globalCalendar;
function runCheckInterval() {
var checkIfSearchPaneIsLoaded = setInterval(function () {
@@ -386,24 +399,24 @@ function updateCrossVisibility() {
}
function closeResource(resourceId, bookingId) {
if (confirm(SUGAR.language.get("stic_Bookings", "LBL_CLOSE_RESOURCE_CONFIRM"))) {
- $.ajax({
- url: "index.php?module=stic_Bookings&action=closeResource&sugar_body_only=true",
- dataType: "json",
- data: {
- record_id: bookingId,
- resource_id: resourceId
- },
- success: function(res) {
- if (res.success) {
- // Recargar la vista de detalle
- window.location.reload();
- } else {
- alert(res.message);
- }
- },
- error: function() {
- alert("Error al cerrar el recurso");
- }
- });
+ $.ajax({
+ url: "index.php?module=stic_Bookings&action=closeResource&sugar_body_only=true",
+ dataType: "json",
+ data: {
+ record_id: bookingId,
+ resource_id: resourceId
+ },
+ success: function(res) {
+ if (res.success) {
+ // Recargar la vista de detalle
+ window.location.reload();
+ } else {
+ alert(res.message);
+ }
+ },
+ error: function() {
+ alert("Error al cerrar el recurso");
+ }
+ });
}
}
diff --git a/modules/stic_Bookings_Places_Calendar/controller.php b/modules/stic_Bookings_Places_Calendar/controller.php
index 82de0f3396a..a7ad4c89d5f 100644
--- a/modules/stic_Bookings_Places_Calendar/controller.php
+++ b/modules/stic_Bookings_Places_Calendar/controller.php
@@ -328,11 +328,17 @@ public function action_get_places_availability_data()
$dateKey = date('Y-m-d', strtotime($currentDate));
if (isset($result[$dateKey])) {
if (!isset($result[$dateKey]['occupied'][$resource['title']])) {
- $result[$dateKey]['occupied'][$resource['title']] = array();
+ $result[$dateKey]['occupied'][$resource['title']] = array(
+ 'name' => $resource['title'],
+ 'id' => $resource['recordId'],
+ );
}
if (!isset($result[$dateKey]['occupied'][$resource['title']][$resource['resourceCenterName']])) {
$result[$dateKey]['occupied'][$resource['title']][$resource['resourceCenterName']] = array();
}
+ if (!is_array($result[$dateKey]['occupied'][$resource['title']][$resource['resourceCenterName']])) {
+ $result[$dateKey]['occupied'][$resource['title']][$resource['resourceCenterName']] = array();
+ }
$result[$dateKey]['occupied'][$resource['title']][$resource['resourceCenterName']][] = $resource['resourceName'];
}
$currentDate = date('Y-m-d', strtotime($currentDate . ' +1 day'));
diff --git a/modules/stic_Resources/Menu.php b/modules/stic_Resources/Menu.php
index e94ec524d3c..f677360f60b 100644
--- a/modules/stic_Resources/Menu.php
+++ b/modules/stic_Resources/Menu.php
@@ -44,3 +44,7 @@
if (ACLController::checkAccess('stic_Bookings_Calendar', 'list', true)) {
$module_menu[] = array("index.php?module=stic_Bookings_Calendar&action=index&return_module=stic_Bookings&return_action=index", translate('LBL_ACTION_VIEW_BOOKINGS_CALENDAR', 'stic_Bookings_Calendar'), "Schedule");
}
+
+if (ACLController::checkAccess('stic_Bookings_Places_Calendar', 'list', true)) {
+ $module_menu[] = array("index.php?module=stic_Bookings_Places_Calendar&action=index&return_module=stic_Bookings&return_action=index", translate('LBL_ACTION_VIEW_BOOKINGS_PLACES_CALENDAR', 'stic_Bookings_Places_Calendar'), "Schedule");
+}
\ No newline at end of file
diff --git a/modules/stic_Resources/metadata/listviewdefs.php b/modules/stic_Resources/metadata/listviewdefs.php
index 6112c44ceb4..2907027bed7 100644
--- a/modules/stic_Resources/metadata/listviewdefs.php
+++ b/modules/stic_Resources/metadata/listviewdefs.php
@@ -21,106 +21,143 @@
* You can contact SinergiaTIC Association at email address info@sinergiacrm.org.
*/
$module_name = 'stic_Resources';
-$listViewDefs[$module_name] =
-array(
- 'NAME' => array(
- 'width' => '20%',
- 'label' => 'LBL_NAME',
- 'default' => true,
- 'link' => true,
- ),
- 'CODE' => array(
- 'type' => 'varchar',
- 'label' => 'LBL_CODE',
- 'width' => '10%',
- 'default' => true,
- ),
- 'STATUS' => array(
- 'label' => 'LBL_STATUS',
- 'width' => '10%',
- 'default' => true,
- ),
- 'TYPE' => array(
- 'type' => 'enum',
- 'studio' => 'visible',
- 'label' => 'LBL_TYPE',
- 'width' => '10%',
- 'default' => true,
- ),
- 'COLOR' => array(
- 'type' => 'ColorPicker',
- 'label' => 'LBL_COLOR',
- 'width' => '10%',
- 'default' => true,
- ),
- 'HOURLY_RATE' => array(
- 'type' => 'decimal',
- 'label' => 'LBL_HOURLY_RATE',
- 'width' => '10%',
- 'default' => true,
- ),
- 'DAILY_RATE' => array(
- 'type' => 'decimal',
- 'label' => 'LBL_DAILY_RATE',
- 'width' => '10%',
- 'default' => true,
- ),
- 'ASSIGNED_USER_NAME' => array(
- 'width' => '9%',
- 'label' => 'LBL_ASSIGNED_TO_NAME',
- 'module' => 'Employees',
- 'id' => 'ASSIGNED_USER_ID',
- 'default' => true,
- ),
- 'OWNER_CONTACT' => array(
- 'type' => 'relate',
- 'label' => 'LBL_OWNER_CONTACT',
- 'id' => 'CONTACT_ID_C',
- 'link' => true,
- 'width' => '10%',
- 'default' => false,
- ),
- 'OWNER_ACCOUNT' => array(
- 'type' => 'relate',
- 'label' => 'LBL_OWNER_ACCOUNT',
- 'id' => 'ACCOUNT_ID_C',
- 'link' => true,
- 'width' => '10%',
- 'default' => false,
- ),
- 'DESCRIPTION' => array(
- 'type' => 'text',
- 'label' => 'LBL_DESCRIPTION',
- 'sortable' => false,
- 'width' => '10%',
- 'default' => false,
- ),
- 'CREATED_BY_NAME' => array(
- 'type' => 'relate',
- 'link' => true,
- 'label' => 'LBL_CREATED',
- 'id' => 'CREATED_BY',
- 'width' => '10%',
- 'default' => false,
- ),
- 'DATE_ENTERED' => array(
- 'type' => 'datetime',
- 'label' => 'LBL_DATE_ENTERED',
- 'width' => '10%',
- 'default' => false,
- ),
- 'MODIFIED_BY_NAME' => array(
- 'type' => 'relate',
- 'link' => true,
- 'label' => 'LBL_MODIFIED_NAME',
- 'id' => 'MODIFIED_USER_ID',
- 'width' => '10%',
- 'default' => false,
- ),
- 'DATE_MODIFIED' => array(
- 'type' => 'datetime',
- 'label' => 'LBL_DATE_MODIFIED',
- 'width' => '10%',
- 'default' => false,
- ),
-);
+if ($this->action == 'places') {
+ include 'modules/stic_Resources/metadata/listviewdefs2.php';
+ $listViewDefs[$module_name] = $placesListViewDefs[$module_name];
+} else {
+ $listViewDefs[$module_name] =
+ array(
+ 'NAME' => array(
+ 'width' => '20%',
+ 'label' => 'LBL_NAME',
+ 'default' => true,
+ 'link' => true,
+ ),
+ 'CODE' => array(
+ 'type' => 'varchar',
+ 'label' => 'LBL_CODE',
+ 'width' => '10%',
+ 'default' => true,
+ ),
+ 'STATUS' => array(
+ 'label' => 'LBL_STATUS',
+ 'width' => '10%',
+ 'default' => true,
+ ),
+ 'TYPE' => array(
+ 'type' => 'enum',
+ 'studio' => 'visible',
+ 'label' => 'LBL_TYPE',
+ 'width' => '10%',
+ 'default' => true,
+ ),
+ 'COLOR' => array(
+ 'type' => 'ColorPicker',
+ 'label' => 'LBL_COLOR',
+ 'width' => '10%',
+ 'default' => true,
+ ),
+ 'HOURLY_RATE' => array(
+ 'type' => 'decimal',
+ 'label' => 'LBL_HOURLY_RATE',
+ 'width' => '10%',
+ 'default' => true,
+ ),
+ 'DAILY_RATE' => array(
+ 'type' => 'decimal',
+ 'label' => 'LBL_DAILY_RATE',
+ 'width' => '10%',
+ 'default' => true,
+ ),
+ 'ASSIGNED_USER_NAME' => array(
+ 'width' => '9%',
+ 'label' => 'LBL_ASSIGNED_TO_NAME',
+ 'module' => 'Employees',
+ 'id' => 'ASSIGNED_USER_ID',
+ 'default' => true,
+ ),
+ 'USER_TYPE' => array(
+ 'type' => 'enum',
+ 'studio' => 'visible',
+ 'label' => 'LBL_USER_TYPE',
+ 'width' => '10%',
+ 'default' => false,
+ ),
+
+ 'PLACE_TYPE' => array(
+ 'type' => 'enum',
+ 'studio' => 'visible',
+ 'label' => 'LBL_PLACE_TYPE',
+ 'width' => '10%',
+ 'default' => false,
+ ),
+
+ 'GENDER' => array(
+ 'type' => 'enum',
+ 'studio' => 'visible',
+ 'label' => 'LBL_GENDER',
+ 'width' => '10%',
+ 'default' => false,
+ ),
+
+ 'TYPE' => array(
+ 'type' => 'enum',
+ 'studio' => 'visible',
+ 'label' => 'LBL_TYPE',
+ 'width' => '10%',
+ 'default' => true,
+ ),
+
+ 'OWNER_CONTACT' => array(
+ 'type' => 'relate',
+ 'label' => 'LBL_OWNER_CONTACT',
+ 'id' => 'CONTACT_ID_C',
+ 'link' => true,
+ 'width' => '10%',
+ 'default' => false,
+ ),
+ 'OWNER_ACCOUNT' => array(
+ 'type' => 'relate',
+ 'label' => 'LBL_OWNER_ACCOUNT',
+ 'id' => 'ACCOUNT_ID_C',
+ 'link' => true,
+ 'width' => '10%',
+ 'default' => false,
+ ),
+ 'DESCRIPTION' => array(
+ 'type' => 'text',
+ 'label' => 'LBL_DESCRIPTION',
+ 'sortable' => false,
+ 'width' => '10%',
+ 'default' => false,
+ ),
+ 'CREATED_BY_NAME' => array(
+ 'type' => 'relate',
+ 'link' => true,
+ 'label' => 'LBL_CREATED',
+ 'id' => 'CREATED_BY',
+ 'width' => '10%',
+ 'default' => false,
+ ),
+ 'DATE_ENTERED' => array(
+ 'type' => 'datetime',
+ 'label' => 'LBL_DATE_ENTERED',
+ 'width' => '10%',
+ 'default' => false,
+ ),
+ 'MODIFIED_BY_NAME' => array(
+ 'type' => 'relate',
+ 'link' => true,
+ 'label' => 'LBL_MODIFIED_NAME',
+ 'id' => 'MODIFIED_USER_ID',
+ 'width' => '10%',
+ 'default' => false,
+ ),
+ 'DATE_MODIFIED' => array(
+ 'type' => 'datetime',
+ 'label' => 'LBL_DATE_MODIFIED',
+ 'width' => '10%',
+ 'default' => false,
+ ),
+ );
+}
\ No newline at end of file
diff --git a/modules/stic_Resources/metadata/listviewdefs2.php b/modules/stic_Resources/metadata/listviewdefs2.php
new file mode 100644
index 00000000000..6daa9696bf9
--- /dev/null
+++ b/modules/stic_Resources/metadata/listviewdefs2.php
@@ -0,0 +1,61 @@
+ array(
+ 'width' => '20%',
+ 'label' => 'LBL_NAME',
+ 'default' => true,
+ 'link' => true,
+ 'related_fields' => array(),
+ 'table_key' => 'stic_resources',
+ 'db_key' => 'name'
+ ),
+ 'CODE' => array(
+ 'type' => 'varchar',
+ 'label' => 'LBL_CODE',
+ 'width' => '10%',
+ 'default' => true,
+ ),
+ 'PLACE_TYPE' => array(
+ 'type' => 'enum',
+ 'studio' => 'visible',
+ 'label' => 'LBL_PLACE_TYPE',
+ 'width' => '10%',
+ 'default' => true,
+ ),
+ 'USER_TYPE' => array(
+ 'type' => 'enum',
+ 'studio' => 'visible',
+ 'label' => 'LBL_USER_TYPE',
+ 'width' => '10%',
+ 'default' => true,
+ ),
+ 'GENDER' => array(
+ 'type' => 'enum',
+ 'studio' => 'visible',
+ 'label' => 'LBL_GENDER',
+ 'width' => '10%',
+ 'default' => true,
+ ),
+);
\ No newline at end of file
diff --git a/modules/stic_Resources/metadata/searchdefs.php b/modules/stic_Resources/metadata/searchdefs.php
index 333598fa2b2..7d09253e624 100644
--- a/modules/stic_Resources/metadata/searchdefs.php
+++ b/modules/stic_Resources/metadata/searchdefs.php
@@ -59,6 +59,30 @@
'width' => '10%',
'name' => 'color',
),
+ 'place_type' => array(
+ 'type' => 'enum',
+ 'studio' => 'visible',
+ 'label' => 'LBL_PLACE_TYPE',
+ 'width' => '10%',
+ 'default' => true,
+ 'name' => 'place_type',
+ ),
+ 'user_type' => array(
+ 'type' => 'enum',
+ 'studio' => 'visible',
+ 'label' => 'LBL_USER_TYPE',
+ 'width' => '10%',
+ 'default' => true,
+ 'name' => 'user_type',
+ ),
+ 'gender' => array(
+ 'type' => 'enum',
+ 'studio' => 'visible',
+ 'label' => 'LBL_GENDER',
+ 'width' => '10%',
+ 'default' => true,
+ 'name' => 'gender',
+ ),
'hourly_rate' => array(
'type' => 'decimal',
'label' => 'LBL_HOURLY_RATE',
@@ -137,6 +161,62 @@
'width' => '10%',
'name' => 'color',
),
+ 'place_type' => array(
+ 'type' => 'enum',
+ 'studio' => 'visible',
+ 'label' => 'LBL_PLACE_TYPE',
+ 'width' => '10%',
+ 'default' => true,
+ 'name' => 'place_type',
+ ),
+ 'user_type' => array(
+ 'type' => 'enum',
+ 'studio' => 'visible',
+ 'label' => 'LBL_USER_TYPE',
+ 'width' => '10%',
+ 'default' => true,
+ 'name' => 'user_type',
+ ),
+ 'gender' => array(
+ 'type' => 'enum',
+ 'studio' => 'visible',
+ 'label' => 'LBL_GENDER',
+ 'width' => '10%',
+ 'default' => true,
+ 'name' => 'gender',
+ ),
+ 'amount_day_occupied' => array(
+ 'type' => 'decimal',
+ 'studio' => 'visible',
+ 'label' => 'LBL_AMOUNT_DAY_OCCUPIED',
+ 'width' => '10%',
+ 'default' => true,
+ 'name' => 'amount_day_occupied',
+ ),
+ 'amount_day_unoccupied' => array(
+ 'type' => 'decimal',
+ 'studio' => 'visible',
+ 'label' => 'LBL_AMOUNT_DAY_UNOCCUPIED',
+ 'width' => '10%',
+ 'default' => true,
+ 'name' => 'amount_day_unoccupied',
+ ),
+ 'amount_day_overoccupied' => array(
+ 'type' => 'decimal',
+ 'studio' => 'visible',
+ 'label' => 'LBL_AMOUNT_DAY_OVEROCCUPIED',
+ 'width' => '10%',
+ 'default' => true,
+ 'name' => 'amount_day_overoccupied',
+ ),
+ 'amount_copayment' => array(
+ 'type' => 'enum',
+ 'studio' => 'visible',
+ 'label' => 'LBL_AMOUNT_COPAYMENT',
+ 'width' => '10%',
+ 'default' => true,
+ 'name' => 'amount_copayment',
+ ),
'hourly_rate' => array(
'type' => 'decimal',
'label' => 'LBL_HOURLY_RATE',
diff --git a/modules/stic_Resources/views/view.list2.php b/modules/stic_Resources/views/view.list2.php
index 00ab7e3a292..59a3d73ffea 100644
--- a/modules/stic_Resources/views/view.list2.php
+++ b/modules/stic_Resources/views/view.list2.php
@@ -46,7 +46,7 @@ public function preDisplay()
public function display()
{
parent::display();
- echo getVersionedScript("modules/stic_Skills/Utils.js");
+ echo getVersionedScript("modules/stic_Resources/Utils.js");
SticViews::display($this);