Skip to content

Commit 3a6959c

Browse files
Introducing new packages to this Project (#27)
1 parent e9951df commit 3a6959c

File tree

57 files changed

+3245
-199
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+3245
-199
lines changed

packages/CanvasIFrame/pack.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55

66
$packageID = "BuildingBlock_CanvasIFrame";
7-
$packageLabel = "Canvas IFrame";
7+
$packageLabel = "BuildingBlocks: Canvas IFrame";
88
$supportedVersionRegex = '(9|8|7)\\..*$';
99
/******************************/
1010

packages/ContextualIFrameDashlet/pack.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55

66
$packageID = "BuildingBlock_ContextualIFrameDashlet";
7-
$packageLabel = "Contextual iFrame Dashlet package";
7+
$packageLabel = "BuildingBlocks: Contextual iFrame Dashlet package";
88
$supportedVersionRegex = '(9|8|7)\\..*$';
99
$acceptableSugarFlavors = array('PRO','ENT','ULT');
1010
$description = 'Package for a configurable contextual iFrame Sugar Dashlet';

packages/CssLoader/pack.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55

66
$packageID = "BuildingBlock_CssLoader";
7-
$packageLabel = "CssLoader";
7+
$packageLabel = "BuildingBlocks: CssLoader";
88
$supportedVersionRegex = '(9|8|7)\\..*$';
99
$acceptableSugarFlavors = array('PRO','ENT','ULT');
1010
$description = 'Loading custom CSS into Sugar made easy';
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
#!/usr/bin/env php
2+
<?php
3+
// Copyright 2018 SugarCRM Inc. Licensed by SugarCRM under the Apache 2.0 license.
4+
5+
6+
$packageID = "BuildingBlock_CustomHighlightField";
7+
$packageLabel = "BuildingBlocks: Custom Field Highlightedfield";
8+
$supportedVersionRegex = '(26|25|14)\\..*$';
9+
$acceptableSugarFlavors = array('ENT');
10+
$description = 'New field type called Highlightfield which changes background depending on the value.';
11+
/******************************/
12+
13+
if (empty($argv[1])) {
14+
if (file_exists("version")) {
15+
$version = file_get_contents("version");
16+
}
17+
} else {
18+
$version = $argv[1];
19+
}
20+
21+
if (empty($version)){
22+
die("Use $argv[0] [version]\n");
23+
}
24+
25+
$id = "{$packageID}-{$version}";
26+
27+
$directory = "releases";
28+
if(!is_dir($directory)){
29+
mkdir($directory);
30+
}
31+
32+
$zipFile = $directory . "/sugarcrm-{$id}.zip";
33+
34+
35+
if (file_exists($zipFile)) {
36+
die("Error: Release $zipFile already exists, so a new zip was not created. To generate a new zip, either delete the"
37+
. " existing zip file or update the version number in the version file AND then run the script to build the"
38+
. " module again. \n");
39+
}
40+
41+
$manifest = array(
42+
'id' => $packageID,
43+
'name' => $packageLabel,
44+
'description' => $description,
45+
'version' => $version,
46+
'author' => 'SugarCRM, Inc.',
47+
'is_uninstallable' => 'true',
48+
'published_date' => date("Y-m-d H:i:s"),
49+
'type' => 'module',
50+
'acceptable_sugar_versions' => array(
51+
'exact_matches' => array(
52+
),
53+
'regex_matches' => array(
54+
$supportedVersionRegex,
55+
),
56+
),
57+
'acceptable_sugar_flavors' => $acceptableSugarFlavors,
58+
);
59+
60+
$installdefs = array(
61+
'beans' => array (),
62+
'id' => $packageID
63+
);
64+
65+
echo "Creating {$zipFile} ... \n";
66+
$zip = new ZipArchive();
67+
$zip->open($zipFile, ZipArchive::CREATE);
68+
$basePath = realpath('src/');
69+
$files = new RecursiveIteratorIterator(
70+
new RecursiveDirectoryIterator($basePath, RecursiveDirectoryIterator::SKIP_DOTS),
71+
RecursiveIteratorIterator::LEAVES_ONLY
72+
);
73+
foreach ($files as $name => $file) {
74+
if ($file->isFile()) {
75+
$fileReal = $file->getRealPath();
76+
$fileRelative = 'src' . str_replace($basePath, '', $fileReal);
77+
echo " [*] $fileRelative \n";
78+
$zip->addFile($fileReal, $fileRelative);
79+
$installdefs['copy'][] = array(
80+
'from' => '<basepath>/' . $fileRelative,
81+
'to' => preg_replace('/^src[\/\\\](.*)/', '$1', $fileRelative),
82+
);
83+
}
84+
}
85+
$manifestContent = sprintf(
86+
"<?php\n\$manifest = %s;\n\$installdefs = %s;\n",
87+
var_export($manifest, true),
88+
var_export($installdefs, true)
89+
);
90+
$zip->addFromString('manifest.php', $manifestContent);
91+
$zip->close();
92+
echo "Done creating {$zipFile}\n\n";
93+
exit(0);
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php
2+
3+
$app_strings['LBL_HIGHLIGHTFIELD_OPERATOR_CONTAINS'] = 'contains';
4+
$app_strings['LBL_HIGHLIGHTFIELD_OPERATOR_NOT_CONTAINS'] = 'does not contain';
5+
$app_strings['LBL_HIGHLIGHTFIELD_OPERATOR_STARTS_WITH'] = 'starts with';
6+
7+
$app_list_strings['highlightColors'] = array(
8+
'#0000FF' => 'Blue',
9+
'#00ffff' => 'Aqua',
10+
'#FF00FF' => 'Fuchsia',
11+
'#808080' => 'Gray',
12+
'#ffff00' => 'Olive',
13+
'#000000' => 'Black',
14+
'#800000' => 'Maroon',
15+
'#ff0000' => 'Red',
16+
'#ffA500' => 'Orange',
17+
'#ffff00' => 'Yellow',
18+
'#800080' => 'Purple',
19+
'#ffffff' => 'White',
20+
'#00ff00' => 'Lime',
21+
'#008000' => 'Green',
22+
'#008080' => 'Teal',
23+
'#c0c0c0' => 'Silver',
24+
'#000080' => 'Navy'
25+
);
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?php
2+
3+
$mod_strings['LBL_HIGHLIGHTFIELD'] = 'Highlighted Text';
4+
$mod_strings['LBL_HIGHLIGHTFIELD_FORMAT_HELP'] = '';
5+
6+
$mod_strings['LBL_HIGHLIGHTFIELD_BACKCOLOR'] = 'Background Color';
7+
$mod_strings['LBL_HIGHLIGHTFIELD_TEXTCOLOR'] = 'Text Color';
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<?php
2+
3+
$mod_strings['fieldTypes']['Highlightfield'] = 'Highlighted Text';
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
/**
2+
* @class View.Fields.Base.Highlightfield
3+
* @alias SUGAR.App.view.fields.Highlightfield
4+
* @extends View.Fields.Base.BaseField
5+
*/
6+
({
7+
extendsFrom: 'BaseField',
8+
9+
/**
10+
* Called when initializing the field
11+
* @param options
12+
*/
13+
initialize: function(options) {
14+
this._super('initialize', [options]);
15+
},
16+
17+
/**
18+
* Called when rendering the field
19+
* @private
20+
*/
21+
_render: function() {
22+
this._super('_render');
23+
},
24+
25+
/**
26+
* Called when formatting the value for display
27+
* @param value
28+
*/
29+
format: function(value) {
30+
return this._super('format', [value]);
31+
},
32+
33+
/**
34+
* Called when unformatting the value for storage
35+
* @param value
36+
*/
37+
unformat: function(value) {
38+
return this._super('unformat', [value]);
39+
}
40+
})
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{{!
2+
The data for field colors are passed into the handlebars template through the def array. For this example, the def.backcolor and def.textcolor properties. These indexes are defined in:
3+
./custom/modules/DynamicFields/templates/Fields/TemplateHighlightfield.php
4+
}}
5+
{{#if value}}
6+
<div class="ellipsis_inline" data-bs-placement="bottom"{{#if dir}} dir="{{dir}}"{{/if}} title="{{value}}" style="background:{{def.backcolor}}; color:{{def.textcolor}}">
7+
{{value}}
8+
</div>
9+
{{/if}}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{{!
2+
We have not made any edits to this file that differ from stock, however,
3+
we could add styling here just as we did for the detail and list templates.
4+
}}
5+
6+
<input
7+
type="text"
8+
name="{{name}}"
9+
value="{{value}}"
10+
{{#if def.len}} maxlength="{{def.len}}"{{/if}}
11+
{{#if def.tabindex}} tabindex="{{def.tabindex}}"{{/if}}
12+
{{#if def.placeholder}} placeholder="{{str def.placeholder this.model.module}}"{{/if}}
13+
class="inherit-width">
14+
{{#unless hideHelp}}
15+
{{#if def.help}}
16+
<p class="help-block">{{str def.help module}}</p>
17+
{{/if}}
18+
{{/unless}}

0 commit comments

Comments
 (0)