Replace old confirm() with new confirm dialog, samething like timesheet, no need to have seperate dialog creator in app.js

This commit is contained in:
Hadi Nategh 2013-12-05 11:06:25 +00:00
parent 9af3a9404d
commit f222706dcc
6 changed files with 5 additions and 26 deletions

View File

@ -78,27 +78,6 @@ app.classes.addressbook = AppJS.extend(
});
},
/**
* Creat a dialog for delete action in edit popup window.
*
* @param _action
* @param _senders
*
*/
delete_contact: function(_action, _senders)
{
var that = this;
var buttonId = _senders.id;
var callbackDeleteDialog = function (button_id)
{
if (button_id == et2_dialog.YES_BUTTON )
{
that.et2._inst.submit(buttonId);
}
}
et2_dialog.show_dialog(callbackDeleteDialog, this.egw.lang("Do you really want to delete this contact?"),this.egw.lang("Delete"), {},et2_dialog.BUTTONS_YES_NO_CANCEL, et2_dialog.WARNING_MESSAGE);
},
/**
* Add appointment or show calendar for selected contacts, call default nm_action after some checks
*

View File

@ -636,7 +636,7 @@
<button label="Apply" id="button[apply]" class="button_apply" image="apply" background_image="1"/>
<button label="Cancel" id="button[cancel]" class="button_cancel" onclick="if($cont[view] || false) return true; self.close(); return false;" image="cancel" background_image="1"/>
<checkbox statustext="Apply changes to all members, whose fields have the same previous content" label="change all organisation members" id="change_org" span="all"/>
<button align="left" label="Delete" id="button[delete]" class="button_delete" onclick="app.addressbook.delete_contact" tabindex="25" image="delete" background_image="1"/>
<button align="left" label="Delete" id="button[delete]" class="button_delete" onclick="et2_dialog.confirm(widget,'Do you really want to delete this contact?','Delete')" tabindex="25" image="delete" background_image="1"/>
</hbox>
</row>

View File

@ -70,7 +70,7 @@
</box>
<hbox options="0" class="noPrint">
<button label="Edit" id="edit[$row_cont[id]]" onclick="window.open(egw::link('/index.php','menuaction=addressbook.addressbook_ui.edit&amp;contact_id=$row_cont[id]'),'_blank','dependent=yes,width=850,height=440,scrollbars=yes,status=yes'); return false;" image="edit"/>
<button statustext="Delete this contact" label="Delete" id="delete[$row_cont[id]]" onclick="return confirm('Delete this contact');" image="delete"/>
<button statustext="Delete this contact" label="Delete" id="delete[$row_cont[id]]" onclick="et2_dialog.confirm(widget,'Delete this contact','Delete')" image="delete"/>
<checkbox align="right" statustext="Select multiple contacts for a further action" id="checked[]" options="$row_cont[id]"/>
</hbox>
</row>

View File

@ -40,7 +40,7 @@
<hbox options="0" class="noPrint" orient="0">
<button image="view" label="View" id="view[$row_cont[id]]" statustext="Show the contacts of this organisation"/>
<button image="new" label="Add" onclick="window.open(egw::link('/index.php','menuaction=addressbook.addressbook_ui.edit&amp;org=$row_cont[id]'),'_blank','dependent=yes,width=850,height=440,scrollbars=yes,status=yes'); return false;" id="add[$row_cont[id]]" statustext="Add a contact to this organisation"/>
<button id="delete[$row_cont[id]]" image="delete" label="Delete" statustext="Delete this organisation including ALL its contacts" onclick="return confirm('Delete this organisation including ALL its contacts');"/>
<button id="delete[$row_cont[id]]" image="delete" label="Delete" statustext="Delete this organisation including ALL its contacts" onclick="et2_dialog.confirm(widget,'Delete this organisation including ALL its contacts','Delete');"/>
<button image="infolog" label="InfoLog" id="infolog[$row_cont[id]]" statustext="Show InfoLog entries for this organisation"/>
<checkbox id="checked[]" options="$row_cont[id]" statustext="Select multiple contacts for a further action" align="right"/>
</hbox>

View File

@ -186,7 +186,7 @@
<hbox>
<image label="View" src="view" href="addressbook.addressbook_ui.view&amp;contact_id=$row_cont[id]"/>
<button label="Edit" id="edit[$row_cont[id]]" onclick="window.open(egw::link('/index.php','menuaction=addressbook.addressbook_ui.edit&amp;contact_id=$row_cont[id]'),'_blank','dependent=yes,width=870,height=460,scrollbars=yes,status=yes'); return false;" image="edit"/>
<button statustext="Delete this contact" label="Delete" id="delete[$row_cont[id]]" onclick="return confirm('Delete this contact');" image="delete"/>
<button statustext="Delete this contact" label="Delete" id="delete[$row_cont[id]]" onclick="et2_dialog.confirm(widget,'Delete this contact','Delete')" image="delete"/>
<checkbox align="right" statustext="Select multiple contacts for a further action" id="checked[]" options="$row_cont[id]"/>
</hbox>
<hbox>

View File

@ -634,7 +634,7 @@
<button label="Apply" image="appy" background_image="1" id="button[apply]"/>
<button label="Cancel" image="cancel" background_image="1" id="button[cancel]" onclick="if($cont[view]0) return true; self.close(); return false;"/>
</hbox>
<button label="Delete" id="button[delete]" onclick="return confirm('Are you shure you want to delete this contact?');" align="right" tabindex="25"/>
<button label="Delete" id="button[delete]" onclick="et2_dialog.confirm(widget,'Are you shure you want to delete this contact?','Delete');" align="right" tabindex="25"/>
</row>
</rows>
</grid>