Task #1153 - Boite de dialogue modale
#1153 Dialog box : implement alert + confirm_form
This commit is contained in:
parent
8888381f6f
commit
404aeebdb6
32 changed files with 284 additions and 249 deletions
|
|
@ -293,7 +293,10 @@ function html_page_start($p_theme="", $p_script="", $p_script2="")
|
|||
$is_msie=is_msie();
|
||||
|
||||
if ($is_msie == 0 )
|
||||
{
|
||||
echo '<!doctype html>';
|
||||
echo '<meta name="viewport" content="width=device-width, initial-scale=1.0">';
|
||||
}
|
||||
else
|
||||
echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 FINAL//EN" >';
|
||||
|
||||
|
|
@ -315,7 +318,8 @@ function html_page_start($p_theme="", $p_script="", $p_script2="")
|
|||
echo '<script language="javascript" src="js/calendar.js"></script>
|
||||
<script type="text/javascript" src="js/lang/calendar-en.js"></script>
|
||||
<script language="javascript" src="js/calendar-setup.js"></script>
|
||||
<LINK REL="stylesheet" type="text/css" href="./calendar-blue.css" media="screen">';
|
||||
<LINK REL="stylesheet" type="text/css" href="./calendar-blue.css" media="screen">
|
||||
<LINK REL="stylesheet" type="text/css" href="./smoke.css" media="screen">';
|
||||
|
||||
echo ' </HEAD> ';
|
||||
|
||||
|
|
|
|||
|
|
@ -133,7 +133,7 @@ select me_code,me_code||' '||coalesce(me_menu,'')||' '||coalesce(me_description,
|
|||
$pm_default=new ICheckBox('pm_default');
|
||||
echo HtmlInput::title_box(_("Nouveau"), $ctl);
|
||||
?>
|
||||
<form method="POST" onsubmit="return confirm('<?php echo _('Vous confirmez'); ?> ?')">
|
||||
<form method="POST" id="menu_new_frm" onsubmit="return confirm_form('menu_new_frm','<?php echo _('Vous confirmez'); ?> ?')">
|
||||
<?php
|
||||
echo HtmlInput::hidden('tab', 'profile_menu_div');
|
||||
?>
|
||||
|
|
@ -187,7 +187,7 @@ select me_code,me_code||' '||coalesce(me_menu,'')||' '||coalesce(me_description,
|
|||
return;
|
||||
}
|
||||
?>
|
||||
<form method="POST" onsubmit="return confirm('<?php echo _('Vous confirmez ?') ?>">
|
||||
<form method="POST" id="menu_new2_frm" onsubmit="return confirm_form('menu_new2_frm','<?php echo _('Vous confirmez ?') ?>">
|
||||
<?php
|
||||
echo HtmlInput::hidden('tab', 'profile_print_div');
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ if ( ! defined ('ALLOWED') ) die('Appel direct ne sont pas permis');
|
|||
require_once NOALYSS_INCLUDE.'/class_menu_ref.php';
|
||||
$msg="Création";
|
||||
$m=new Menu_Ref($cn);
|
||||
echo '<form method="POST" onsubmit="return confirm(\'Vous confirmez ?\')">';
|
||||
echo '<form method="POST" onsubmit="return confirm_form(this,(this,\'Vous confirmez ?\')">';
|
||||
|
||||
require_once 'template/menu_detail.php';
|
||||
echo HtmlInput::submit('create_menu','Sauver');
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ $pm_default=new ICheckBox('pm_default','1');
|
|||
$pm_default->set_check($array[0]['pm_default']);
|
||||
|
||||
?>
|
||||
<form method="POST" onsubmit="return confirm('<?php echo _("Vous confirmez")?> ?')">
|
||||
<form method="POST" onsubmit="return confirm_form(this,'<?php echo _("Vous confirmez")?> ?')">
|
||||
<?php echo HtmlInput::hidden('pm_id',$array[0]['pm_id'])?>
|
||||
<?php echo HtmlInput::hidden('p_id',$array[0]['p_id'])?>
|
||||
<?php echo HtmlInput::hidden('tab',"profile_menu_div")?>
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ else
|
|||
{
|
||||
echo '<div class="myfieldset" id="profile_gen_div">';
|
||||
}
|
||||
echo '<form method="POST" onsubmit="return confirm (\'vous confirmez\')">';
|
||||
echo '<form method="POST" onsubmit="return confirm_form(this,\'vous confirmez\')">';
|
||||
echo HtmlInput::hidden('tab','profile_gen_div');
|
||||
echo HtmlInput::hidden('p_id',$profile->p_id);
|
||||
require_once("template/profile.php");
|
||||
|
|
@ -84,7 +84,7 @@ echo HtmlInput::submit("save_name",_("Modifier"));
|
|||
echo '</form>';
|
||||
if ($profile->p_id > 0)
|
||||
{
|
||||
echo '<form method="POST" onsubmit="return confirm (\''._("vous confirmez").'\')">';
|
||||
echo '<form method="POST" onsubmit="return confirm_form(this,\''._("vous confirmez").'\')">';
|
||||
|
||||
echo _('Vous pouvez aussi copier ce profil et puis le corriger');
|
||||
|
||||
|
|
@ -92,7 +92,7 @@ if ($profile->p_id > 0)
|
|||
echo HtmlInput::submit("clone", "Copier");
|
||||
echo '</form>';
|
||||
|
||||
echo '<form method="POST" onsubmit="return confirm (\''._("vous confirmez").'\')">';
|
||||
echo '<form method="POST" onsubmit="return confirm_form(this,\''._("vous confirmez").'\')">';
|
||||
|
||||
echo _('Effacer ce profil');
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ if ( ! defined ('ALLOWED') ) die('Appel direct ne sont pas permis');
|
|||
require_once NOALYSS_INCLUDE.'/class_menu_ref.php';
|
||||
$m=new Menu_Ref($cn,$me_code);
|
||||
$msg="Modification ".$m->me_code.' '.h($m->me_menu);
|
||||
echo '<form method="POST" onsubmit="return confirm(\'Vous confirmez ?\')">';
|
||||
echo '<form method="POST" onsubmit="return confirm_form(this,\'Vous confirmez ?\')">';
|
||||
|
||||
require_once NOALYSS_INCLUDE.'/template/menu_detail.php';
|
||||
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ class Extension extends Menu_Ref_sql
|
|||
* @global type $cn
|
||||
* @param type $p_id profile.p_id
|
||||
* @param type $p_module menu_ref.me_code
|
||||
* @throws Exception 10 : profile absent 20 module absent
|
||||
* @throws Exception 10 : profile absent , 20 module absent , 30 No parent menu
|
||||
*/
|
||||
function insert_profile_menu($p_id=1,$p_module='EXT')
|
||||
{
|
||||
|
|
@ -120,12 +120,23 @@ class Extension extends Menu_Ref_sql
|
|||
if ($module->me_code==null) {
|
||||
throw new Exception(_('Module inexistant'),20);
|
||||
}
|
||||
// Dependency
|
||||
$dep_id=$cn->get_value('select pm_id from profile_menu
|
||||
where
|
||||
p_id=$1
|
||||
and me_code = $2 ',array($p_id,$p_module));
|
||||
// throw an exception if there is no dependency
|
||||
if ($dep_id=="") {
|
||||
throw new Exception(_('Pas de menu ').$p_module,30);
|
||||
}
|
||||
|
||||
$profil_menu=new Profile_Menu($cn);
|
||||
$profil_menu->me_code=$this->me_code;
|
||||
$profil_menu->me_code_dep=$p_module;
|
||||
$profil_menu->p_type_display='S';
|
||||
$profil_menu->p_id=$p_id;
|
||||
$profil_menu->pm_id_dep=$dep_id;
|
||||
|
||||
$cnt=$profil_menu->count(' where p_id=$1 and me_code = $2',array($p_id,$this->me_code));
|
||||
if ( $cnt==0) {
|
||||
$profil_menu->insert();
|
||||
|
|
|
|||
|
|
@ -201,7 +201,7 @@ class Periode
|
|||
from parm_periode
|
||||
order by p_start,p_end");
|
||||
$Max=Database::num_row($Res);
|
||||
echo '<form id="periode_frm" method="POST" onsubmit="confirm(\'Confirmez-vous la fermeture des périodes choisies ?\')" >';
|
||||
echo '<form id="periode_frm" method="POST" onsubmit="confirm_form(this,\'Confirmez-vous la fermeture des périodes choisies ?\')" >';
|
||||
echo HtmlInput::array_to_hidden(array('ac','gDossier','jrn_def_id','choose'), $_REQUEST);
|
||||
echo '<TABLE ALIGN="CENTER">';
|
||||
echo "</TR>";
|
||||
|
|
@ -262,7 +262,7 @@ class Periode
|
|||
if ($l_line['count_op'] == 0 )
|
||||
{
|
||||
$remove.='<A class="mtitle" HREF="?ac='.$_REQUEST['ac'].'&action=delete_per&p_per='.
|
||||
$l_line['p_id']."&$str_dossier\" onclick=\"return confirm('"._('Confirmez effacement ?')."')\" > Efface</A>";
|
||||
$l_line['p_id']."&$str_dossier\" onclick=\"return confirm_form(this,'"._('Confirmez effacement ?')."')\" > Efface</A>";
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -326,7 +326,7 @@ class Periode
|
|||
$this->jrn_def_id);
|
||||
$jrn_name=Database::fetch_result($r,0,0);
|
||||
echo '<h2> Journal '.$jrn_name.'</h2>';
|
||||
echo '<form id="periode_frm" method="POST" onsubmit="confirm(\'Confirmez-vous la fermeture des périodes choisies ?\')" >';
|
||||
echo '<form id="periode_frm" method="POST" onsubmit="confirm_form(this,\'Confirmez-vous la fermeture des périodes choisies ?\')" >';
|
||||
echo HtmlInput::array_to_hidden(array('ac','gDossier','jrn_def_id','choose'), $_REQUEST);
|
||||
|
||||
echo '<TABLE ALIGN="CENTER">';
|
||||
|
|
|
|||
|
|
@ -50,6 +50,7 @@ class Profile_Menu_sql extends Noalyss_SQL
|
|||
, "p_order"=>"p_order"
|
||||
, "p_type_display"=>"p_type_display"
|
||||
, "pm_default"=>"pm_default"
|
||||
,"pm_id_dep"=>"pm_id_dep"
|
||||
);
|
||||
|
||||
$this->type=array(
|
||||
|
|
@ -60,6 +61,7 @@ class Profile_Menu_sql extends Noalyss_SQL
|
|||
, "p_order"=>"number"
|
||||
, "p_type_display"=>"text"
|
||||
, "pm_default"=>"text"
|
||||
, "pm_id_dep"=>"number"
|
||||
);
|
||||
|
||||
$this->default=array(
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ $a_stat=$cn->get_array("select s_value,s_status from document_state order by 1")
|
|||
<?php endfor;?>
|
||||
</table>
|
||||
<h2>Ajout d'un état</h2>
|
||||
<form method="post" onsubmit="return confirm ('Vous confirmez ?'); ">
|
||||
<form method="post" onsubmit="return confirm_form(this,'Vous confirmez ?'); ">
|
||||
<p>
|
||||
Nom de l'état <?php $value=new IText("s_value",""); echo $value->input()?>
|
||||
</p>
|
||||
|
|
|
|||
|
|
@ -2756,6 +2756,7 @@ function load_all_script()
|
|||
$already_call=1;
|
||||
|
||||
echo JS_INFOBULLE;
|
||||
echo js_include('smoke.js');
|
||||
echo js_include('prototype.js');
|
||||
echo js_include('scriptaculous.js');
|
||||
echo js_include('scripts.js');
|
||||
|
|
@ -2772,7 +2773,6 @@ function load_all_script()
|
|||
echo js_include('card.js');
|
||||
echo js_include('compute_direct.js');
|
||||
echo js_include('compute.js');
|
||||
echo js_include('confirm.js');
|
||||
echo js_include('forecast.js');
|
||||
echo js_include('gestion.js');
|
||||
echo js_include('todo_list.js');
|
||||
|
|
|
|||
|
|
@ -43,19 +43,18 @@ if ( $sb=='change')
|
|||
if ( !isset($_GET['id'])) exit;
|
||||
$row=new Acc_Payment($cn,$_GET['id']);
|
||||
$row->load();
|
||||
$javascript="return confirm('"._('Vous confirmez')."')";
|
||||
echo '<form method="post" onsubmit="'.$javascript.'">';
|
||||
echo '<form method="post" id="modify_acc_pay_frm" onsubmit="return confirm_form(\'modify_acc_pay_frm\',\''._('Vous confirmez').'\')">';
|
||||
echo dossier::hidden();
|
||||
echo HtmlInput::hidden('sa','mp');
|
||||
echo HtmlInput::hidden('sb','save');
|
||||
echo HtmlInput::hidden('id',$row->get_parameter("id"));
|
||||
|
||||
echo HtmlInput::hidden('delete_ck',0);
|
||||
echo $row->form();
|
||||
echo HtmlInput::submit('save',_('Sauve'));
|
||||
echo HtmlInput::submit('delete',_('Efface'));
|
||||
echo HtmlInput::submit('save',_('Sauve'), ' onclick="$(\'delete_ck\').value=0"');
|
||||
echo HtmlInput::submit('delete',_('Efface'),' onclick="$(\'delete_ck\').value=1"');
|
||||
echo HtmlInput::button_anchor(_('Retour sans sauver'),
|
||||
'?p_action=divers&sa=mp&'.dossier::get()."&ac=".$_REQUEST['ac']
|
||||
);
|
||||
'?p_action=divers&sa=mp&'.dossier::get()."&ac=".$_REQUEST['ac'],
|
||||
"","","smallbutton");
|
||||
echo '</form>';
|
||||
return;
|
||||
}
|
||||
|
|
@ -64,19 +63,21 @@ if ( $sb=='change')
|
|||
//
|
||||
if ( $sb=='save')
|
||||
{
|
||||
$row=new Acc_Payment($cn,$_POST ['id']);
|
||||
$row->from_array($_POST);
|
||||
$row->update();
|
||||
|
||||
}
|
||||
$delete=HtmlInput::default_value_post("delete_ck", 0);
|
||||
if ( $delete == 0 )
|
||||
{
|
||||
$row=new Acc_Payment($cn,$_POST ['id']);
|
||||
$row->from_array($_POST);
|
||||
$row->update();
|
||||
} else {
|
||||
//---------------------------------------------------------------------------
|
||||
// Delete a card
|
||||
//---------------------------------------------------------------------------
|
||||
if (isset($_POST['delete']))
|
||||
{
|
||||
$row=new Acc_Payment($cn,$_POST['id']);
|
||||
$row->from_array($_POST);
|
||||
$row->delete();
|
||||
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
// Insert a new mod of payment
|
||||
|
|
@ -96,14 +97,14 @@ if ($sb=='ins')
|
|||
{
|
||||
$mp=new Acc_Payment($cn);
|
||||
$r=$mp->blank();
|
||||
echo '<form method="POST" onsubmit="return confirm(\'Vous confirmez ?\')">';
|
||||
echo '<form method="POST" id="payment_frm" onsubmit="return confirm_form(this,\'Vous confirmez ?\')">';
|
||||
echo dossier::hidden();
|
||||
HtmlInput::hidden('ac',$_REQUEST['ac']).HtmlInput::hidden('sb','insert');
|
||||
echo HtmlInput::hidden('ac',$_REQUEST['ac']),HtmlInput::hidden('insert',0);
|
||||
echo $r;
|
||||
echo HtmlInput::submit('insert',_('Enregistre'));
|
||||
echo HtmlInput::submit('insertsub',_('Enregistre'));
|
||||
echo HtmlInput::button_anchor(_('Retour sans sauver'),
|
||||
'?p_action=divers&sa=mp&'.dossier::get()."&ac=".$_REQUEST['ac']
|
||||
);
|
||||
'?p_action=divers&sa=mp&'.dossier::get()."&ac=".$_REQUEST['ac'],
|
||||
"","","smallbutton");
|
||||
echo '</form>';
|
||||
|
||||
return;
|
||||
|
|
@ -115,11 +116,11 @@ if ($sb=='ins')
|
|||
$header=new Sort_Table();
|
||||
$base_url=$_SERVER['PHP_SELF']."?".Dossier::get()."&ac=".$_REQUEST['ac'];
|
||||
|
||||
$header->add("Libelle",$base_url,"order by mp_lib asc","order by mp_lib desc",'la','ld');
|
||||
$header->add("Pour le journal",$base_url,"order by jrn_def_name asc","order by jrn_def_name desc",'ja','jd');
|
||||
$header->add("Type de fiche",$base_url,"order by fd_label asc","order by fd_label desc",'tc','td');
|
||||
$header->add("Enregistré dans le journal",$base_url,"order by jrn_target asc","order by jrn_target desc",'jta','jtd');
|
||||
$header->add("Avec la fiche",$base_url,"order by vw_name asc","order by vw_name desc",'na','nd');
|
||||
$header->add(_("Libelle"),$base_url,"order by mp_lib asc","order by mp_lib desc",'la','ld');
|
||||
$header->add(_("Pour le journal"),$base_url,"order by jrn_def_name asc","order by jrn_def_name desc",'ja','jd');
|
||||
$header->add(_("Type de fiche"),$base_url,"order by fd_label asc","order by fd_label desc",'tc','td');
|
||||
$header->add(_("Enregistré dans le journal"),$base_url,"order by jrn_target asc","order by jrn_target desc",'jta','jtd');
|
||||
$header->add(_("Avec la fiche"),$base_url,"order by vw_name asc","order by vw_name desc",'na','nd');
|
||||
|
||||
$order=(isset($_REQUEST['ord']))?$_REQUEST['ord']:'la';
|
||||
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
*/
|
||||
?>
|
||||
<?php echo $bar?>
|
||||
<form method="POST" class="print" style="display:inline" onsubmit="return confirm('<?php echo _("Vous confirmez ?")?>')">
|
||||
<form method="POST" class="print" style="display:inline" onsubmit="return confirm_form(this,'<?php echo _("Vous confirmez ?")?>')">
|
||||
<table class="sortable" id="fiche_list_table_id">
|
||||
<tr>
|
||||
<th >
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ pour faire toutes les écritures de fin d'exercice: amortissements, régulations
|
|||
</li>
|
||||
</ul>
|
||||
|
||||
<form method="post" onsubmit="return confirm('<?php echo _("Confirmez vous l'ajout d\'un exercice comptable ?")?>')">
|
||||
<form method="post" onsubmit="return confirm_form(this,'<?php echo _("Confirmez vous l'ajout d\'un exercice comptable ?")?>')">
|
||||
<?php
|
||||
echo HtmlInput::hidden("ac",$_REQUEST['ac']);
|
||||
echo $nb_exercice->input();
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
*/
|
||||
?>
|
||||
<div style="<?php if ( ! $p_readonly) echo "position:absolute";?>" class="content">
|
||||
<form method="POST" class="print" onsubmit="return confirm('<?php echo _("Vous confirmez ?")?>')">
|
||||
<form method="POST" class="print" onsubmit="return confirm_form(this,'<?php echo _("Vous confirmez ?")?>')">
|
||||
<table>
|
||||
<tr><td>
|
||||
<?php echo _("Date")?>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue