+ // makeRowIdentifier - builds a string identifying a row for a week view from a single record properties.
+ // Note that the return value is without a suffix.
+ // For example:
+ // "cl:546,bl:0,pr:23456,ts:27464,cf_1:example text"
+ // "cl:546,bl:1,pr:23456,ts:27464,cf_1:7623"
+ static function makeRowIdentifier($record) {
+ global $user;
+ // Start with client.
+ if ($user->isPluginEnabled('cl'))
+ $row_identifier = $record['client_id'] ? 'cl:'.$record['client_id'] : '';
+ // Add billable flag.
+ if (!empty($row_identifier)) $row_identifier .= ',';
+ $row_identifier .= 'bl:'.$record['billable'];
+ // Add project.
+ $row_identifier .= $record['project_id'] ? ',pr:'.$record['project_id'] : '';
+ // Add task.
+ $row_identifier .= $record['task_id'] ? ',ts:'.$record['task_id'] : '';
+ // Add custom field 1.
+ if ($user->isPluginEnabled('cf')) {
+ if ($record['cf_1_id'])
+ $row_identifier .= ',cf_1:'.$record['cf_1_id'];
+ else if ($record['cf_1_value'])
+ $row_identifier .= ',cf_1:'.$record['cf_1_value'];
+ }
+
+ return $row_identifier;
+ }
+