diff --git a/dev/manage-code/create-file/create_config.py b/dev/manage-code/create-file/create_config.py deleted file mode 100755 index 93789b368..000000000 --- a/dev/manage-code/create-file/create_config.py +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/python -#-*- coding: utf-8 -*- -# -import psycopg2 -import psycopg2.extras -import getopt -import sys - -try: - opt,args=getopt.getopt(sys.argv[1:],'s:t:c:') - if len (opt) == 0 : - raise NameError ('option') - schema='public' - table='' - connexion_string='' - class_name="None" - for o,a in opt: - if o == '-s': - schema=a - elif o == '-t': - table=a - elif o == '-c': - connexion_string=a - - if table == '': - raise NameError('table') -except: - print "Utilisation "+sys.argv[0]+" -s nom_du_schema -t nom de la table + c connexion string" - print 'example -t jrnxc -c "dbname=xxx user=xx port=xx password=xxx"' - print """ - This utility create a file, this file can be given as input to the script - create_phpclass.py with the option -f - This will create the corresponding PHP File that you need to put in the include folder - """ - sys.exit(-1) - -cnx=psycopg2.connect (connexion_string) -curs=cnx.cursor(cursor_factory=psycopg2.extras.DictCursor) - -curs.execute(''' - SELECT - columns.column_name,columns.data_type,columns.column_default -FROM - information_schema.columns -WHERE - columns.table_schema=%s - and columns.table_name=%s -''',(schema,table)) -record=curs.fetchall() -file_name=table+"_struct.txt" -file=open(file_name,'w+') - -# class_name -world=table.split('_') -worlds=[] -for i in world: - worlds.append(i.capitalize()) - -class_name='_'.join(worlds) -class_name=class_name+"_SQL" - -file.write(class_name+"\n") -file.write(schema+"."+table+"\n") -record.reverse() -for l in record: - col_name,col_type,col_default=l - file.write ("%s\t|%s\t|%s\n"%(col_name,col_type,col_default)) - -file.close() -print "file %s has been created "%(file_name) -print "check that the first column is the primary key" diff --git a/dev/manage-code/create-file/create_phpclass.py b/dev/manage-code/create-file/create_phpclass.py deleted file mode 100755 index 3786aee33..000000000 --- a/dev/manage-code/create-file/create_phpclass.py +++ /dev/null @@ -1,190 +0,0 @@ -#!/usr/bin/python - - -# Command we have to replace -# @table@ by the table name -# @id@ by the primary key -# @class_name@ Name of the class (uppercase) -# @column_array@ fill the $this->name -# @column_type_array@ fill the $this->type -# read the file with the name -# first line = table name -# second line = pk - -import sys, getopt - -def help(): - print """ - option are -h for help - -f input file containing the structure - -n the PK is not serial - The input file contains : - first line class name : mother class separator : (optionnal) - second line table name - 3rd PK type - ... and after all the column names and column type (see create_file_table.sql) - see the file example - """ -def main(): - try: - opts,args=getopt.getopt(sys.argv[1:],'f:h',['file','help','pk-not-serial']) - except getopt.GetOptError, err: - print str(err) - help() - sys.exit(-1) - filein='' - for option,value in opts: - if option in ('-f','--file'): - filein=value - elif option in ('-h','--help'): - help() - sys.exit(-1) - elif option in ('-n','--pk-not-serial'): - nopk=True - if filein=='' : - help() - sys.exit(-2) - sParent="""column_name,"email"=>"column_name_email","val3"=>0); */ - function __construct($p_id=-1) - { - - - $this->table = "@table@"; - $this->primary_key = "@id@"; - - $this->name = array( - @column_array@ - ); - - $this->type = array( - @column_type_array@ - ); - - $this->default = array( - "@id@" => "auto" - ); - global $cn; - $this->date_format = "DD.MM.YYYY"; - parent::__construct($cn, $p_id); - } - /** - *@brief Add here your own code: verify is always call BEFORE insert or update - */ - public function verify() { - parent::verify(); - @set_tech_user@ - } - -} - -?> -""" - - - # read the file - try : - file=open(filein,'r') - line=file.readlines() - class_name=line[0].strip() - - - table=line[1].strip() - (id,type_id,default)=line[2].strip().split('|') - id=id.strip() - fileoutput=open("class_"+class_name.lower()+".php",'w+') - print "Create the file "+fileoutput.name - - sep='' - i=1 - set_tech_user="" - for e in line[3:]: - if e.find('|') < 0 : - continue - col_name=(e.split('|'))[0].strip() - col_type=(e.split('|'))[1].strip() - if col_name == 'tech_date': - print "*"*80 - print ('Warning : tech_date est un champs technique a utiliser avec un trigger') - print "*"*80 - - if col_name == 'tech_user' : - set_tech_user=" $this->tech_user=$_SESSION['g_user']; " - i+=1 - sep=',' - column_array='' - column_type_array='' - sep='' - var='//------ Attributes-----'+"\n" - for e in line [2:]: - if e.find('|') < 0 : - continue - col_name=(e.split('|'))[0].strip() - col_type=(e.split('|'))[1].strip() - if col_type == 'integer' or col_type == 'numeric' or col_type=='bigint': - col_type="numeric" - elif col_type=='text' or col_type=='character varying' or col_type=='character': - col_type="text" - elif col_type=='oid': - col_type='oid' - elif col_type=='date' or col_type=='timestamp without timezone' or col_type=='timestamp with timezone': - col_type='date' - else : - col_type='set_me' - column_array+=sep+'"'+col_name+'"=>"'+col_name+'"'+"\n" - column_type_array+=sep+'"'+col_name+'"=>"'+col_type+'"'+"\n" - var=var+' var $'+col_name+";\n" - sep=',' - column_array='"'+id+'"=>"'+id+'",'+column_array - i=1;sep='';set=' set ' - column_comma='' - verify_data_type='' - # create verify data_type - for e in line[3:]: - if e.find('|') < 0 : - continue - - (col_id,col_type,default)=e.split('|') - col_id=col_id.strip() - col_type=col_type.strip() - verify_data_type+=" if ( trim($this->"+col_id+") == '') $this->"+col_id+"=null;\n" - if col_type in ('float','integer','numeric','bigint') : - verify_data_type+="if ( $this->"+col_id+"!== null && settype($this->"+col_id+",'float') == false )\n \ - throw new Exception('DATATYPE "+col_id+" $this->"+col_id+" non numerique');\n" - if col_type in ('date',' timestamp without time zone','timestamp with time zone'): - verify_data_type+=" if (isDate($this->"+col_id+") == null )\n \ - throw new Exception('DATATYPE "+col_id+" $this->"+col_id+" date invalide');\n" - - sParent=sParent.replace('@id@',id) - sParent=sParent.replace('@vars@',var) - sParent=sParent.replace('@table@',table) - sParent=sParent.replace('@class_name@',class_name) - sParent=sParent.replace('@column_array@',column_array) - sParent=sParent.replace('@column_type_array@',column_type_array) - sParent=sParent.replace('@set_tech_user@',set_tech_user) - fileoutput.writelines(sParent) - - except : - print "error " - print sys.exc_info() -if __name__ == "__main__": - main() diff --git a/dev/manage-code/create-file/create_trigger.py b/dev/manage-code/create-file/create_trigger.py deleted file mode 100755 index 22fa358cd..000000000 --- a/dev/manage-code/create-file/create_trigger.py +++ /dev/null @@ -1,82 +0,0 @@ -#!/usr/bin/python -# -# Give the code for a trigger -import sys, getopt -def help(): - print """ - option are -h for help - -d default trigger for tech_date - -a action : insert update or delete or a combination separated by comma - -t table name - -s schema name - """ -def main(): - try: - opts,args=getopt.getopt(sys.argv[1:],'hda:t:s:',['help','tech_date','action','table','schema']) - except getopt.GetOptError, err: - print str(err) - help() - sys.exit(-1) - table_name='' - action='' - schema='' - tech_date=False - for option,value in opts: - if option in ('-a','--action'): - action=value - elif option in ('-h','--help'): - help() - sys.exit(-1) - elif option in ('-t','--table'): - table_name=value - elif option in ('-s','--schema'): - schema=value - elif option in ('-d','--tech_date'): - tech_date=True - if table_name=='': - help() - print "The table name is missing" - sys.exit(-2) - - if schema == '': - schema='public' - - if not tech_date and action == '' : - help() - print "No action specified " - sys.exit(-3) - - print ('CREATE OR REPLACE FUNCTION '+schema+'.'+table_name+"_trg"+'() ') - print (' returns trigger ') - print (' as ') - print ('$_BODY_$') - print ('declare ') - print ('begin') - if tech_date : - print (' NEW.tech_date=now() ;') - else : - print (' -- insert your code here ') - print ('return NEW;') - print ('end;') - print ('$_BODY_$ LANGUAGE plpgsql;') - - - print ('CREATE TRIGGER '+table_name+"_trg") - print (" BEFORE / AFTER ") - if action == '' and tech_date : - print (" INSERT OR UPDATE ") - elif len(action.split(',')) > 0: - a_action=action.split(',') - str_or='' - for e in a_action: - print str_or+(e.upper()) - str_or=" OR " - else: - print (action.upper()) - - print (" on "+schema+'.'+table_name) - print (" FOR EACH ROW EXECUTE PROCEDURE "+schema+'.'+table_name+"_trg();") - - - -main() diff --git a/dev/manage-code/create-file/example b/dev/manage-code/create-file/example deleted file mode 100644 index 8ca444f1d..000000000 --- a/dev/manage-code/create-file/example +++ /dev/null @@ -1,7 +0,0 @@ -Fiche_Attr -attr_def - ad_id | integer - ad_text | text - ad_type | numeric - tech_user | text - tech_date | date diff --git a/dev/manage-code/housekeeping/cleanup.sh b/dev/manage-code/housekeeping/cleanup.sh deleted file mode 100755 index 3be4db69b..000000000 --- a/dev/manage-code/housekeeping/cleanup.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash -# clean all phpcompta related DB. -DOMAIN="rel500_" -export PGPASSWORD="dany" -export PGUSER="dany" -export PGHOST=localhost -echo "Etes vous sur de vouloir effacer les db du domaine $DOMAIN Y/N ?" -read A -if [ "$A" == 'Y' ];then - dropdb ${DOMAIN}account_repository - dropdb ${DOMAIN}dossier1 - dropdb ${DOMAIN}dossier3 - dropdb ${DOMAIN}dossier4 - dropdb ${DOMAIN}dossier5 - dropdb ${DOMAIN}dossier13 - dropdb ${DOMAIN}dossier17 - - dropdb ${DOMAIN}mod1 - dropdb ${DOMAIN}mod2 - dropdb ${DOMAIN}mod3 - dropdb ${DOMAIN}mod7 -else - echo "Effacement annule" -fi diff --git a/dev/manage-code/housekeeping/transform.py b/dev/manage-code/housekeeping/transform.py deleted file mode 100755 index c76e9ca61..000000000 --- a/dev/manage-code/housekeeping/transform.py +++ /dev/null @@ -1,100 +0,0 @@ -#!/usr/bin/python -# brief : replace the all class widget -# -# This file is a part of NOALYSS under GPL -# Author D. DE BONTRIDDER danydb@aevalys.eu -import glob -import sys -import re -class Transform: - widget=re.compile("new widget.*;.*") - wegal=re.compile('.*=') - wtext=re.compile("text",re.IGNORECASE) - wselect=re.compile("select",re.IGNORECASE) - wjsDate=re.compile("js_date",re.IGNORECASE) - wHidden=re.compile("hidden",re.IGNORECASE) - wcheckbox=re.compile("checkbox",re.IGNORECASE) - wJSSearch_Poste=re.compile("js_search_poste",re.IGNORECASE) - wJSSearch_only=re.compile("js_search_only",re.IGNORECASE) - wSpan=re.compile("span",re.IGNORECASE) - wFile=re.compile("file",re.IGNORECASE) - wRadio=re.compile("radio",re.IGNORECASE) - wButton=re.compile("button",re.IGNORECASE) - wTextarea=re.compile("textarea",re.IGNORECASE) - wJSConcerned=re.compile("js_concerned",re.IGNORECASE) - wTva=re.compile("js_tva",re.IGNORECASE) - wSearch=re.compile("js_search\"",re.IGNORECASE) - string="" - def __init__(self,p_string): - self.string=p_string - def transform(self): - result=self.string - found_widgets=self.widget.findall(self.string) - if len(found_widgets) > 0: - sEgal=self.wegal.findall(result) - found_widget=found_widgets[0] - result="" - if len(self.wtext.findall(found_widget))>0: - result="new IText" - if len(self.wselect.findall(found_widget))>0: - result="new ISelect" - if len(self.wjsDate.findall(found_widget))>0: - result="new IDate" - if len(self.wHidden.findall(found_widget))>0: - result="new IHidden" - if len(self.wcheckbox.findall(found_widget))>0: - result="new ICheckBox" - if len(self.wJSSearch_Poste.findall(found_widget))>0: - result="new IPoste" - if len(self.wJSSearch_only.findall(found_widget))>0: - result="new ICard" - if len(self.wSpan.findall(found_widget))>0: - result="new ISpan" - if len(self.wFile.findall(found_widget))>0: - result="new IFile" - if len(self.wRadio.findall(found_widget))>0: - result="new IRadio" - if len(self.wTextarea.findall(found_widget))>0: - result="new ITextArea" - if len(self.wButton.findall(found_widget))>0: - result="new IButton" - if len(self.wJSConcerned.findall(found_widget))>0: - result="new IConcerned" - if len(self.wTva.findall(found_widget))>0: - result="new ITva" - if len(self.wSearch.findall(found_widget))>0: - result="new ISearch" - if result == "" : - print "Invalid widget :"+self.string - return 'INVALIDWIDGET '+self.string - result=sEgal[0]+result - reArg=re.compile('\(.*\)') - content=reArg.findall(self.string) - reSplit=re.compile(',') - aArg=reSplit.split(content[0]) - if len(aArg) == 1 : - return result+'();'+"\n" - b=aArg[1:] - virg="" - arg="" - for i in b: - arg=arg+virg+i - virg=',' - return result+'('+arg+';'+"\n" - return result - - -if __name__ == "__main__": - string=" $button_escape=new widget('button','Echapper');" - a=Transform(string) - print a.transform() - -# -# if len(sys.argv) < 1 : -# print "Erreur pas de fichier comme argument" -# sys.exit(1) -# files=glob.glob(sys.argv[1]) -# for file in files: -# lines=file.readlines() -# for line in lines: -# diff --git a/dev/manage-code/housekeeping/usage_file.py b/dev/manage-code/housekeeping/usage_file.py deleted file mode 100755 index 89618724e..000000000 --- a/dev/manage-code/housekeeping/usage_file.py +++ /dev/null @@ -1,49 +0,0 @@ -#!/usr/bin/python -# Check if the files in include are still used -# -# This file is a part of NOALYSS under GPL -# Author D. DE BONTRIDDER danydb@aevalys.eu -from transform import * -import sys -import os -import glob -if len(sys.argv) < 2 : - print "you need at least two arguments : the file name and the files " - print " into you look" - sys.exit(3) - -filenames=glob.glob(sys.argv[1]) -if len(filenames) == 0: - filenames=[] - filenames.append(sys.argv[1]) -print str(filenames)+ "<-"+sys.argv[1] -for f in filenames: - file_usage=[] - filename=os.path.basename(f) - - for a in range(2,len(sys.argv)): - files=glob.glob(sys.argv[a]) - print str(a)+" : "+sys.argv[a] - reFunction=re.compile(filename) - #reFunction=re.compile('(require|include|form).*'+filename,re.IGNORECASE) - for file in files: - #print "Working on file "+file - fold=open(file) - lines=fold.readlines() - for line in lines: - found=reFunction.findall(line) - if len(found) != 0 : - tmp={file:filename} - file_usage.append(tmp) - - fold.close() - #print 'finished, remaining %d' % (total) - #print file_usage - #print "lenght "+str(len(file_usage)) - if len (file_usage) > 0 : - print "This file "+filename+" is used in " - for x in file_usage: - print x.keys()[0] - else: - print filename +" is never used " - diff --git a/dev/manage-code/housekeeping/usage_function.py b/dev/manage-code/housekeeping/usage_function.py deleted file mode 100755 index c41ea753e..000000000 --- a/dev/manage-code/housekeeping/usage_function.py +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/python -# Check if a function is still used -# -# This file is a part of NOALYSS under GPL -# Author D. DE BONTRIDDER danydb@aevalys.eu - -from transform import * -import sys -import os -import glob -if len(sys.argv) < 2 : - print "you need at least one argument : the file containing the function" - print " the second and the thirst are the files where you look for those functions" - sys.exit(3) - -files=glob.glob(sys.argv[1]) -total=len(files) -print "Total file to handle %d " % (len(files)) -reFunction=re.compile('(function) (\w+).*\((.*)\)') -function_name=[] -fList=open("function.txt","a+") -for file in files: - print "Working on file "+file - if file.find('class_') != -1: - continue - fold=open(file) - lines=fold.readlines() - for line in lines: - found=reFunction.findall(line) - if len(found) != 0 : - fctname=found[0][1] - tmp={file:fctname} - function_name.append(tmp) - fList.write(file + ";" + fctname+"\n") - fold.close() - total=total-1 - print 'finished, remaining %d' % (total) -fList.close() -if len(sys.argv) == 2 : - print "the fonctions are " - for e in function_name: - fct=e.values()[0] - print fct - -used={} -for e in function_name: - fct=e.values()[0] - used[fct]=0 -for a in range(2,len(sys.argv)): - print str(a)+ ': '+sys.argv[a] - files_target=glob.glob(sys.argv[a]) - - for e in function_name: - fct=e.values()[0] - for file in files_target: - fd=open(file) - buffer=fd.readlines() - for line in buffer: - if line.find(fct)!= -1: - used[fct]=used[fct]+1 - fd.close() - - -for u in used.keys(): - print "%s : %d " % ( u,used[u]) diff --git a/dev/manage-code/security/without_check.py b/dev/manage-code/security/without_check.py deleted file mode 100755 index bad9a55c2..000000000 --- a/dev/manage-code/security/without_check.py +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/python -# brief = check if the files given in arguments using -# the -> check_dossier function -# -# This file is a part of NOALYSS under GPL -# Author D. DE BONTRIDDER danydb@aevalys.eu - - -import sys -import os -import glob - -if len(sys.argv) == 1: - print "you need one or more filename as argument" - sys.exit(3) - -files=glob.glob(sys.argv[1]) -total=len(files) -print "Total file to handle %d " % (len(files)) -for file in files: - #print "Working on file "+file - fold=open(file) - lines=fold.readlines() - widget=('new User','->check_dossier','->Check') - check={} - for w in widget: - check[w]=0 - require="" - for line in lines: - for w in widget: - if check[w] == 1: - continue - if line.find(w) != -1 : - check[w]=1 - fold.close() - for w in widget: - if check[w] == 0 : - print "Missing in "+file+" "+w - total=total-1 - #print 'finished, remaining %d' % (total) - diff --git a/dev/manage-code/widget/add_require.py b/dev/manage-code/widget/add_require.py deleted file mode 100755 index 9debc5ebc..000000000 --- a/dev/manage-code/widget/add_require.py +++ /dev/null @@ -1,49 +0,0 @@ -#!/usr/bin/python -# brief : replace the all class widget -# -# This file is a part of NOALYSS under GPL -# Author D. DE BONTRIDDER danydb@aevalys.eu - -from transform import * -import sys -import os -import glob - -if len(sys.argv) == 1: - print "you need one or more filename as argument" - sys.exit(3) - -files=glob.glob(sys.argv[1]) -total=len(files) -print "Total file to handle %d " % (len(files)) -for file in files: - print "Working on file "+file - new_file=file - old_file=(file+'.arold') - os.rename(new_file,old_file) - fnew=open(new_file,'a+') - fold=open(old_file) - lines=fold.readlines() - widget=('IHidden','IText','ISpan','ISelect','IDate','ICheckBox','IPoste','ICard','IFile','IRadio','ITextarea','IButton','IConcerned','ITva','ISearch') - check={} - for w in widget: - check[w]=0 - require="" - for line in lines: - for w in widget: - if check[w] == 1: - continue - if line.find(w) != -1 : - require=require+'require_once("class_'+w.lower()+'.php");'+"\n" - check[w]=1 - flag=0 - for line in lines: - if line.find('require')!=-1 and flag == 0: - fnew.write(require) - flag=1 - fnew.write(line) - fnew.close() - fold.close() - total=total-1 - print 'finished, remaining %d' % (total) - diff --git a/dev/manage-code/widget/change.py b/dev/manage-code/widget/change.py deleted file mode 100755 index 02b10bfc2..000000000 --- a/dev/manage-code/widget/change.py +++ /dev/null @@ -1,34 +0,0 @@ -#!/usr/bin/python -# brief : replace the all class widget -# -# This file is a part of NOALYSS under GPL -# Author D. DE BONTRIDDER danydb@aevalys.eu - -from transform import * -import sys -import os -import glob - -if len(sys.argv) == 1: - print "you need one or more filename as argument" - sys.exit(3) - -files=glob.glob(sys.argv[1]) -total=len(files) -print "Total file to handle %d " % (len(files)) -for file in files: - print "Working on file "+file - new_file=file - old_file=(file+'.old') - os.rename(new_file,old_file) - fnew=open(new_file,'a+') - fold=open(old_file) - lines=fold.readlines() - for line in lines: - buf=Transform(line) - fnew.write(buf.transform()) - fnew.close() - fold.close() - total=total-1 - print 'finished, remaining %d' % (total) - diff --git a/dev/manage-code/widget/transform.py b/dev/manage-code/widget/transform.py deleted file mode 100755 index c76e9ca61..000000000 --- a/dev/manage-code/widget/transform.py +++ /dev/null @@ -1,100 +0,0 @@ -#!/usr/bin/python -# brief : replace the all class widget -# -# This file is a part of NOALYSS under GPL -# Author D. DE BONTRIDDER danydb@aevalys.eu -import glob -import sys -import re -class Transform: - widget=re.compile("new widget.*;.*") - wegal=re.compile('.*=') - wtext=re.compile("text",re.IGNORECASE) - wselect=re.compile("select",re.IGNORECASE) - wjsDate=re.compile("js_date",re.IGNORECASE) - wHidden=re.compile("hidden",re.IGNORECASE) - wcheckbox=re.compile("checkbox",re.IGNORECASE) - wJSSearch_Poste=re.compile("js_search_poste",re.IGNORECASE) - wJSSearch_only=re.compile("js_search_only",re.IGNORECASE) - wSpan=re.compile("span",re.IGNORECASE) - wFile=re.compile("file",re.IGNORECASE) - wRadio=re.compile("radio",re.IGNORECASE) - wButton=re.compile("button",re.IGNORECASE) - wTextarea=re.compile("textarea",re.IGNORECASE) - wJSConcerned=re.compile("js_concerned",re.IGNORECASE) - wTva=re.compile("js_tva",re.IGNORECASE) - wSearch=re.compile("js_search\"",re.IGNORECASE) - string="" - def __init__(self,p_string): - self.string=p_string - def transform(self): - result=self.string - found_widgets=self.widget.findall(self.string) - if len(found_widgets) > 0: - sEgal=self.wegal.findall(result) - found_widget=found_widgets[0] - result="" - if len(self.wtext.findall(found_widget))>0: - result="new IText" - if len(self.wselect.findall(found_widget))>0: - result="new ISelect" - if len(self.wjsDate.findall(found_widget))>0: - result="new IDate" - if len(self.wHidden.findall(found_widget))>0: - result="new IHidden" - if len(self.wcheckbox.findall(found_widget))>0: - result="new ICheckBox" - if len(self.wJSSearch_Poste.findall(found_widget))>0: - result="new IPoste" - if len(self.wJSSearch_only.findall(found_widget))>0: - result="new ICard" - if len(self.wSpan.findall(found_widget))>0: - result="new ISpan" - if len(self.wFile.findall(found_widget))>0: - result="new IFile" - if len(self.wRadio.findall(found_widget))>0: - result="new IRadio" - if len(self.wTextarea.findall(found_widget))>0: - result="new ITextArea" - if len(self.wButton.findall(found_widget))>0: - result="new IButton" - if len(self.wJSConcerned.findall(found_widget))>0: - result="new IConcerned" - if len(self.wTva.findall(found_widget))>0: - result="new ITva" - if len(self.wSearch.findall(found_widget))>0: - result="new ISearch" - if result == "" : - print "Invalid widget :"+self.string - return 'INVALIDWIDGET '+self.string - result=sEgal[0]+result - reArg=re.compile('\(.*\)') - content=reArg.findall(self.string) - reSplit=re.compile(',') - aArg=reSplit.split(content[0]) - if len(aArg) == 1 : - return result+'();'+"\n" - b=aArg[1:] - virg="" - arg="" - for i in b: - arg=arg+virg+i - virg=',' - return result+'('+arg+';'+"\n" - return result - - -if __name__ == "__main__": - string=" $button_escape=new widget('button','Echapper');" - a=Transform(string) - print a.transform() - -# -# if len(sys.argv) < 1 : -# print "Erreur pas de fichier comme argument" -# sys.exit(1) -# files=glob.glob(sys.argv[1]) -# for file in files: -# lines=file.readlines() -# for line in lines: -# diff --git a/include/class/class_document.php b/include/class/class_document.php index 55c562cda..439f5dd8e 100644 --- a/include/class/class_document.php +++ b/include/class/class_document.php @@ -156,14 +156,13 @@ class Document $file_to_parse=$filename; } - if ( $p_filename !="") { - + if ( $p_filename !="") { $this->d_filename=$this->compute_filename($p_filename, $this->d_filename); - } + } $this->SaveGenerated($dirname.DIRECTORY_SEPARATOR.$file_to_parse); // Invoice $href=http_build_query(array('gDossier'=>Dossier::id(),"d_id"=>$this->d_id,'act'=>'RAW:document')); - $ret='Document généré'; + $ret=''._('Document').''; @rmdir($dirname); return $ret; } diff --git a/include/class/class_document_modele.php b/include/class/class_document_modele.php index 33cb7d800..edbb2d828 100644 --- a/include/class/class_document_modele.php +++ b/include/class/class_document_modele.php @@ -36,6 +36,7 @@ class Document_modele var $md_sequence; /*!< $md_sequence sequence name (autogenerate) */ var $sequence; /*!< $sequence sequence number used by the create sequence start with */ var $md_affect; /*!< $md_affect if you can use it in VEN for sale, ACH for purchase or GES for follow-up */ + var $md_filename; /*! < $md_filename is the filename of the template */ //Constructor parameter = database connexion function Document_modele($p_cn,$p_id=-1) {