Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Make sure to save before trying to send an invitation to internal use…
Browse files Browse the repository at this point in the history
…rs. Fix #1166
  • Loading branch information
cdujeu committed Jul 6, 2016
1 parent efeb573 commit c605731
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 6 deletions.
1 change: 1 addition & 0 deletions core/src/plugins/action.share/res/i18n/ca.php
Expand Up @@ -246,4 +246,5 @@
"226" => "You are not allowed to create public links on folders",
"227" => "You are not allowed to share files internally",
"228" => "You are not allowed to share folders internally",
"229" => "Please save before sending an invitation",
);
1 change: 1 addition & 0 deletions core/src/plugins/action.share/res/i18n/de.php
Expand Up @@ -245,4 +245,5 @@
"226" => "Sie dürfen keine öffentlichen Links auf Ordner erstellen.",
"227" => "Sie dürfen keine internen Freigaben auf Dateien erstellen.",
"228" => "Sie dürfen keine internen Freigaben auf Ordner erstellen.",
"229" => "Please save before sending an invitation",
);
1 change: 1 addition & 0 deletions core/src/plugins/action.share/res/i18n/en.php
Expand Up @@ -245,4 +245,5 @@
"226" => "You are not allowed to create public links on folders",
"227" => "You are not allowed to share files internally",
"228" => "You are not allowed to share folders internally",
"229" => "Please save before sending an invitation",
);
1 change: 1 addition & 0 deletions core/src/plugins/action.share/res/i18n/es.php
Expand Up @@ -244,4 +244,5 @@
"226" => "You are not allowed to create public links on folders",
"227" => "You are not allowed to share files internally",
"228" => "You are not allowed to share folders internally",
"229" => "Please save before sending an invitation",
);
1 change: 1 addition & 0 deletions core/src/plugins/action.share/res/i18n/fr.php
Expand Up @@ -244,4 +244,5 @@
"226" => "Vous n'êtes pas autorisé à créer des liens publics sur les répertoires",
"227" => "Vous n'êtes pas autorisé à partager des fichiers en interne",
"228" => "Vous n'êtes pas autorisé à partager des répertoires en interne",
"229" => "Veuillez sauver ce partage avant de pouvoir envoyer une invitation.",
);
1 change: 1 addition & 0 deletions core/src/plugins/action.share/res/i18n/it.php
Expand Up @@ -242,6 +242,7 @@
"226" => "Non sei autorizzato per la creazione di link pubblici alle cartelle",
"227" => "Non sei autorizzato per la condivisione interna di file",
"228" => "Non sei autorizzato per la condivisione interna delle cartelle",
"229" => "Please save before sending an invitation",
"11" => "Expiration",
"49" => "create user",
// will be replaced by the filename to download
Expand Down
1 change: 1 addition & 0 deletions core/src/plugins/action.share/res/i18n/pt.php
Expand Up @@ -244,4 +244,5 @@
"226" => "You are not allowed to create public links on folders",
"227" => "You are not allowed to share files internally",
"228" => "You are not allowed to share folders internally",
"229" => "Please save before sending an invitation",
);
1 change: 1 addition & 0 deletions core/src/plugins/action.share/res/i18n/ru.php
Expand Up @@ -239,6 +239,7 @@
"226" => "You are not allowed to create public links on folders",
"227" => "You are not allowed to share files internally",
"228" => "You are not allowed to share folders internally",
"229" => "Please save before sending an invitation",
"159" => "Owner",
"160" => "You are not allowed to delete this shared item",
"161" => "Deprecated Link",
Expand Down
11 changes: 9 additions & 2 deletions core/src/plugins/action.share/res/react/ShareDialog.js
Expand Up @@ -253,17 +253,24 @@
shareModel:React.PropTypes.instanceOf(ReactModel.Share),
showMailer:React.PropTypes.func
},

onUserUpdate: function(operation, userId, userData){
this.props.shareModel.updateSharedUser(operation, userId, userData);
},

onSaveSelection:function(){
var label = window.prompt(this.context.getMessage(510, ''));
if(!label) return;
this.props.shareModel.saveSelectionAsTeam(label);
},

sendInvitations:function(userObjects){
var mailData = this.props.shareModel.prepareEmail("repository");
this.props.showMailer(mailData.subject, mailData.message, userObjects);
try{
var mailData = this.props.shareModel.prepareEmail("repository");
this.props.showMailer(mailData.subject, mailData.message, userObjects);
}catch(e){
global.alert(e.message);
}
},

render: function(){
Expand Down
7 changes: 3 additions & 4 deletions core/src/plugins/action.share/res/react/model/ShareModel.js
Expand Up @@ -872,16 +872,15 @@
link = this.getPublicLink(linkId);
message = s + "\n\n " + "<a href='"+link+"'>"+link+"</a>";
}else{
if(!this._data['repository_url']){
throw new Error(MessageHash['share_center.229']);
}
s = MessageHash["share_center." + (this.getNode().isLeaf() ? "42" : "43")];
if(s) s = s.replace("%s", ApplicationTitle);
if(this._data['repository_url']){
link = this._data['repository_url'];
}
//if(this.shareFolderMode == 'workspace'){
message = s + "\n\n " + "<a href='" + link +"'>" + MessageHash["share_center.46"].replace("%s1", this.getGlobal("label")).replace("%s2", ajaxplorer.appTitle) + "</a>";
//}else{
// message = s + "\n\n " + "<a href='" + link +"'>" + MessageHash["share_center.46" + (this.currentNode.isLeaf()?'_file':'_mini')].replace("%s1", this._currentRepositoryLabel) + "</a>";
//}
}
var usersList = null;
if(this.shareFolderMode == 'workspace' && oForm) {
Expand Down

0 comments on commit c605731

Please sign in to comment.