X-Git-Url: http://git.plutz.net/?a=blobdiff_plain;f=clients.sh;h=052a0c84c897f82a38bbe4b82ad7b86f285442be;hb=07c2cf90c2194a7e010db30553f016ca6c1bcd05;hp=474f6258538189525f60dea9dff0d2eb40f96301;hpb=bc8eee210325c38d66bef5640deb933c0f680d4d;p=invoices diff --git a/clients.sh b/clients.sh index 474f625..052a0c8 100755 --- a/clients.sh +++ b/clients.sh @@ -19,7 +19,7 @@ edit_client(){ "$(HTML $id)" \ "$(UNSTRING "${address#address=}" |HTML)" \ "$(UNSTRING "${hourly#hourly=}" |grep -xE '[0-9]+')" \ - "$(tid "clients/$id")" + "$(transid "clients/$id")" } list_clients(){ @@ -40,11 +40,17 @@ list_clients(){ update_client(){ local id="$(POST id |checkid)" - if [ "$(POST update)" = "$(tid "clients/$id")" ]; then + if [ "$(POST update)" = "$(transid "clients/$id")" ]; then mkdir -p clients printf 'address=%s hourly=%s' \ "$(POST address |STRING)" "$(POST hourly |STRING)" \ >"clients/$id" + + [ -d .git ] && { + git add "clients/$id" + git commit -m 'Update client info for "'"$(POST address |sed 1q)"'"' -- "clients/$id" + } >/dev/null + REDIRECT "/clients/" else error Invalid Data "$id" "$(POST update)"