diff --git a/core/js/share/sharedialoglinkshareview_popover_menu.handlebars b/core/js/share/sharedialoglinkshareview_popover_menu.handlebars
index ecbf69ffb77..41324480c40 100644
--- a/core/js/share/sharedialoglinkshareview_popover_menu.handlebars
+++ b/core/js/share/sharedialoglinkshareview_popover_menu.handlebars
@@ -78,8 +78,10 @@
diff --git a/core/js/sharedialoglinkshareview.js b/core/js/sharedialoglinkshareview.js
index f9af57ac2ab..457170871f9 100644
--- a/core/js/sharedialoglinkshareview.js
+++ b/core/js/sharedialoglinkshareview.js
@@ -160,7 +160,16 @@
this.$el.find('.icon').addClass('hidden');
$loading.removeClass('hidden');
- this.model.saveLinkShare({}, {
+ var shareData = {}
+
+ var isExpirationEnforced = this.configModel.get('isDefaultExpireDateEnforced');
+ if (isExpirationEnforced) {
+ var defaultExpireDays = this.configModel.get('defaultExpireDate');
+ var expireDate = moment().add(defaultExpireDays, 'day').format('DD-MM-YYYY')
+ shareData.expireDate = expireDate;
+ }
+
+ this.model.saveLinkShare(shareData, {
success: function() {
$loading.addClass('hidden');
self.$el.find('.icon').removeClass('hidden');
@@ -485,7 +494,7 @@
publicUploadRWValue: OC.PERMISSION_UPDATE | OC.PERMISSION_CREATE | OC.PERMISSION_READ | OC.PERMISSION_DELETE,
publicUploadRValue: OC.PERMISSION_READ,
publicUploadWValue: OC.PERMISSION_CREATE,
- expireDateLabel: t('core', 'Set expiration date'),
+ expireDateLabel: isExpirationEnforced ? t('core', 'Expiration date enforced') : t('core', 'Set expiration date'),
expirationLabel: t('core', 'Expiration'),
expirationDatePlaceholder: t('core', 'Expiration date'),
isExpirationEnforced: isExpirationEnforced,
@@ -704,7 +713,6 @@
var isExpirationEnforced = this.configModel.get('isDefaultExpireDateEnforced');
var defaultExpireDays = this.configModel.get('defaultExpireDate');
var hasExpireDate = !!share.expiration || isExpirationEnforced;
- var hasExpireDate = false;
var expireDate;
if (hasExpireDate) {
@@ -747,6 +755,7 @@
maxDate: maxDate,
showHideDownloadCheckbox: showHideDownloadCheckbox,
hideDownload: hideDownload,
+ isExpirationEnforced: isExpirationEnforced,
}
},
diff --git a/core/js/sharetemplates.js b/core/js/sharetemplates.js
index 9d117a98a8d..674bc2c4bab 100644
--- a/core/js/sharetemplates.js
+++ b/core/js/sharetemplates.js
@@ -146,14 +146,18 @@ templates['sharedialoglinkshareview_popover_menu'] = template({"1":function(cont
},"11":function(container,depth0,helpers,partials,data) {
return "hidden";
},"13":function(container,depth0,helpers,partials,data) {
- var helper;
-
- return container.escapeExpression(((helper = (helper = helpers.expireDate || (depth0 != null ? depth0.expireDate : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"expireDate","hash":{},"data":data}) : helper)));
+ return "datepicker";
},"15":function(container,depth0,helpers,partials,data) {
var helper;
- return container.escapeExpression(((helper = (helper = helpers.defaultExpireDate || (depth0 != null ? depth0.defaultExpireDate : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"defaultExpireDate","hash":{},"data":data}) : helper)));
+ return container.escapeExpression(((helper = (helper = helpers.expireDate || (depth0 != null ? depth0.expireDate : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"expireDate","hash":{},"data":data}) : helper)));
},"17":function(container,depth0,helpers,partials,data) {
+ var helper;
+
+ return container.escapeExpression(((helper = (helper = helpers.defaultExpireDate || (depth0 != null ? depth0.defaultExpireDate : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"defaultExpireDate","hash":{},"data":data}) : helper)));
+},"19":function(container,depth0,helpers,partials,data) {
+ return "readonly";
+},"21":function(container,depth0,helpers,partials,data) {
var helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
return " \n "
+ alias4(((helper = (helper = helpers.expirationLabel || (depth0 != null ? depth0.expirationLabel : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"expirationLabel","hash":{},"data":data}) : helper)))
- + "\n \n \n \n \n \n \n \n \n \n "
+ + "\" "
+ + ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.isExpirationEnforced : depth0),{"name":"if","hash":{},"fn":container.program(19, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ + " />\n \n \n \n \n \n \n "
+ alias4(((helper = (helper = helpers.addNoteLabel || (depth0 != null ? depth0.addNoteLabel : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"addNoteLabel","hash":{},"data":data}) : helper)))
+ "\n \n \n \n \n"
- + ((stack1 = helpers.each.call(alias1,(depth0 != null ? depth0.social : depth0),{"name":"each","hash":{},"fn":container.program(17, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ + ((stack1 = helpers.each.call(alias1,(depth0 != null ? depth0.social : depth0),{"name":"each","hash":{},"fn":container.program(21, data, 0),"inverse":container.noop,"data":data})) != null ? stack1 : "")
+ " \n "
+ alias4(((helper = (helper = helpers.unshareLabel || (depth0 != null ? depth0.unshareLabel : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"unshareLabel","hash":{},"data":data}) : helper)))
+ "\n \n \n\n";