[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 48/119: Action and Document Add missing files
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 48/119: Action and Document Add missing files |
Date: |
Mon, 26 Oct 2020 18:27:16 -0400 (EDT) |
sparkyx pushed a commit to branch master
in repository noalyss.
commit 4bab05f76b53238d466b40dda3d75f9d2dc20421
Author: Dany De Bontridder <danydb@noalyss.eu>
AuthorDate: Mon Oct 5 13:50:06 2020 +0200
Action and Document Add missing files
---
include/ajax/ajax_cfgaction.php | 82 +++++++++++++++++++
include/ajax/ajax_contact_option_list.php | 67 ++++++++++++++++
include/class/contact_option_ref_mtable.class.php | 49 ++++++++++++
include/contact_option_ref.inc.php | 58 ++++++++++++++
include/database/document_type_sql.class.php | 68 ++++++++++++++++
.../template/action_document_type_mtable_input.php | 93 ++++++++++++++++++++++
6 files changed, 417 insertions(+)
diff --git a/include/ajax/ajax_cfgaction.php b/include/ajax/ajax_cfgaction.php
new file mode 100644
index 0000000..6562531
--- /dev/null
+++ b/include/ajax/ajax_cfgaction.php
@@ -0,0 +1,82 @@
+<?php
+
+/*
+ * This file is part of NOALYSS.
+ *
+ * PhpCompta is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpCompta is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpCompta; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+// Copyright (2002-2020) Author Dany De Bontridder <danydb@noalyss.eu>
+
+if (!defined('ALLOWED'))
+ die('Appel direct ne sont pas permis');
+
+// check right
+if ($g_user->check_action(PARCATDOC)==0)
+{
+
+ record_log("cfgaction01 security ");
+ return;
+}
+
+require_once NOALYSS_INCLUDE."/class/action_document_type_mtable.class.php";
+
+$http=new HttpInput();
+
+
+/**
+ * @file
+ * @brief call for document_type in follow up
+ */
+try
+{
+ $table=$http->request('table');
+ $ctl_id=$http->request('ctl');
+ $action=$http->request('action');
+ $p_id=$http->request('p_id', "number");
+}
+catch (Exception $ex)
+{
+ echo $e->getMessage();
+ return;
+}
+
+$doc_type=new Document_type_SQL($cn,$p_id);
+$action_document_type=new Action_Document_Type_MTable($doc_type);
+
+$action_document_type->set_callback("ajax_misc.php");
+$action_document_type->add_json_param("op", "cfgaction");
+$action_document_type->set_object_name($ctl_id);
+
+
+
+if ($action=="input")
+{
+
+ header('Content-type: text/xml; charset=UTF-8');
+ echo $action_document_type->ajax_input()->saveXML();
+ return;
+}
+elseif ($action=="save")
+{
+ $xml=$action_document_type->ajax_save();
+ header('Content-type: text/xml; charset=UTF-8');
+ echo $xml->saveXML();
+}
+elseif ($action=="delete")
+{
+ $xml=$action_document_type->ajax_delete();
+ header('Content-type: text/xml; charset=UTF-8');
+ echo $xml->saveXML();
+}
diff --git a/include/ajax/ajax_contact_option_list.php
b/include/ajax/ajax_contact_option_list.php
new file mode 100644
index 0000000..1622d1a
--- /dev/null
+++ b/include/ajax/ajax_contact_option_list.php
@@ -0,0 +1,67 @@
+<?php
+
+/*
+ * This file is part of NOALYSS.
+ *
+ * PhpCompta is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpCompta is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpCompta; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+// Copyright (2002-2020) Author Dany De Bontridder <danydb@noalyss.eu>
+
+if (!defined('ALLOWED'))
+ die('Appel direct ne sont pas permis');
+require_once NOALYSS_INCLUDE."/class/contact_option_ref_mtable.class.php";
+
+/**
+ * @file
+ * @brief add option for contact
+ * @see contact_option_list
+ * @see action_document_type_mtable::input()
+ */
+try
+{
+ $contact_option_id=$http->request("p_id");
+ $ctl_id=$http->request("ctl");
+ $action=$http->request("action");
+}
+catch (Exception $ex)
+{
+ record_log(__FILE__." no p_id");
+ return;
+}
+$cn=Dossier::connect();
+
+// document_option id from document_option where do_code='contact_multiple'
and document_type_id=p_id
+$obj=new Contact_option_ref_SQL($cn);
+
+$contact_mtable=new Contact_Option_Ref_MTable($obj);
+
+$contact_mtable->set_callback("ajax_misc.php");
+$contact_mtable->set_object_name("s_contact_option");
+$contact_mtable->set_dialog_box("db_contact_option");
+$contact_mtable->add_json_param("op", "contact_option_list");
+$contact_mtable->set_object_name($ctl);
+$contact_mtable->set_pk($contact_option_id);
+
+if ($action == "input") {
+ $contact_mtable->send_header();
+ echo $contact_mtable->ajax_input()->saveXML();
+} elseif($action == "save") {
+ $contact_mtable->send_header();
+
+ echo $contact_mtable->ajax_save()->saveXML();
+} elseif ($action == "delete") {
+ $contact_mtable->send_header();
+ $contact_mtable->ajax_delete();
+}
\ No newline at end of file
diff --git a/include/class/contact_option_ref_mtable.class.php
b/include/class/contact_option_ref_mtable.class.php
new file mode 100644
index 0000000..bb8c21f
--- /dev/null
+++ b/include/class/contact_option_ref_mtable.class.php
@@ -0,0 +1,49 @@
+<?php
+
+/*
+ * Copyright (C) 2020 Dany De Bontridder <dany@alchimerys.be>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+// Copyright (2002-2020) Author Dany De Bontridder <danydb@noalyss.eu>
+
+
+/**
+ * @file
+ * @brief
+ * @todo to be implemented
+ */
+require_once NOALYSS_INCLUDE."/database/contact_option_ref_sql.class.php";
+require_once NOALYSS_INCLUDE."/lib/manage_table_sql.class.php";
+
+class Contact_Option_Ref_MTable extends Manage_Table_SQL{
+
+ function __construct(Contact_Option_Ref_SQL $obj)
+ {
+ parent::__construct($obj);
+ $this->set_col_label("cor_label", _("Nom"));
+ $this->set_col_label("cor_type", _("Type "));
+ $this->set_col_label("document_option_id", _("Action"));
+ $this->set_col_label("core_value_select",_("Options"));
+ $this->set_property_visible("cor_id", false);
+ $this->set_col_type("cor_type","select",[
+ ["label"=>_("Texte"),"value"=>0],
+ ["label"=>_("Nombre"),"value"=>1],
+ ["label"=>_("Choix"),"value"=>3],
+ ["label"=>_("Date"),"value"=>2]
+ ]);
+ }
+
+}
diff --git a/include/contact_option_ref.inc.php
b/include/contact_option_ref.inc.php
new file mode 100644
index 0000000..a78cc4d
--- /dev/null
+++ b/include/contact_option_ref.inc.php
@@ -0,0 +1,58 @@
+<?php
+
+/*
+ * This file is part of NOALYSS.
+ *
+ * PhpCompta is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpCompta is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpCompta; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+// Copyright (2002-2020) Author Dany De Bontridder <danydb@noalyss.eu>
+
+if (!defined('ALLOWED'))
+ die('Appel direct ne sont pas permis');
+require_once NOALYSS_INCLUDE."/class/contact_option_ref_mtable.class.php";
+echo '<div class="content">';
+/**
+ * @file
+ * @brief add option for contact
+ * @see contact_option_list
+ * @see action_document_type_mtable::input()
+ */
+$http=new HttpInput();
+try
+{
+ $action=$http->request("sa", "string", "list");
+}
+catch (Exception $ex)
+{
+ record_log(__FILE__." no p_id");
+ return;
+}
+$cn=Dossier::connect();
+
+// document_option id from document_option where do_code='contact_multiple'
and document_type_id=p_id
+$obj=new Contact_option_ref_SQL($cn);
+
+$contact_mtable=new Contact_Option_Ref_MTable($obj);
+
+$contact_mtable->set_callback("ajax_misc.php");
+$contact_mtable->set_object_name("s_contact_option");
+$contact_mtable->set_dialog_box("db_contact_option");
+$contact_mtable->add_json_param("op", "contact_option_list");
+
+$contact_mtable->create_js_script();
+$contact_mtable->display_table();
+
+
+echo '</div>';
\ No newline at end of file
diff --git a/include/database/document_type_sql.class.php
b/include/database/document_type_sql.class.php
new file mode 100644
index 0000000..cd493e3
--- /dev/null
+++ b/include/database/document_type_sql.class.php
@@ -0,0 +1,68 @@
+<?php
+
+/**
+ * Autogenerated file
+ * This file is part of NOALYSS.
+ *
+ * NOALYSS is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * NOALYSS is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with NOALYSS; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+require_once NOALYSS_INCLUDE.'/lib/noalyss_sql.class.php';
+require_once NOALYSS_INCLUDE.'/class/database.class.php';
+
+/**
+ * class_document_type_sql.php
+ *
+ * @file
+ * @brief abstract of the table public.document_type
+ */
+
+/**
+ * @class
+ * @brief abstract of the table public.document_type
+ */
+class Document_type_SQL extends Noalyss_SQL
+{
+
+ function __construct(Database $p_cn, $p_id=-1)
+ {
+ $this->table="public.document_type";
+ $this->primary_key="dt_id";
+ /*
+ * List of columns
+ */
+ $this->name=array(
+ "dt_id"=>"dt_id"
+ , "dt_value"=>"dt_value"
+ , "dt_prefix"=>"dt_prefix"
+ );
+ /*
+ * Type of columns
+ */
+ $this->type=array(
+ "dt_id"=>"numeric"
+ , "dt_value"=>"text"
+ , "dt_prefix"=>"text"
+ );
+
+
+ $this->default=array(
+ "dt_id"=>"auto"
+ );
+
+ $this->date_format="DD.MM.YYYY";
+ parent::__construct($p_cn, $p_id);
+ }
+
+}
diff --git a/include/template/action_document_type_mtable_input.php
b/include/template/action_document_type_mtable_input.php
new file mode 100644
index 0000000..eee3f01
--- /dev/null
+++ b/include/template/action_document_type_mtable_input.php
@@ -0,0 +1,93 @@
+<?php
+/*
+ * This file is part of NOALYSS.
+ *
+ * PhpCompta is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * PhpCompta is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with PhpCompta; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+// Copyright (2002-2019) Author Dany De Bontridder <danydb@noalyss.eu>
+
+if (!defined('ALLOWED'))
+ die('Appel direct ne sont pas permis');
+
+/**
+ * @file
+ * @brief called from p_id already set,
+ * @see action_document_type_mtable::input
+ */
+// SQL Object Document_Type
+$table=$this->get_table();
+// db connx
+$cn=$table->cn;
+?>
+
+<?php echo _('Prochain numéro') ?>
+<p class="info" style="display:inline">
+ (
+<?php echo _('numéro actuel') ?>
+<?php
+$last=0;
+if ( $table->dt_id > 0) {
+ $ret=$cn->get_array("select last_value,is_called from
seq_doc_type_".$table->dt_id);
+
+ $last=$ret[0]['last_value'];
+ /* !
+ * \note With PSQL sequence , the last_value column is 1 when before
AND after the first call, to make the difference between them
+ * I have to check whether the sequence has been already called or not */
+ if ($ret[0]['is_called']=='f')
+ $last--;
+}
+echo $last;
+?>
+ )
+</p>
+
+<?php
+echo
+Icon_Action::infobulle(15);
+?>
+<?php
+$seq=new INum('seq', 0);
+echo $seq->input();
+?>
+<div>
+ <h3 class="info" sytle="margin-block: 4px"><?php echo _("Détail") ?></h3>
+ <ul class="tab_row" style="padding-top: 0px">
+ <li>
+<?php
+$i=new ICheckBox("detail_operation",1);
+if ( Document_Option::is_enable_operation_detail($table->dt_id))
$i->set_check(1);else $i->set_check(0);
+echo $i->input();
+echo _("Détail opération");
+?>
+ </li>
+ <li>
+<?php
+$i=new ICheckBox("det_contact_mul",1);
+if ( Document_Option::is_enable_contact_multiple($table->dt_id))
$i->set_check(1); else $i->set_check(0);
+echo $i->input();
+echo _("Contacts multiples");
+?>
+ </li>
+ <li>
+<?php
+$i=new ICheckBox("make_invoice",1);
+if ( Document_Option::is_enable_make_invoice($table->dt_id)) $i->set_check(1);
else $i->set_check(0);
+echo $i->input();
+echo _("Création de facture");
+?>
+ </li>
+ </ul>
+
+</div>
\ No newline at end of file
- [Noalyss-commit] [noalyss] 80/119: Follow Up : multiple card , search by category of card, (continued)
- [Noalyss-commit] [noalyss] 80/119: Follow Up : multiple card , search by category of card, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 15/119: doc, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 19/119: fix type, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 20/119: documentation, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 26/119: FollowUp : new right : delete action, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 40/119: ManageTable : you can set the style of the dialog box, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 36/119: javascript : add function to concat 2 json objects, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 32/119: Bug : syntax error, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 31/119: Bug : use ilike instead of tilde, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 46/119: Follow-up : tag enable when create doc, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 48/119: Action and Document Add missing files,
Dany De Bontridder <=
- [Noalyss-commit] [noalyss] 57/119: Upgrade DB to 145, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 54/119: Contact option , allow to use option for contact, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 70/119: Card can be disable if not used anymore, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 73/119: Contact option : export CSV, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 67/119: Link between contact option and document, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 75/119: Fix : by default new contact options were not added to document_type, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 63/119: Bug #1839 : : accentuated character broken, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 76/119: Add : upgrade scrip added, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 24/119: Merge branch 'master' of gitlab.noalyss.eu:noalyss/noalyss, Dany De Bontridder, 2020/10/26
- [Noalyss-commit] [noalyss] 25/119: erge branch 'dev-7400-7500', Dany De Bontridder, 2020/10/26