diff --git a/html/ajax_misc.php b/html/ajax_misc.php
index 0136470f8..c5fad7a9d 100644
--- a/html/ajax_misc.php
+++ b/html/ajax_misc.php
@@ -699,6 +699,27 @@ EOF;
case 'folder_add':
require_once 'ajax_admin.php';
break;
+
+ // From admin, display info and propose to drop the folder
+ case 'folder_drop':
+ require_once 'ajax_admin.php';
+ break;
+
+ // From admin, display the information of a folder you can
+ // modify
+ case 'folder_modify':
+ require_once 'ajax_admin.php';
+ break;
+ // From admin, display info and propose to drop the template
+ case 'modele_drop':
+ require_once 'ajax_admin.php';
+ break;
+
+ // From admin, display the information of a template you can
+ // modify
+ case 'modele_modify':
+ require_once 'ajax_admin.php';
+ break;
default:
var_dump($_GET);
diff --git a/html/js/admin.js b/html/js/admin.js
index 448dc8bef..f4b766756 100644
--- a/html/js/admin.js
+++ b/html/js/admin.js
@@ -128,4 +128,59 @@ function folder_add(p_user, p_dossier)
}
});
-}
\ No newline at end of file
+}
+function display_admin_answer(p_dossier,p_action)
+{
+ waiting_box();
+ new Ajax.Request ("ajax_misc.php",{
+ method:"get",
+ parameters:{"p_dossier":p_dossier,"op":p_action,'gDossier':0},
+ onSuccess : function (p_xml) {
+ try {
+ var div_display="folder_admin_div";
+ var answer = p_xml.responseXML;
+ var a = answer.getElementsByTagName('status');
+ var html = answer.getElementsByTagName('content');
+ if (a.length == 0) {
+ var rec = req.responseText;
+ alert('erreur :' + rec);
+ }
+
+ var folder;
+ var create = false;
+ if (!$(div_display)) {
+ folder = create_div({'id': div_display, 'cssclass': "inner_box", style: 'width:90%;right:5%;top:100px'});
+ create = true;
+ }
+ folder=$(div_display);
+
+ var content = getNodeText(html[0]);
+ folder.innerHTML=unescape_xml(content);
+ var pos=calcy(250);
+ $(div_display).setStyle({top:pos+'px'});
+
+ folder.show();
+ remove_waiting_box();
+ } catch (e) {
+ console.log(e.message);
+ }
+ }
+ });
+}
+function folder_drop(p_dossier)
+{
+ display_admin_answer(p_dossier,'folder_drop');
+}
+
+function folder_modify(p_dossier)
+{
+ display_admin_answer(p_dossier,'folder_modify');
+}
+function modele_modify(p_dossier)
+{
+ display_admin_answer(p_dossier,'modele_modify');
+}
+function modele_drop(p_dossier)
+{
+ display_admin_answer(p_dossier,'modele_drop');
+}
diff --git a/include/ajax_admin.php b/include/ajax_admin.php
index df96795c1..f797dbd9d 100644
--- a/include/ajax_admin.php
+++ b/include/ajax_admin.php
@@ -53,8 +53,7 @@ if ($op=='folder_add') // operation
$dossier->load();
$content="
';
- echo HtmlInput::button_anchor(_('Rafraîchir'),'admin_repo.php?action=dossier_mgt');
- echo HtmlInput::button_anchor(_('Ajouter'),'admin_repo.php?action=dossier_mgt&sa=add');
+ echo HtmlInput::button(_('Ajouter'),_('Ajouter')," onclick=\$('folder_add_id').show()");
echo '
';
$header=new Sort_Table();
$url=$_SERVER['PHP_SELF']."?sa=list&action=".$_REQUEST['action'];
$header->add("id",$url," order by dos_id asc"," order by dos_id desc","da","dd");
$header->add("Nom",$url," order by dos_name asc"," order by dos_name desc","na","nd");
$header->add("Description",$url," order by dos_description asc"," order by dos_description desc","da","dd");
- $repo=new Dossier(0);
+ $repo=new Dossier(0);
$repocn=new Database();
$ord=(isset($_REQUEST['ord']))?$_REQUEST['ord']:'na';
$sql_order=$header->get_sql_order($ord);
$Res=$repocn->get_array("select * from ac_dossier $sql_order");
$compteur=1;
- $template="";
+ $template="";
echo '';
echo '
';
echo _('Filtre').HtmlInput::infobulle(23);
@@ -197,7 +196,7 @@ if ( $sa == 'list' )
else
$cl='class="even"';
- echo " ".
+ echo " ".
$Dossier['dos_id']." ".h($Dossier['dos_name'])." ";
$str_name=domaine.'dossier'.$Dossier['dos_id'];
@@ -214,23 +213,20 @@ if ( $sa == 'list' )
echo td(_("Dossier inexistant"),'style="color:red"');
}
echo td($str_name);
- echo "";
if ( $database_exist > 0)
{
- echo td(HtmlInput::button_anchor(_('Effacer'),'?action=dossier_mgt&sa=del&d='.$Dossier['dos_id']));
+ echo td(HtmlInput::anchor(_('Effacer'),'?action=dossier_mgt&sa=del&d='.$Dossier['dos_id']," onclick=\"folder_drop('".$Dossier['dos_id']."')\""));
- echo td(HtmlInput::button_anchor(_('Modifier'),'?action=dossier_mgt&sa=mod&d='
- .$Dossier['dos_id']));
+ echo td(HtmlInput::anchor(_('Modifier'),'?action=dossier_mgt&sa=mod&d='
+ .$Dossier['dos_id']," onclick=\"folder_modify('".$Dossier['dos_id']."')\""));
- echo td(HtmlInput::button_anchor(_('Backup'),'backup.php?action=backup&sa=b&t=d&d='
+ echo td(HtmlInput::anchor(_('Backup'),'backup.php?action=backup&sa=b&t=d&d='
.$Dossier['dos_id']));
echo ' ';
}
- echo '';
$compteur++;
}
-
echo " ";
}
@@ -238,11 +234,12 @@ if ( $sa == 'list' )
}
-
+?>
+
+ exec_sql("select mod_id,mod_name,mod_desc from
@@ -273,68 +270,27 @@ if ( $sa == 'add' )
load();
- $wText=new IText();
- echo '
';
-}
-//---------------------------------------------------------------------------
-// action = del
-//---------------------------------------------------------------------------
-if ( $sa == 'del' )
-{
- $d=new Dossier($_REQUEST ['d'] );
- $d->load();
- echo '
';
-}
+
+?>
+
+';
- echo HtmlInput::button_anchor('Rafraîchir', 'admin_repo.php?action=modele_mgt');
- echo HtmlInput::button_anchor('Ajouter', 'admin_repo.php?action=modele_mgt&sa=add');
+ echo HtmlInput::button(_('Ajouter'),_('Ajouter')," onclick=\$('folder_add_id').show()");
+
echo '';
echo '';
echo _('Filtre').HtmlInput::infobulle(23);
@@ -254,11 +254,11 @@ if ($sa == 'list')
' %d %s ' .
'
%s ' .
'
' .
- HtmlInput::button_anchor('Effacer', '?action=modele_mgt&sa=del&m=' . $mod['mod_id']) . ' ' .
+ HtmlInput::anchor('Effacer', '?action=modele_mgt&sa=del&m=' . $mod['mod_id']," onclick = \"modele_drop('{$mod['mod_id']}') \"") . '' .
'' .
- '
' . HtmlInput::button_anchor('Modifie', '?action=modele_mgt&sa=mod&m=' . $mod['mod_id']) . ' ' .
+ '
' . HtmlInput::anchor('Modifie', '?action=modele_mgt&sa=mod&m=' . $mod['mod_id']," onclick = \"modele_modify('{$mod['mod_id']}') \"") . ' ' .
'' .
- '
' . HtmlInput::button_anchor('Backup', 'backup.php?action=backup&sa=b&t=m&d='
+ ' ' . HtmlInput::anchor('Backup', 'backup.php?action=backup&sa=b&t=m&d='
. $mod['mod_id']) . ' ' .
'', $mod['mod_id'], $mod['mod_name'], $mod['mod_desc']);
}// for
@@ -269,11 +269,14 @@ if ($sa == 'list')
" Seules les fiches, la structure des journaux, les périodes,... seront reprises " .
"et aucune donnée du dossier sur lequel le dossier est basé. Les données contenues dans les extensions ne sont pas effacées";
}
+?>
+
+ exec_sql("select dos_id, dos_name,dos_description from ac_dossier
order by dos_name");
@@ -323,61 +326,11 @@ if ($sa == 'add')
'
-
-
-
-
+
+
+
';
- $name = $cn->get_value(
- "select mod_name from modeledef where " .
- " mod_id=$1", array($_GET['m']));
-
- $desc = $cn->get_value(
- "select mod_desc from modeledef where " .
- " mod_id=$1", array($_GET['m']));
- $wText = new IText();
- echo 'Nom : ' . $wText->input('name', $name);
- $wDesc = new ITextArea();
- $wDesc->heigh = 5;
- echo '
Description :
';
- echo $wDesc->input('desc', $desc);
- echo HtmlInput::hidden('m', $_GET['m']);
- echo HtmlInput::hidden('action', 'modele_mgt');
- echo '
';
- echo HtmlInput::button_anchor('Retour', '?action=modele_mgt');
- echo HtmlInput::submit('upd', 'Modifie');
- echo '';
- }
-
- //---------------------------------------------------------------------------
- // action = del
- //---------------------------------------------------------------------------
- if ($sa == 'del')
- {
- $cn = new Database();
- $name = $cn->get_value('select mod_name from modeledef where mod_id=$1', array($_REQUEST['m']));
- echo '
';
- }
+
//---------------------------------------------------------------------------
// action = del
//---------------------------------------------------------------------------